-
Notifications
You must be signed in to change notification settings - Fork 1
/
doublebounce-trim.patch
44 lines (39 loc) · 1.6 KB
/
doublebounce-trim.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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'".
This version was rewritten by Charles Cazabon from my original patch
to include a man page, turn the patch around in the right direction,
and emit its own message for the logfile.
Apply this patch as so:
cd /usr/local/src/qmail-1.03
patch <doublebounce-trim.patch
diff -urN qmail-1.03.orig/qmail-send.9 qmail-1.03.nodoublebounce/qmail-send.9
--- qmail-1.03.orig/qmail-send.9 Mon Jun 15 04:53:16 1998
+++ qmail-1.03.nodoublebounce/qmail-send.9 Tue Sep 9 12:59:04 2003
@@ -115,6 +115,10 @@
(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 -urN qmail-1.03.orig/qmail-send.c qmail-1.03.nodoublebounce/qmail-send.c
--- qmail-1.03.orig/qmail-send.c Mon Jun 15 04:53:16 1998
+++ qmail-1.03.nodoublebounce/qmail-send.c Tue Sep 9 13:02:43 2003
@@ -683,6 +683,8 @@
}
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)
--9jxsPFA5p3P2qPhR--