- Added a "Petidomo:" prefix to all subject lines, to distinguish them
from regular mail. Rejection mails furthermore have the prefix "BOUNCE <listaddress>:", mails that need approval have the prefix "APROVE <listaddress>:". - When a mail is rejected due to ACL, the mail body will tell you whether the global acl file or the list's local acl file hit. - If a file "lists/<listname>/header" exists, it contents will be added to the headers of the article posted to the list. Be careful not to have blank lines in there, as this will screw the whole message up. - When generating the index of available mailing lists, the list type will now be typeset in brackets, e.g.: "(public mailing list)". - The index will no longer contain tabs in the mail body.
This commit is contained in:
parent
f1f7dcefda
commit
9aec2b31b5
28
handleacl.c
28
handleacl.c
@ -70,9 +70,9 @@ handleACL(struct Mail * MailStruct, const char * listname, int operation, char *
|
||||
(MailStruct->Reply_To) : (MailStruct->From));
|
||||
fprintf(fh, "Cc: %s\n", owner);
|
||||
if (listname != NULL)
|
||||
fprintf(fh, "Subject: Your posting to list \"%s\" was rejected\n", listname);
|
||||
fprintf(fh, "Subject: Petidomo: BOUNCE %s@%s: Rejected due to ACL\n", listname, ListConfig->fqdn);
|
||||
else
|
||||
fprintf(fh, "Subject: Your petidomo request was rejected\n");
|
||||
fprintf(fh, "Subject: Petidomo: BOUNCE: Rejected due to ACL\n");
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
fprintf(fh, "Sender: %s\n", owner);
|
||||
fprintf(fh, "\n");
|
||||
@ -80,8 +80,14 @@ handleACL(struct Mail * MailStruct, const char * listname, int operation, char *
|
||||
fprintf(fh, "%s\n", buffer);
|
||||
free(buffer);
|
||||
}
|
||||
else {
|
||||
if (listname != NULL)
|
||||
fprintf(fh, "The following posting was rejected by Petidomo, due to\n"
|
||||
"the access control list (ACL) rules for list `%s@%s'.\n", listname, ListConfig->fqdn);
|
||||
else
|
||||
fprintf(fh, "Your article was rejected by the access control rules:\n\n");
|
||||
fprintf(fh, "The following posting was rejected by Petidomo, due to\n" \
|
||||
"the global access control list (ACL) rules.\n\n");
|
||||
}
|
||||
fprintf(fh, "%s\n", MailStruct->Header);
|
||||
fprintf(fh, "%s", MailStruct->Body);
|
||||
CloseMailer(fh);
|
||||
@ -109,16 +115,20 @@ handleACL(struct Mail * MailStruct, const char * listname, int operation, char *
|
||||
fprintf(fh, "From: %s (Petidomo Mailing List Server)\n", owner);
|
||||
fprintf(fh, "To: %s\n", parameter);
|
||||
if (listname != NULL)
|
||||
fprintf(fh, "Subject: Disallowed posting from \"%s\" to list \"%s\"\n",
|
||||
MailStruct->From, listname);
|
||||
fprintf(fh, "Subject: Petidomo: BOUNCE %s@%s: Forwarded due to ACL\n", listname, ListConfig->fqdn);
|
||||
else
|
||||
fprintf(fh, "Subject: Disallowed petidomo request from \"%s\"\n",
|
||||
MailStruct->From);
|
||||
fprintf(fh, "Subject: Petidomo: BOUNCE: Forwarded due to ACL\n");
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
fprintf(fh, "Sender: %s\n", owner);
|
||||
fprintf(fh, "\n");
|
||||
fprintf(fh, "The following article was forwarded to you, due to the\n" \
|
||||
"access control rules:\n\n");
|
||||
if (listname != NULL)
|
||||
fprintf(fh, "The following posting was forwarded to you by Petidomo, due to\n"
|
||||
"the access control list (ACL) rules for list `%s@%s'.\n", listname, ListConfig->fqdn);
|
||||
else
|
||||
fprintf(fh, "The following posting was forwarded to you by Petidomo, due to\n" \
|
||||
"the global access control list (ACL) rules.\n");
|
||||
fprintf(fh, "If you approve this posting, pipe this mail through `petidomo-approve'.\n"
|
||||
"If you do not approve this posting, just do nothing.\n\n");
|
||||
fprintf(fh, "%s\n", MailStruct->Header);
|
||||
fprintf(fh, "%s", MailStruct->Body);
|
||||
CloseMailer(fh);
|
||||
|
||||
8
help.c
8
help.c
@ -60,7 +60,7 @@ SendHelp(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
param1, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", originator);
|
||||
fprintf(fh, "Subject: Your request \"help %s\"\n", param1);
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"help %s\"\n", param1);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
@ -96,7 +96,7 @@ SendHelp(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: petidomo@%s (Petidomo Mailing List Server)\n",
|
||||
MasterConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", originator);
|
||||
fprintf(fh, "Subject: Your request \"help %s\"\n", param1);
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"help %s\"\n", param1);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
@ -130,7 +130,7 @@ SendHelp(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: petidomo@%s (Petidomo Mailing List Server)\n",
|
||||
MasterConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", originator);
|
||||
fprintf(fh, "Subject: Your request \"help\"\n");
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"help\"\n");
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
@ -186,7 +186,7 @@ Indecipherable(struct Mail * MailStruct, const char * defaultlist)
|
||||
fprintf(fh, "From: petidomo@%s (Petidomo Mailing List Server)\n",
|
||||
MasterConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", replyto);
|
||||
fprintf(fh, "Subject: Your request \"indecipherable\"\n");
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"indecipherable\"\n");
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
|
||||
25
hermes.c
25
hermes.c
@ -100,11 +100,11 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
if (fh != NULL) {
|
||||
fprintf(fh, "From: %s (Petidomo Mailing List Server)\n", owner);
|
||||
fprintf(fh, "To: %s\n", owner);
|
||||
fprintf(fh, "Subject: Unauthorized posting to list \"%s\"\n", listname);
|
||||
fprintf(fh, "Subject: Petidomo: BOUNCE %s@%s: Moderator approval required\n", listname, ListConfig->fqdn);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
fprintf(fh, "Sender: %s\n", owner);
|
||||
fprintf(fh, "\n");
|
||||
fprintf(fh, "The following article was rejected:\n\n");
|
||||
fprintf(fh, "The following posting requires your explicit approval:\n\n");
|
||||
fprintf(fh, "%s\n", MailStruct->Header);
|
||||
fprintf(fh, "%s", MailStruct->Body);
|
||||
CloseMailer(fh);
|
||||
@ -124,11 +124,11 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
if (fh != NULL) {
|
||||
fprintf(fh, "From: %s (Petidomo Mailing List Server)\n", owner);
|
||||
fprintf(fh, "To: %s\n", owner);
|
||||
fprintf(fh, "Subject: Unauthorized posting to list \"%s\"\n", listname);
|
||||
fprintf(fh, "Subject: Petidomo: BOUNCE %s@%s: Non-member submission from \"%s\"\n", listname, ListConfig->fqdn, MailStruct->From);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
fprintf(fh, "Sender: %s\n", owner);
|
||||
fprintf(fh, "\n");
|
||||
fprintf(fh, "The following article was rejected, because the sender\n" \
|
||||
fprintf(fh, "The following posting was rejected, because the sender\n" \
|
||||
"\"%s\" is not subscribed to the list:\n\n", MailStruct->From);
|
||||
fprintf(fh, "%s\n", MailStruct->Header);
|
||||
fprintf(fh, "%s", MailStruct->Body);
|
||||
@ -235,6 +235,23 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
dst += len;
|
||||
*dst = '\0';
|
||||
|
||||
/* Add custom headers if there are some. */
|
||||
|
||||
buffer = text_easy_sprintf("lists/%s/header", listname);
|
||||
if (stat(buffer, &sb) == 0)
|
||||
{
|
||||
char* p = loadfile(buffer);
|
||||
if (p == NULL)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed reading the header file for list \"%s\".", listname);
|
||||
exit(1);
|
||||
}
|
||||
strcpy(dst, p);
|
||||
dst += strlen(p);
|
||||
free(p);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
/* Add the signature if there is one. */
|
||||
|
||||
buffer = text_easy_sprintf("lists/%s/signature", listname);
|
||||
|
||||
12
index.c
12
index.c
@ -65,7 +65,7 @@ GenIndex(struct Mail * MailStruct,
|
||||
}
|
||||
fprintf(fh, "From: %s (Petidomo Mailing List Server)\n", from);
|
||||
fprintf(fh, "To: %s\n", address);
|
||||
fprintf(fh, "Subject: Your request \"index\"\n");
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"index\"\n");
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
@ -112,17 +112,17 @@ GenIndex(struct Mail * MailStruct,
|
||||
}
|
||||
if (ListConfig->allowpubsub == TRUE) {
|
||||
if (ListConfig->listtype == LIST_MODERATED)
|
||||
fprintf(fh, "moderated mailing list\n");
|
||||
fprintf(fh, "(moderated mailing list)\n");
|
||||
else
|
||||
fprintf(fh, "public mailing list\n");
|
||||
fprintf(fh, "(public mailing list)\n");
|
||||
}
|
||||
else
|
||||
fprintf(fh, "closed mailing list\n");
|
||||
fprintf(fh, "(closed mailing list)\n");
|
||||
|
||||
buffer = text_easy_sprintf("lists/%s/description", entry->d_name);
|
||||
description = loadfile(buffer);
|
||||
if (description == NULL) {
|
||||
fprintf(fh, "\tno description available\n\n");
|
||||
fprintf(fh, " no description available\n\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ GenIndex(struct Mail * MailStruct,
|
||||
nextLine = text_find_next_line(currLine);
|
||||
if (nextLine[-1] == '\n')
|
||||
nextLine[-1] = '\0';
|
||||
fprintf(fh, "\t%s\n", currLine);
|
||||
fprintf(fh, " %s\n", currLine);
|
||||
}
|
||||
fprintf(fh, "\n");
|
||||
free(description);
|
||||
|
||||
@ -76,7 +76,7 @@ SendSubscriberList(struct Mail * MailStruct,
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", address);
|
||||
fprintf(fh, "Cc: %s\n", owner);
|
||||
fprintf(fh, "Subject: Request \"members %s\"\n", listname);
|
||||
fprintf(fh, "Subject: Petidomo: Request \"members %s\"\n", listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
@ -111,7 +111,7 @@ SendSubscriberList(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", address);
|
||||
fprintf(fh, "Subject: Request \"members %s\"\n", listname);
|
||||
fprintf(fh, "Subject: Petidomo: Request \"members %s\"\n", listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
|
||||
15
subscribe.c
15
subscribe.c
@ -90,7 +90,7 @@ AddAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", originator);
|
||||
fprintf(fh, "Subject: Your request \"subscribe %s %s\"\n", address, listname);
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"subscribe %s %s\"\n", address, listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
@ -116,7 +116,7 @@ AddAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", owner);
|
||||
fprintf(fh, "Subject: Unauthorized request from \"%s\"\n", originator);
|
||||
fprintf(fh, "Subject: Petidomo: APPROVE %s@%s: Unauthorized request from \"%s\"\n", listname, ListConfig->fqdn, originator);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
fprintf(fh, "Sender: %s\n", envelope);
|
||||
fprintf(fh, "\n");
|
||||
@ -151,7 +151,7 @@ AddAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", originator);
|
||||
fprintf(fh, "Subject: Your request \"subscribe %s %s\"\n", address, listname);
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"subscribe %s %s\"\n", address, listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
@ -177,7 +177,7 @@ AddAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", owner);
|
||||
fprintf(fh, "Subject: Unauthorized request from \"%s\"\n", originator);
|
||||
fprintf(fh, "Subject: Petidomo: APPROVE %s@%s: Unauthorized request from \"%s\"\n", listname, ListConfig->fqdn, originator);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
fprintf(fh, "Sender: %s\n", envelope);
|
||||
fprintf(fh, "\n");
|
||||
@ -212,7 +212,7 @@ AddAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", originator);
|
||||
fprintf(fh, "Subject: Your request \"subscribe %s %s\"\n",
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"subscribe %s %s\"\n",
|
||||
address, listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
@ -255,7 +255,7 @@ AddAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "Cc: %s\n", owner);
|
||||
else
|
||||
fprintf(fh, "Cc: %s, %s\n", originator, owner);
|
||||
fprintf(fh, "Subject: Request \"subscribe %s %s\"\n", address, listname);
|
||||
fprintf(fh, "Subject: Petidomo: Request \"subscribe %s %s\"\n", address, listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
@ -297,7 +297,7 @@ AddAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", address);
|
||||
fprintf(fh, "Subject: Welcome to the \"%s\" mailing list!\n", listname);
|
||||
fprintf(fh, "Subject: Petidomo: Welcome to the \"%s\" mailing list!\n", listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
@ -315,4 +315,3 @@ AddAddress(struct Mail * MailStruct,
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ DeleteAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", originator);
|
||||
fprintf(fh, "Subject: Your request \"unsubscribe %s %s\"\n",
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"unsubscribe %s %s\"\n",
|
||||
address, listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
@ -117,7 +117,7 @@ DeleteAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", owner);
|
||||
fprintf(fh, "Subject: Unauthorized request from \"%s\"\n", originator);
|
||||
fprintf(fh, "Subject: Petidomo: APPROVE %s@%s: Unauthorized request from \"%s\"\n", listname, ListConfig->fqdn, originator);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
fprintf(fh, "Sender: %s\n", envelope);
|
||||
fprintf(fh, "\n");
|
||||
@ -151,7 +151,7 @@ DeleteAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", originator);
|
||||
fprintf(fh, "Subject: Your request \"unsubscribe %s %s\"\n",
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"unsubscribe %s %s\"\n",
|
||||
address, listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
@ -178,7 +178,7 @@ DeleteAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", owner);
|
||||
fprintf(fh, "Subject: Unauthorized request from \"%s\"\n", originator);
|
||||
fprintf(fh, "Subject: Petidomo: APPROVE %s@%s: Unauthorized request from \"%s\"\n", listname, ListConfig->fqdn, originator);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
fprintf(fh, "Sender: %s\n", envelope);
|
||||
fprintf(fh, "\n");
|
||||
@ -213,7 +213,7 @@ DeleteAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
|
||||
listname, ListConfig->fqdn);
|
||||
fprintf(fh, "To: %s\n", originator);
|
||||
fprintf(fh, "Subject: Your request \"unsubscribe %s %s\"\n",
|
||||
fprintf(fh, "Subject: Petidomo: Your request \"unsubscribe %s %s\"\n",
|
||||
address, listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
@ -257,7 +257,7 @@ DeleteAddress(struct Mail * MailStruct,
|
||||
fprintf(fh, "Cc: %s\n", owner);
|
||||
else
|
||||
fprintf(fh, "Cc: %s, %s\n", originator, owner);
|
||||
fprintf(fh, "Subject: Request \"unsubscribe %s %s\"\n", address, listname);
|
||||
fprintf(fh, "Subject: Petidomo: Request \"unsubscribe %s %s\"\n", address, listname);
|
||||
if (MailStruct->Message_Id != NULL)
|
||||
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
|
||||
fprintf(fh, "Precedence: junk\n");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user