OSSP CVS Repository

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

Check-in Number: 358
Date: 2001-Jan-20 16:03:11 (local)
2001-Jan-20 15:03:11 (UTC)
User:rse
Branch:
Comment: Sorry, I still inist that Petidomo visually resembles Majordomo as close as possible: now Petidomo no longer just sends a carbon-copy of the final "successful" mail after subscribe/unsubscribe operations to the list owner. Instead the list owner gets an own dedicated mail. The most important thing is that those mails have "SUBSCRIBE" and "UNSUBSCRIBE" tags in their Subject so one can easily monitor those operations as the list owner.
Tickets:
Inspections:
Files:
ossp-pkg/petidomo/subscribe.c      1.21 -> 1.22     42 inserted, 10 deleted
ossp-pkg/petidomo/unsubscribe.c      1.19 -> 1.20     43 inserted, 10 deleted

ossp-pkg/petidomo/subscribe.c 1.21 -> 1.22

--- subscribe.c  2001/01/20 14:08:25     1.21
+++ subscribe.c  2001/01/20 15:03:11     1.22
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/subscribe.c,v $
-   $Revision: 1.21 $
+   $Revision: 1.22 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -303,22 +303,19 @@
     fprintf(fh, "%s\n", address);
     fclose(fh);
 
-    /* Send success notification to the originator, the new
-       subscriber, and the owner. */
+    /* Send success notification to the originator and the new subscriber */
 
     if (!strcasecmp(address, originator) == TRUE)
-        fh = vOpenMailer(envelope, address, owner, NULL);
+        fh = vOpenMailer(envelope, address, NULL);
     else
-        fh = vOpenMailer(envelope, address, originator, owner, NULL);
+        fh = vOpenMailer(envelope, address, originator, NULL);
     if (fh != NULL)
         {
         fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
                 listname, ListConfig->fqdn);
         fprintf(fh, "To: %s\n", address);
-        if (!strcasecmp(address, originator) == TRUE)
-            fprintf(fh, "Cc: %s\n", owner);
-        else
-            fprintf(fh, "Cc: %s, %s\n", originator, owner);
+        if (strcasecmp(address, originator) == TRUE)
+            fprintf(fh, "Cc: %s\n", originator);
         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);
@@ -350,10 +347,45 @@
         }
     else
         {
-        syslog(LOG_ERR, "Failed to send email to \"%s\"!", owner);
+        syslog(LOG_ERR, "Failed to send email to \"%s\"!", address);
         return -1;
         }
 
+    /* Send success notification to the list owner */
+
+    fh = vOpenMailer(envelope, owner, NULL);
+    if (fh != NULL) {
+        fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
+                listname, ListConfig->fqdn);
+        fprintf(fh, "To: %s\n", owner);
+        fprintf(fh, "Subject: Petidomo: SUBSCRIBE %s@%s: %s\n", listname, ListConfig->fqdn, address);
+        if (MailStruct->Message_Id != NULL)
+            fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
+        fprintf(fh, "Precedence: junk\n");
+        fprintf(fh, "Sender: %s\n", envelope);
+        fprintf(fh, "\n");
+        if (!strcasecmp(address, originator) == TRUE) {
+            buffer = text_easy_sprintf(
+                         "Per request from the subscriber, the address \"%s\"\n"
+                         "has been subscribed to the \"%s\" mailing list.\n",
+                         address, listname, ListConfig->fqdn);
+        }
+        else {
+            buffer = text_easy_sprintf(
+                         "Per request from \"%s\", the address \"%s\"\n"
+                         "has been subscribed to the \"%s\" mailing list.\n",
+                         originator, address, listname, ListConfig->fqdn);
+        }
+        text_wordwrap(buffer, 75);
+        fprintf(fh, "%s\n", buffer);
+        fprintf(fh, "No action is required on your part.\n");
+        CloseMailer(fh);
+    }
+    else {
+        syslog(LOG_ERR, "Failed to send email to \"%s\"!", owner);
+        return -1;
+    }
+
     /* Send introduction text to the new member. */
 
     p = loadfile(ListConfig->intro_file);


ossp-pkg/petidomo/unsubscribe.c 1.19 -> 1.20

--- unsubscribe.c        2001/01/20 13:52:41     1.19
+++ unsubscribe.c        2001/01/20 15:03:11     1.20
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/unsubscribe.c,v $
-   $Revision: 1.19 $
+   $Revision: 1.20 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -308,22 +308,19 @@
         fprintf(fh, "%s", p);
         fclose(fh);
 
-        /* Send success notification to the originator, and the
-           unsubscribed address. */
+        /* Send success notification to the originator and the unsubscribed address */
 
         if (!strcasecmp(address, originator) == TRUE)
-            fh = vOpenMailer(envelope, address, owner, NULL);
+            fh = vOpenMailer(envelope, address, NULL);
         else
-            fh = vOpenMailer(envelope, address, originator, owner, NULL);
+            fh = vOpenMailer(envelope, address, originator, NULL);
         if (fh != NULL)
             {
             fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
                     listname, ListConfig->fqdn);
             fprintf(fh, "To: %s\n", address);
-            if (!strcasecmp(address, originator) == TRUE)
-                fprintf(fh, "Cc: %s\n", owner);
-            else
-                fprintf(fh, "Cc: %s, %s\n", originator, owner);
+            if (strcasecmp(address, originator) == TRUE)
+                fprintf(fh, "Cc: %s\n", originator);
             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);
@@ -348,10 +345,46 @@
             }
         else
             {
-            syslog(LOG_ERR, "Failed to send email to \"%s\"!", owner);
+            syslog(LOG_ERR, "Failed to send email to \"%s\"!", address);
             return -1;
             }
         }
+
+        /* Send success notification to the list owner */
+
+        fh = vOpenMailer(envelope, owner, NULL);
+        if (fh != NULL) {
+            fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
+                    listname, ListConfig->fqdn);
+            fprintf(fh, "To: %s\n", owner);
+            fprintf(fh, "Subject: Petidomo: UNSUBSCRIBE %s@%s: %s\n", listname, ListConfig->fqdn, address);
+            if (MailStruct->Message_Id != NULL)
+                fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
+            fprintf(fh, "Precedence: junk\n");
+            fprintf(fh, "Sender: %s\n", envelope);
+            fprintf(fh, "\n");
+            if (!strcasecmp(address, originator) == TRUE) {
+                buffer = text_easy_sprintf(
+                             "Per request from the subscriber, the address \"%s\"\n"
+                             "has been unsubscribed from the \"%s\" mailing list.\n",
+                             address, listname, ListConfig->fqdn);
+            }
+            else {
+                buffer = text_easy_sprintf(
+                             "Per request from \"%s\", the address \"%s\"\n"
+                             "has been unsubscribed from the \"%s\" mailing list.\n",
+                             originator, address, listname, ListConfig->fqdn);
+            }
+            text_wordwrap(buffer, 75);
+            fprintf(fh, "%s\n", buffer);
+            fprintf(fh, "No action is required on your part.\n");
+            CloseMailer(fh);
+        }
+        else {
+            syslog(LOG_ERR, "Failed to send email to \"%s\"!", owner);
+            return -1;
+        }
+
     free(list);
     return 0;
     }

CVSTrac 2.0.1