Commit c55722ba authored by Timo Boettecher's avatar Timo Boettecher Committed by Geert Stappers

Make handling of bounces configurable

By default, mlmmj drops any incoming email with empty envelope-from
address (bounce message) with the error message "Discarding $mail due
to missing envelope from address".

Reported as http://mlmmj.org/bugs/bug.php?id=50 in november 2013.
(Yes, more than five years ago.)
Committed-By: Geert Stappers's avatarGeert Stappers <[email protected]>
parent b7b671de
......@@ -40,6 +40,10 @@ entire content is used as value, it's marked "text".
If this file is present, the list address does not have to be in the To:
or Cc: header of the email to the list.
· acceptbounces (boolean)
If this file is present, bounces are accepted as list posts.
· subonlypost (boolean)
When this file is present, only people who are subscribed to the list,
......
......@@ -455,6 +455,7 @@ int main(int argc, char **argv)
enum modreason modreason;
int hdrfd, footfd, rawmailfd, donemailfd, omitfd;
int addrtocc, intocc = 0, findaddress = 0;
int discardbounces = 0;
int maxmailsize = 0;
int notmetoo = 0;
int subonlypost = 0, modonlypost = 0, modnonsubposts = 0, foundaddr = 0;
......@@ -880,21 +881,24 @@ int main(int argc, char **argv)
myfree(delheaders);
if(strcmp(efrom, "") == 0) { /* don't send mails with <> in From
to the list */
discardname = concatstr(3, listdir,
"/queue/discarded/",
randomstr);
errno = 0;
log_error(LOG_ARGS, "Discarding %s due to missing envelope"
" from address", mailfile);
rename(mailfile, discardname);
unlink(donemailname);
myfree(donemailname);
myfree(discardname);
myfree(randomstr);
/* TODO: free emailstructs */
exit(EXIT_SUCCESS);
discardbounces = !(statctrl(listdir, "acceptbounces"));
if(discardbounces) {
if(strcmp(efrom, "") == 0) { /* don't send mails with <> in From
to the list */
discardname = concatstr(3, listdir,
"/queue/discarded/",
randomstr);
errno = 0;
log_error(LOG_ARGS, "Discarding %s due to missing envelope"
" from address", mailfile);
rename(mailfile, discardname);
unlink(donemailname);
myfree(donemailname);
myfree(discardname);
myfree(randomstr);
/* TODO: free emailstructs */
exit(EXIT_SUCCESS);
}
}
unlink(mailfile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment