OSSP CVS Repository

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

Check-in Number: 279
Date: 2001-Jan-15 18:56:33 (local)
2001-Jan-15 17:56:33 (UTC)
User:simons
Branch:
Comment: Added code that will send the "request for confirmation" mail out when apropriate.
Tickets:
Inspections:
Files:
ossp-pkg/petidomo/subscribe.c      1.10 -> 1.11     38 inserted, 1 deleted
ossp-pkg/petidomo/unsubscribe.c      1.10 -> 1.11     39 inserted, 1 deleted

ossp-pkg/petidomo/subscribe.c 1.10 -> 1.11

--- subscribe.c  2001/01/15 16:55:45     1.10
+++ subscribe.c  2001/01/15 17:56:33     1.11
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/subscribe.c,v $
-   $Revision: 1.10 $
+   $Revision: 1.11 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -174,6 +174,43 @@
                 }
             return 0;
             }
+
+        else if (ListConfig->subtype == SUBSCRIPTION_ACKED && !g_is_approved)
+            {
+            /* Require confirmation. */
+
+            char* command = text_easy_sprintf("unsubscribe %s %s", address, listname);
+            char* cookie  = queue_command(MailStruct, command);
+
+            /* Notify the owner. */
+
+            fh = vOpenMailer(envelope, address, NULL);
+            if (fh != NULL)
+                {
+                fprintf(fh, "From: petidomo-approve@%s (Petidomo Mailing List Server)\n", ListConfig->fqdn);
+                fprintf(fh, "To: %s\n", address);
+                fprintf(fh, "Subject: Petidomo: CONFIRM %s@%s: Request from \"%s\"\n", listname, ListConfig->fqdn, originator);
+                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);
+                text_wordwrap(buffer, 70);
+                fprintf(fh, "%s\n", buffer);
+                fprintf(fh, "\n    %s\n\n", cookie);
+                fprintf(fh, "in your reply.\n");
+                CloseMailer(fh);
+                }
+            else
+                {
+                syslog(LOG_ERR, "Failed to send email to \"%s\"!", owner);
+                return -1;
+                }
+
+            return 0;
+            }
         }
 
     /* Check whether the address is subscribed already. */


ossp-pkg/petidomo/unsubscribe.c 1.10 -> 1.11

--- unsubscribe.c        2001/01/15 16:55:45     1.10
+++ unsubscribe.c        2001/01/15 17:56:33     1.11
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/unsubscribe.c,v $
-   $Revision: 1.10 $
+   $Revision: 1.11 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -176,6 +176,44 @@
                 }
             return 0;
             }
+
+        else if (ListConfig->subtype == SUBSCRIPTION_ACKED && !g_is_approved)
+            {
+            /* Require confirmation. */
+
+            char* command = text_easy_sprintf("unsubscribe %s %s", address, listname);
+            char* cookie  = queue_command(MailStruct, command);
+
+            /* Notify the owner. */
+
+            fh = vOpenMailer(envelope, address, NULL);
+            if (fh != NULL)
+                {
+                fprintf(fh, "From: petidomo-approve@%s (Petidomo Mailing List Server)\n", ListConfig->fqdn);
+                fprintf(fh, "To: %s\n", address);
+                fprintf(fh, "Subject: Petidomo: CONFIRM %s@%s: Request from \"%s\"\n", listname, ListConfig->fqdn, originator);
+                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 unsubscribed from " \
+                                           "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);
+                }
+            else
+                {
+                syslog(LOG_ERR, "Failed to send email to \"%s\"!", owner);
+                return -1;
+                }
+
+            return 0;
+            }
+
         }
 
     /* Okay, remove the address from the list. */

CVSTrac 2.0.1