Mercurial > hg > mlmmj
changeset 459:42501eca3d2a
Alternate listaddresses
author | mmj |
---|---|
date | Wed, 09 Feb 2005 05:21:48 +1100 |
parents | 7c3190e7cff9 |
children | 5b85456d3ce1 |
files | ChangeLog src/mlmmj-process.c |
diffstat | 2 files changed, 26 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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");