OSSP CVS Repository

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

Check-in Number: 320
Date: 2001-Jan-19 15:18:43 (local)
2001-Jan-19 14:18:43 (UTC)
User:simons
Branch:
Comment: Greatly enhanced the log messages Petidomo writes. Made the existing messages more helpful, added lots of new ones, generally made things real perfect. Remember: Life is BEAUTIFUL.
Tickets:
Inspections:
Files:
ossp-pkg/petidomo/hermes.c      1.12 -> 1.13     29 inserted, 7 deleted
ossp-pkg/petidomo/subscribe.c      1.16 -> 1.17     18 inserted, 8 deleted
ossp-pkg/petidomo/unsubscribe.c      1.15 -> 1.16     20 inserted, 12 deleted

ossp-pkg/petidomo/hermes.c 1.12 -> 1.13

--- hermes.c     2001/01/18 20:30:50     1.12
+++ hermes.c     2001/01/19 14:18:43     1.13
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v $
-   $Revision: 1.12 $
+   $Revision: 1.13 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -62,17 +62,17 @@
 
     if (MailStruct->Envelope == NULL)
         {
-        syslog(LOG_NOTICE, "Received mail without a valid envelope.");
+        syslog(LOG_ERR, "Received mail without a valid envelope.");
         return 0;
         }
     if (MailStruct->From == NULL)
         {
-        syslog(LOG_NOTICE, "Received mail without From: line.");
+        syslog(LOG_ERR, "Received mail without From: line.");
         return 0;
         }
     if (*MailStruct->Body == '\0')
         {
-        syslog(LOG_NOTICE, "Received mail with empty body.");
+        syslog(LOG_INFO, "Received mail with empty body.");
         return 0;
         }
 
@@ -144,8 +144,12 @@
         else if (ListConfig->listtype == LIST_CLOSED)
             {
             /* Only subscribers may post */
+
             if (isSubscribed(listname, MailStruct->From, NULL, NULL, TRUE) == FALSE)
                 {
+                syslog(LOG_NOTICE, "\"%s\" tried to post to closed list \"%s\", but " \
+                       "he is no subscriber.", MailStruct->From, listname);
+
                 fh = vOpenMailer(envelope, owner, NULL);
                 if (fh != NULL)
                     {
@@ -174,7 +178,12 @@
             {
             /* Every posting needs an acknowledgement. */
 
-            char* cookie = queue_posting(MailStruct, listname);
+            char* cookie;
+
+            syslog(LOG_NOTICE, "\"%s\" tried to post to acknowledged list \"%s\"; posting " \
+                   "has been deferred.", MailStruct->From, listname);
+
+            cookie = queue_posting(MailStruct, listname);
             fh = vOpenMailer(owner, MailStruct->Envelope, NULL);
             if (fh != NULL)
                 {
@@ -206,7 +215,12 @@
 
             if (g_is_approved)
                 {
-                int rc = add_address(ListConfig->ack_file, MailStruct->From);
+                int rc;
+
+                syslog(LOG_NOTICE, "\"%s\" acknowledged a former posting attempt on ack-once list \"%s\"; " \
+                       "add him to the ack file and let the posting pass.", MailStruct->From, listname);
+
+                rc = add_address(ListConfig->ack_file, MailStruct->From);
                 if (rc < 0)
                     {
                     syslog(LOG_ERR, "Can't add address to ack file.");
@@ -225,7 +239,12 @@
                     }
                 else if (rc == 0)
                     {
-                    char* cookie = queue_posting(MailStruct, listname);
+                    char* cookie;
+
+                    syslog(LOG_NOTICE, "\"%s\" tried to post to ack-once list \"%s\", but is posting " \
+                           "for the first time; posting has been deferred.", MailStruct->From, listname);
+
+                    cookie = queue_posting(MailStruct, listname);
                     fh = vOpenMailer(owner, MailStruct->Envelope, NULL);
                     if (fh != NULL)
                         {
@@ -251,6 +270,9 @@
                         }
                     return 0;
                     }
+                else
+                    syslog(LOG_NOTICE, "\"%s\" tried to post to ack-once list \"%s\" and has been found in " \
+                           "the ack file; letting posting pass.", MailStruct->From, listname);
                 }
             }
         }


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

--- subscribe.c  2001/01/19 13:31:11     1.16
+++ subscribe.c  2001/01/19 14:18:43     1.17
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/subscribe.c,v $
-   $Revision: 1.16 $
+   $Revision: 1.17 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -72,7 +72,7 @@
             listname = defaultlist;
         else
             {
-            syslog(LOG_NOTICE, "%s: subscribe-command invalid: No list specified.", MailStruct->From);
+            syslog(LOG_INFO, "%s: subscribe-command invalid: No list specified.", MailStruct->From);
             fh = vOpenMailer(envelope, originator, NULL);
             if (fh != NULL)
                 {
@@ -117,8 +117,8 @@
             {
             /* Access was unauthorized, notify the originator. */
 
-            syslog(LOG_INFO, "\"%s\" tried to subscribe \"%s\" to list \"%s\", but couldn't " \
-                   "provide the correct password.", originator, address, listname);
+            syslog(LOG_INFO, "%s: Attempt to subscribe \"%s\" to list \"%s\" rejected due to lack of " \
+                   "a correct admin password.", MailStruct->From, address, listname);
 
             fh = vOpenMailer(envelope, originator, NULL);
             if (fh != NULL)
@@ -142,8 +142,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. */
 
@@ -180,6 +179,9 @@
 
     if (isSubscribed(listname, address, NULL, NULL, FALSE) == TRUE)
         {
+        syslog(LOG_INFO, "%s: Attempt to subscribe \"%s\" to list \"%s\" rejected because the " \
+               "address is already on the list.", MailStruct->From, address, listname);
+
         /* Notify the originator, that the address is already a
            member. */
 
@@ -210,8 +212,14 @@
         {
         /* Require confirmation. */
 
-        char* command = text_easy_sprintf("subscribe %s %s", address, listname);
-        char* cookie  = queue_command(MailStruct, command);
+        char* command;
+        char* cookie;
+
+        syslog(LOG_INFO, "%s: Attempt to subscribe \"%s\" to list \"%s\" deferred because the " \
+               "request must be acknowledged first.", MailStruct->From, address, listname);
+
+        command = text_easy_sprintf("subscribe %s %s", address, listname);
+        cookie  = queue_command(MailStruct, command);
 
         /* Send request for confirmation to the user. */
 
@@ -278,6 +286,8 @@
 
     /* Okay, add the address to the list. */
 
+    syslog(LOG_INFO, "%s: Okay; subscribing address \"%s\" to list \"%s\".", MailStruct->From, address, listname);
+
     fh = fopen(ListConfig->address_file, "a");
     if (fh == NULL)
         {


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