OSSP CVS Repository

ossp - Difference in ossp-pkg/petidomo/hermes.c versions 1.8 and 1.9
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/petidomo/hermes.c 1.8 -> 1.9

--- hermes.c     2001/01/15 17:23:25     1.8
+++ hermes.c     2001/01/15 19:18:49     1.9
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v $
-   $Revision: 1.8 $
+   $Revision: 1.9 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -124,7 +124,7 @@
             return 0;
             }
 
-        if (ListConfig->listtype == LIST_CLOSED)
+        else if (ListConfig->listtype == LIST_CLOSED)
             {
             /* Only subscribers may post */
             if (isSubscribed(listname, MailStruct->From, NULL, NULL, TRUE) == FALSE)
@@ -153,6 +153,36 @@
                 }
             }
 
+        else if (ListConfig->listtype == LIST_ACKED && !g_is_approved)
+            {
+            /* Every posting needs an acknowledgement. */
+
+            char* cookie = queue_posting(MailStruct, listname);
+            fh = vOpenMailer(owner, MailStruct->Envelope, NULL);
+            if (fh != NULL)
+                {
+                fprintf(fh, "From: petidomo-approve@%s (Petidomo Mailing List Server)\n", ListConfig->fqdn);
+                fprintf(fh, "To: %s\n", MailStruct->Envelope);
+                fprintf(fh, "Subject: Petidomo: CONFIRM %s@%s: Your posting to list \"%s\"\n", listname, ListConfig->fqdn, listname);
+                fprintf(fh, "Precedence: junk\n");
+                fprintf(fh, "Sender: %s\n", owner);
+                fprintf(fh, "\n");
+                fprintf(fh, "Your posting needs to be confirmed. Do this by replying\n");
+                fprintf(fh, "to this mail and citing the string\n");
+                fprintf(fh, "\n");
+                fprintf(fh, "    %s\n", cookie);
+                fprintf(fh, "\n");
+                fprintf(fh, "in your reply.\n");
+                CloseMailer(fh);
+                }
+            else
+                {
+                syslog(LOG_ERR, "Failed to send email to \"%s\" concerning this request.", owner);
+                return -1;
+                }
+            return 0;
+            }
+
         if (checkACL(MailStruct, listname, &operation, &parameter) != 0)
             {
             syslog(LOG_ERR, "checkACL() failed with an error.");

CVSTrac 2.0.1