OSSP CVS Repository

ossp - Check-in [249]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 249
Date: 2001-Jan-06 12:05:08 (local)
2001-Jan-06 11:05:08 (UTC)
User:simons
Branch:
Comment: - 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.

Tickets:
Inspections:
Files:
ossp-pkg/petidomo/handleacl.c      1.4 -> 1.5     20 inserted, 10 deleted
ossp-pkg/petidomo/help.c      1.4 -> 1.5     5 inserted, 5 deleted
ossp-pkg/petidomo/hermes.c      1.3 -> 1.4     22 inserted, 5 deleted
ossp-pkg/petidomo/index.c      1.4 -> 1.5     7 inserted, 7 deleted
ossp-pkg/petidomo/members.c      1.4 -> 1.5     3 inserted, 3 deleted
ossp-pkg/petidomo/subscribe.c      1.4 -> 1.5     8 inserted, 9 deleted
ossp-pkg/petidomo/unsubscribe.c      1.4 -> 1.5     7 inserted, 7 deleted

ossp-pkg/petidomo/handleacl.c 1.4 -> 1.5

--- handleacl.c  2001/01/06 10:11:58     1.4
+++ handleacl.c  2001/01/06 11:05:08     1.5
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/handleacl.c,v $
-   $Revision: 1.4 $
+   $Revision: 1.5 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -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);


ossp-pkg/petidomo/help.c 1.4 -> 1.5

--- help.c       2000/12/15 16:16:07     1.4
+++ help.c       2001/01/06 11:05:08     1.5
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/help.c,v $
-   $Revision: 1.4 $
+   $Revision: 1.5 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -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");


ossp-pkg/petidomo/hermes.c 1.3 -> 1.4

--- hermes.c     2000/12/15 15:48:00     1.3
+++ hermes.c     2001/01/06 11:05:08     1.4
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v $
-   $Revision: 1.3 $
+   $Revision: 1.4 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -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);


ossp-pkg/petidomo/index.c 1.4 -> 1.5

--- index.c      2000/12/15 16:16:07     1.4
+++ index.c      2001/01/06 11:05:08     1.5
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/index.c,v $
-   $Revision: 1.4 $
+   $Revision: 1.5 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -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);


ossp-pkg/petidomo/members.c 1.4 -> 1.5

--- members.c    2000/12/15 16:16:07     1.4
+++ members.c    2001/01/06 11:05:08     1.5
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/members.c,v $
-   $Revision: 1.4 $
+   $Revision: 1.5 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -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");


ossp-pkg/petidomo/subscribe.c 1.4 -> 1.5

--- subscribe.c  2000/12/15 16:16:07     1.4
+++ subscribe.c  2001/01/06 11:05:08     1.5
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/subscribe.c,v $
-   $Revision: 1.4 $
+   $Revision: 1.5 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -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;
 }
-


ossp-pkg/petidomo/unsubscribe.c 1.4 -> 1.5

--- unsubscribe.c        2000/12/15 16:16:07     1.4
+++ unsubscribe.c        2001/01/06 11:05:08     1.5
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/unsubscribe.c,v $
-   $Revision: 1.4 $
+   $Revision: 1.5 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -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");

CVSTrac 2.0.1