Index: ossp-pkg/petidomo/handleacl.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/handleacl.c,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/petidomo/handleacl.c,v' 2>/dev/null --- handleacl.c 2001/01/06 10:11:58 1.4 +++ handleacl.c 2001/01/06 11:05:08 1.5 @@ -70,9 +70,9 @@ (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 @@ 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 @@ 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); Index: ossp-pkg/petidomo/help.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/help.c,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/petidomo/help.c,v' 2>/dev/null --- help.c 2000/12/15 16:16:07 1.4 +++ help.c 2001/01/06 11:05:08 1.5 @@ -60,7 +60,7 @@ 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 @@ 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 @@ 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 @@ 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"); Index: ossp-pkg/petidomo/hermes.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v' 2>/dev/null --- hermes.c 2000/12/15 15:48:00 1.3 +++ hermes.c 2001/01/06 11:05:08 1.4 @@ -100,11 +100,11 @@ 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 @@ 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 @@ 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); Index: ossp-pkg/petidomo/index.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/index.c,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/petidomo/index.c,v' 2>/dev/null --- index.c 2000/12/15 16:16:07 1.4 +++ index.c 2001/01/06 11:05:08 1.5 @@ -65,7 +65,7 @@ } 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 @@ } 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 @@ 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); Index: ossp-pkg/petidomo/members.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/members.c,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/petidomo/members.c,v' 2>/dev/null --- members.c 2000/12/15 16:16:07 1.4 +++ members.c 2001/01/06 11:05:08 1.5 @@ -76,7 +76,7 @@ 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 @@ 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"); Index: ossp-pkg/petidomo/subscribe.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/subscribe.c,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/petidomo/subscribe.c,v' 2>/dev/null --- subscribe.c 2000/12/15 16:16:07 1.4 +++ subscribe.c 2001/01/06 11:05:08 1.5 @@ -90,7 +90,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } return 0; } - Index: ossp-pkg/petidomo/unsubscribe.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/unsubscribe.c,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/petidomo/unsubscribe.c,v' 2>/dev/null --- unsubscribe.c 2000/12/15 16:16:07 1.4 +++ unsubscribe.c 2001/01/06 11:05:08 1.5 @@ -90,7 +90,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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");