OSSP CVS Repository

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

ossp-pkg/petidomo/subscribe.c 1.15 -> 1.16

--- subscribe.c  2001/01/18 20:30:50     1.15
+++ subscribe.c  2001/01/19 13:31:11     1.16
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/subscribe.c,v $
-   $Revision: 1.15 $
+   $Revision: 1.16 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -213,7 +213,7 @@
         char* command = text_easy_sprintf("subscribe %s %s", address, listname);
         char* cookie  = queue_command(MailStruct, command);
 
-        /* Notify the owner. */
+        /* Send request for confirmation to the user. */
 
         fh = vOpenMailer(envelope, address, NULL);
         if (fh != NULL)
@@ -224,35 +224,48 @@
             fprintf(fh, "Precedence: junk\n");
             fprintf(fh, "Sender: %s\n", envelope);
             fprintf(fh, "\n");
-            buffer = text_easy_sprintf("Per request from \"%s\", the address \"%s\" should be subscribed to " \
-                                       "the mailing list \"%s\". This will not happen unless you confirm the " \
-                                       "request by replying to this mail and citing the string",
-                                       originator, address, listname);
+            if (strcasecmp(address, originator) == 0)
+                buffer = text_easy_sprintf("You requested that the address \"%s\" should be subscribed to " \
+                                           "the mailing list \"%s\". This will not happen unless you confirm the " \
+                                           "request by replying to this mail and citing the string",
+                                           address, listname);
+            else
+                buffer = text_easy_sprintf("Per request from \"%s\", the address \"%s\" should be subscribed to " \
+                                           "the mailing list \"%s\". This will not happen unless you confirm the " \
+                                           "request by replying to this mail and citing the string",
+                                           originator, address, listname);
             text_wordwrap(buffer, 70);
             fprintf(fh, "%s\n", buffer);
             fprintf(fh, "\n    %s\n\n", cookie);
             fprintf(fh, "in your reply.\n");
             CloseMailer(fh);
 
-            fh = vOpenMailer(envelope, originator, NULL);
-            if (fh != NULL)
-                {
-                fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n", listname, ListConfig->fqdn);
-                fprintf(fh, "To: %s\n", originator);
-                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");
-                fprintf(fh, "Sender: %s\n", envelope);
-                fprintf(fh, "\n");
-                fprintf(fh, "Subscribing the address will need confirmation. Such a\n");
-                fprintf(fh, "request has been sent to the address already, so don't move!\n");
-                CloseMailer(fh);
-                }
-            else
+            /* If the request for confirmation has been sent to an
+               address different to that of the originator, notify him
+               what happened. */
+
+            if (strcasecmp(address, originator) != 0)
                 {
-                syslog(LOG_ERR, "Failed to send email to \"%s\" concerning his request.", originator);
-                return -1;
+                fh = vOpenMailer(envelope, originator, NULL);
+                if (fh != NULL)
+                    {
+                    fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n", listname, ListConfig->fqdn);
+                    fprintf(fh, "To: %s\n", originator);
+                    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");
+                    fprintf(fh, "Sender: %s\n", envelope);
+                    fprintf(fh, "\n");
+                    fprintf(fh, "Subscribing the address will need confirmation. Such a\n");
+                    fprintf(fh, "request has been sent to the address already, so don't move!\n");
+                    CloseMailer(fh);
+                    }
+                else
+                    {
+                    syslog(LOG_ERR, "Failed to send email to \"%s\" concerning his request.", originator);
+                    return -1;
+                    }
                 }
             }
         else

CVSTrac 2.0.1