From: mmj Date: Tue, 8 Feb 2005 18:21:48 +0000 (+1100) Subject: Alternate listaddresses X-Git-Tag: RELEASE_1_2_12_RC1~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca3a7132b38e9803eb6136adf261b51095eff766;p=thirdparty%2Fmlmmj.git Alternate listaddresses --- diff --git a/ChangeLog b/ChangeLog index 3ab7ce2a..1b085772 100644 --- 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 diff --git a/src/mlmmj-process.c b/src/mlmmj-process.c index ea403b8a..6fa03793 100644 --- a/src/mlmmj-process.c +++ b/src/mlmmj-process.c @@ -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) {