# HG changeset patch # User mmj # Date 1114682651 -36000 # Node ID 2855bbfb74fe3557186a62bff609175eedfaf660 # Parent ec080ab4e9e7cf389ec84c22990107c5e8aa02d6 Allow bounces with no From: diff -r ec080ab4e9e7 -r 2855bbfb74fe ChangeLog --- a/ChangeLog Thu Apr 28 17:52:06 2005 +1000 +++ b/ChangeLog Thu Apr 28 20:04:11 2005 +1000 @@ -1,3 +1,8 @@ + o Bouncing confirmation mails of sub or unsub should be cleaned from + the queue as well + o Normally mails which doesn't have exactly one From: emailaddress are + discarded but certain ISPs have bounce mails with no From: header, forcing + us to allow bounce mails with no From: to make sure they're caught o In case of a succesful DSN parse, we werent deleting the mail, and thus littering the queue o When sending moderated mails, rename them so that they wont be moderated diff -r ec080ab4e9e7 -r 2855bbfb74fe src/listcontrol.c --- a/src/listcontrol.c Thu Apr 28 17:52:06 2005 +1000 +++ b/src/listcontrol.c Thu Apr 28 20:04:11 2005 +1000 @@ -166,6 +166,14 @@ } } + /* Only allow mails with bad From: header to be bounce mails */ + if(fromemails->emailcount != 1 && ctrl != CTRL_BOUNCES) { + log_error(LOG_ARGS, "Discarding mail with invalid From: " + "which was not a bounce"); + unlink(mailname); + exit(EXIT_SUCCESS); + } + switch (ctrl) { /* listname+subscribe-digest@domain.tld */ diff -r ec080ab4e9e7 -r 2855bbfb74fe src/mlmmj-process.c --- a/src/mlmmj-process.c Thu Apr 28 17:52:06 2005 +1000 +++ b/src/mlmmj-process.c Thu Apr 28 20:04:11 2005 +1000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004 Mads Martin Joergensen +/* Copyright (C) 2003, 2003, 2004 Mads Martin Joergensen * * $Id$ * @@ -473,18 +473,6 @@ for(i = 0; i < readhdrs[0].valuecount; i++) { find_email_adr(readhdrs[0].values[i], &fromemails); } - if(fromemails.emailcount != 1) { /* discard malformed mail */ - discardname = concatstr(3, listdir, - "/queue/discarded/", - randomstr); - rename(mailfile, discardname); - unlink(donemailname); - myfree(donemailname); - myfree(discardname); - myfree(randomstr); - /* TODO: free emailstructs */ - exit(EXIT_SUCCESS); - } } if(readhdrs[1].token) { /* To: addresses */ @@ -584,6 +572,19 @@ return EXIT_SUCCESS; } + /* discard malformed mail with invalid From: */ + if(fromemails.emailcount != 1) { + discardname = concatstr(3, listdir, + "/queue/discarded/", randomstr); + rename(mailfile, discardname); + unlink(donemailname); + myfree(donemailname); + myfree(discardname); + myfree(randomstr); + /* TODO: free emailstructs */ + exit(EXIT_SUCCESS); + } + myfree(delheaders); if(efromemails.emailcount != 1) { /* don't send mails with <> in From