OSSP CVS Repository

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

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

--- unsubscribe.c        2001/01/19 13:31:11     1.15
+++ unsubscribe.c        2001/01/19 14:18:43     1.16
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/unsubscribe.c,v $
-   $Revision: 1.15 $
+   $Revision: 1.16 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -73,7 +73,7 @@
             listname = defaultlist;
         else
             {
-            syslog(LOG_NOTICE, "%s: unsubscribe-command invalid: No list specified.", MailStruct->From);
+            syslog(LOG_INFO, "%s: unsubscribe-command invalid: No list specified.", MailStruct->From);
             fh = vOpenMailer(envelope, originator, NULL);
             if (fh != NULL)
                 {
@@ -118,8 +118,8 @@
             {
             /* Access was unauthorized, notify the originator. */
 
-            syslog(LOG_INFO, "\"%s\" tried to unsubscribe \"%s\" from list \"%s\", but " \
-                   "couldn't provide the correct password.", originator, address, listname);
+            syslog(LOG_INFO, "%s: Attempt to unsubscribe \"%s\" from list \"%s\" rejected due to lack of " \
+                   "a correct admin password.", MailStruct->From, address, listname);
 
             fh = vOpenMailer(envelope, originator, NULL);
             if (fh != NULL)
@@ -134,8 +134,7 @@
                 fprintf(fh, "Precedence: junk\n");
                 fprintf(fh, "Sender: %s\n", envelope);
                 fprintf(fh, "\n");
-                buffer = text_easy_sprintf(
-                                           "The mailing list \"%s\" is a closed forum and only the maintainer may " \
+                buffer = text_easy_sprintf("The mailing list \"%s\" is a closed forum and only the maintainer may " \
                                            "unsubscribe addresses. Your request has been forwarded to the " \
                                            "appropriate person, so please don't send any further mail. You will " \
                                            "be notified as soon as possible.", listname);
@@ -144,8 +143,7 @@
                 CloseMailer(fh);
                 }
             else
-                syslog(LOG_ERR, "Failed to send email to \"%s\" concerning his request.",
-                       originator);
+                syslog(LOG_ERR, "Failed to send email to \"%s\" concerning his request.", originator);
 
             /* Notify the owner. */
 
@@ -159,8 +157,7 @@
                 fprintf(fh, "Precedence: junk\n");
                 fprintf(fh, "Sender: %s\n", envelope);
                 fprintf(fh, "\n");
-                buffer = text_easy_sprintf(
-                                           "\"%s\" tried to unsubscribe the address \"%s\" from the \"%s\" mailing list, " \
+                buffer = text_easy_sprintf("\"%s\" tried to unsubscribe the address \"%s\" from the \"%s\" mailing list, " \
                                            "but couldn't provide the correct password. To unsubscribe him, send the " \
                                            "following commands to the server:", originator, address, listname);
                 text_wordwrap(buffer, 70);
@@ -182,6 +179,9 @@
 
     if (isSubscribed(listname, address, &list, &p, FALSE) == FALSE)
         {
+       syslog(LOG_INFO, "%s: Attempt to unsubscribe \"%s\" from list \"%s\" rejected because the " \
+              "address is not on the list.", MailStruct->From, address, listname);
+
         /* Notify the originator, that the address is not subscribed at
            all. */
 
@@ -215,8 +215,14 @@
             {
             /* Require confirmation. */
 
-            char* command = text_easy_sprintf("unsubscribe %s %s", address, listname);
-            char* cookie  = queue_command(MailStruct, command);
+            char* command;
+            char* cookie;
+
+            syslog(LOG_INFO, "%s: Attempt to unsubscribe \"%s\" from list \"%s\" deferred because the " \
+                   "request must be acknowledged first.", MailStruct->From, address, listname);
+
+            command = text_easy_sprintf("unsubscribe %s %s", address, listname);
+            cookie  = queue_command(MailStruct, command);
 
             /* Send request for confirmation to the user. */
 
@@ -282,6 +288,8 @@
             return 0;
             }
 
+        syslog(LOG_INFO, "%s: Okay; unsubscribing address \"%s\" from list \"%s\".", MailStruct->From, address, listname);
+
         fh = fopen(ListConfig->address_file, "w");
         if (fh == NULL)
             {

CVSTrac 2.0.1