From 9c26652d660cd4cc91be1e24f94a9aaf708bb99b Mon Sep 17 00:00:00 2001 From: John Denker Date: Sun, 3 Jun 2012 16:16:05 -0700 Subject: Blank line in control/doublebounce ==> discard double bounces. If you don't want doublebounces to hit your queue a second time (because you have, say, ten million mailboxes and as much legitimate email traffic and more spam), the following patch will immediately discard bouncing bounces. Note that doublebounceto must start with a blank line; that is, it must have one newline in it. A totally empty file means "use the default of 'posthamster'". Credit: Nasim Mansurov; rewritten by Charles Cazabon --- qmail-send.9 | 4 ++++ qmail-send.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/qmail-send.9 b/qmail-send.9 index acb04d0..ff2db12 100644 --- a/qmail-send.9 +++ b/qmail-send.9 @@ -115,6 +115,10 @@ notice to (If that bounces, .B qmail-send gives up.) +As a special case, if the first line of +.IR doublebounceto +is blank (contains a single linefeed), qmail-send will not queue +the double-bounce at all. .TP 5 .I envnoathost Presumed domain name for addresses without @ signs. diff --git a/qmail-send.c b/qmail-send.c index c31b522..0ea44a1 100644 --- a/qmail-send.c +++ b/qmail-send.c @@ -683,6 +683,8 @@ unsigned long id; } if (str_equal(sender.s,"#@[]")) log3("triple bounce: discarding ",fn2.s,"\n"); + else if (!*sender.s && *doublebounceto.s == '@') + log3("double bounce: discarding ",fn2.s,"\n"); else { if (qmail_open(&qqt) == -1) -- cgit v1.2.3