# HG changeset patch # User mmj # Date 1107886908 -39600 # Node ID 42501eca3d2ae94542a0fa515edc4c0424a7a710 # Parent 7c3190e7cff92c89bb668a18be312f6ae8199b87 Alternate listaddresses diff -r 7c3190e7cff9 -r 42501eca3d2a ChangeLog --- a/ChangeLog Wed Feb 09 05:13:14 2005 +1100 +++ b/ChangeLog Wed Feb 09 05:21:48 2005 +1100 @@ -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 diff -r 7c3190e7cff9 -r 42501eca3d2a src/mlmmj-process.c --- a/src/mlmmj-process.c Wed Feb 09 05:13:14 2005 +1100 +++ b/src/mlmmj-process.c Wed Feb 09 05:21:48 2005 +1100 @@ -50,6 +50,7 @@ #include "subscriberfuncs.h" #include "memory.h" #include "log_oper.h" +#include "chomp.h" enum action { ALLOW, @@ -309,7 +310,7 @@ 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 @@ 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,16 +603,30 @@ 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) + 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");