]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Alternate listaddresses
authormmj <none@none>
Tue, 8 Feb 2005 18:21:48 +0000 (05:21 +1100)
committermmj <none@none>
Tue, 8 Feb 2005 18:21:48 +0000 (05:21 +1100)
ChangeLog
src/mlmmj-process.c

index 3ab7ce2ac5521343df2c6fb3340c5096d865c911..1b085772ae984ac0df3b184abec2d13864b0da55 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+ o Make it possible to specify more than one listaddress in
+   LISTDIR/control/listaddress. The first is the "real" one.
+ o Make the port to connect to controlable with LISTDIR/control/smtpport
 1.2.3
  o Only allow subscription of addresses with '@' in them
  o Fix return value from unsubscribe function
index ea403b8af81a82d424718e5e0756ced9ad5f6da6..6fa0379350486def29e9af6897dd07ab543ee714 100644 (file)
@@ -50,6 +50,7 @@
 #include "subscriberfuncs.h"
 #include "memory.h"
 #include "log_oper.h"
+#include "chomp.h"
 
 enum action {
        ALLOW,
@@ -309,7 +310,7 @@ static void print_help(const char *prg)
 
 int main(int argc, char **argv)
 {
-       int i, opt, noprocess = 0, moderated = 0;
+       int i, j, opt, noprocess = 0, moderated = 0;
        int hdrfd, footfd, rawmailfd, donemailfd;
        int subonlypost = 0, addrtocc = 1, intocc = 0;
        int notoccdenymails = 0, noaccessdenymails = 0, nosubonlydenymails = 0;
@@ -332,6 +333,7 @@ int main(int argc, char **argv)
        struct strlist *access_rules = NULL;
        struct strlist *delheaders = NULL;
        struct strlist allheaders;
+       struct strlist *alternates = NULL;
        struct mailhdr readhdrs[] = {
                { "From:", 0, NULL },
                { "To:", 0, NULL },
@@ -601,17 +603,31 @@ int main(int argc, char **argv)
        unlink(mailfile);
 
        listaddr = getlistaddr(listdir);
+       alternates = ctrlvalues(listdir, "listaddress");
 
        addrtocc = !(statctrl(listdir, "tocc"));
        if(addrtocc) {
-               for(i = 0; i < toemails.emailcount; i++)
-                       if(strcmp(listaddr, toemails.emaillist[i]) == 0)
-                               intocc = 1;
-               for(i = 0; i < ccemails.emailcount; i++)
-                       if(strcmp(listaddr, ccemails.emaillist[i]) == 0)
-                               intocc = 1;
+               for(i = 0; i < toemails.emailcount; i++) {
+                       for(j = 0; j < alternates->count; j++) {
+                               chomp(alternates->strs[j]);
+                               if(strcmp(alternates->strs[j],
+                                       toemails.emaillist[i]) == 0)
+                                       intocc = 1;
+                       }
+               }
+               for(i = 0; i < ccemails.emailcount; i++) {
+                       for(j = 0; j < alternates->count; j++) {
+                               chomp(alternates->strs[j]);
+                               if(strcmp(alternates->strs[j],
+                                       ccemails.emaillist[i]) == 0)
+                                       intocc = 1;
+                       }
+               }
        }
 
+       for(i = 0; i < alternates->count; i++)
+               myfree(alternates->strs[i]);
+
        notoccdenymails = statctrl(listdir, "notoccdenymails");
        
        if(addrtocc && !intocc) {