summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-06-03 16:16:05 -0700
committerJohn Denker <jsd@av8n.com>2012-07-13 18:39:07 -0700
commit9c26652d660cd4cc91be1e24f94a9aaf708bb99b (patch)
tree56905ff77e0ca9c589919ed8ce140c9340847756
parentc29249ffc37f23433fd99df19029adfdb1bfb4ea (diff)
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
-rw-r--r--qmail-send.94
-rw-r--r--qmail-send.c2
2 files changed, 6 insertions, 0 deletions
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)