lists. This is now a top-level Citadel header field (L), which makes
it parseable by the Sieve engine. Also added List-ID to the header
fields selectable in the mailbox filter rules editor. And of course,
we are generating this field when we send out traffic from a Citadel-hosted
mailing list. This also closes Bug #371.
+ else if (!strcasecmp(key, "List-ID")) {
+ if (msg->cm_fields['L'] == NULL)
+ msg->cm_fields['L'] = strdup(value);
+ processed = 1;
+ }
+
else if (!strcasecmp(key, "To")) {
if (msg->cm_fields['R'] == NULL)
msg->cm_fields['R'] = strdup(value);
else if (!strcasecmp(key, "To")) {
if (msg->cm_fields['R'] == NULL)
msg->cm_fields['R'] = strdup(value);
msg->cm_fields['F'] = strdup(buf);
msg->cm_fields['R'] = strdup(buf);
msg->cm_fields['F'] = strdup(buf);
msg->cm_fields['R'] = strdup(buf);
+ /* Set the 'List-ID' header */
+ msg->cm_fields['L'] = malloc(1024);
+ snprintf(msg->cm_fields['L'], 1024,
+ "%s <%ld.list-id.%s>",
+ CC->room.QRname,
+ CC->room.QRnumber,
+ config.c_fqdn
+ );
+
/*
* Go fetch the contents of the digest
*/
/*
* Go fetch the contents of the digest
*/
msg = CtdlFetchMessage(msgnum, 1);
if (msg != NULL) {
msg = CtdlFetchMessage(msgnum, 1);
if (msg != NULL) {
+ /* Set the 'List-ID' header */
+ if (msg->cm_fields['L'] != NULL) {
+ free(msg->cm_fields['L']);
+ }
+ msg->cm_fields['L'] = malloc(1024);
+ snprintf(msg->cm_fields['L'], 1024,
+ "%s <%ld.list-id.%s>",
+ CC->room.QRname,
+ CC->room.QRnumber,
+ config.c_fqdn
+ );
+
/* Prepend "[List name]" to the subject */
if (msg->cm_fields['U'] == NULL) {
msg->cm_fields['U'] = strdup("(no subject)");
/* Prepend "[List name]" to the subject */
if (msg->cm_fields['U'] == NULL) {
msg->cm_fields['U'] = strdup("(no subject)");
else if (i == 'P') {
cprintf("Return-Path: %s%s", mptr, nl);
}
else if (i == 'P') {
cprintf("Return-Path: %s%s", mptr, nl);
}
+ else if (i == 'L') {
+ cprintf("List-ID: %s%s", mptr, nl);
+ }
else if (i == 'V') {
if ((flags & QP_EADDR) != 0)
mptr = qp_encode_email_addrs(mptr);
else if (i == 'V') {
if ((flags & QP_EADDR) != 0)
mptr = qp_encode_email_addrs(mptr);
is disqualified from being journaled, perhaps because
it is itself a journalized message and we wish to
avoid double journaling.
is disqualified from being journaled, perhaps because
it is itself a journalized message and we wish to
avoid double journaling.
+L List-ID Mailing list identification, as per RFC 2919
M Message Text Normal ASCII, newlines seperated by CR's or LF's,
null terminated as always.
N Nodename Contains node name of system message originated on.
M Message Text Normal ASCII, newlines seperated by CR's or LF's,
null terminated as always.
N Nodename Contains node name of system message originated on.
+ else if (!strcasecmp(hfield, "listid")) {
+ serv_printf("if%s header %s \"List-ID\" \"%s\"",
+ comp1, comp2,
+ htext
+ );
+ }
+
else if (!strcasecmp(hfield, "envfrom")) {
serv_printf("if%s envelope %s \"From\" \"%s\"",
comp1, comp2,
else if (!strcasecmp(hfield, "envfrom")) {
serv_printf("if%s envelope %s \"From\" \"%s\"",
comp1, comp2,
serv_printf("# WEBCIT_RULE|%d|%s|", i, encoded_rule);
output_sieve_rule(hfield, compare, htext, sizecomp, sizeval,
action, fileinto, redirect, automsg, final, my_addresses);
serv_printf("# WEBCIT_RULE|%d|%s|", i, encoded_rule);
output_sieve_rule(hfield, compare, htext, sizecomp, sizeval,
action, fileinto, redirect, automsg, final, my_addresses);
wprintf("<td width=20%%>%s ", _("If") );
wprintf("<td width=20%%>%s ", _("If") );
- char *hfield_values[14][2] = {
+ char *hfield_values[15][2] = {
{ "from", _("From") },
{ "tocc", _("To or Cc") },
{ "subject", _("Subject") },
{ "from", _("From") },
{ "tocc", _("To or Cc") },
{ "subject", _("Subject") },
{ "xmailer", _("X-Mailer") },
{ "xspamflag", _("X-Spam-Flag") },
{ "xspamstatus", _("X-Spam-Status") },
{ "xmailer", _("X-Mailer") },
{ "xspamflag", _("X-Spam-Flag") },
{ "xspamstatus", _("X-Spam-Status") },
+ { "listid", _("List-ID") },
{ "size", _("Message size") },
{ "all", _("All") }
};
wprintf("<select id=\"hfield%d\" name=\"hfield%d\" size=1 onChange=\"UpdateRules();\">",
i, i);
{ "size", _("Message size") },
{ "all", _("All") }
};
wprintf("<select id=\"hfield%d\" name=\"hfield%d\" size=1 onChange=\"UpdateRules();\">",
i, i);
wprintf("<option %s value=\"%s\">%s</option>",
( (!strcasecmp(hfield, hfield_values[j][0])) ? "selected" : ""),
hfield_values[j][0],
wprintf("<option %s value=\"%s\">%s</option>",
( (!strcasecmp(hfield, hfield_values[j][0])) ? "selected" : ""),
hfield_values[j][0],