-
Notifications
You must be signed in to change notification settings - Fork 1
/
qmail-smtpd-log-badmailfrom.patch
47 lines (43 loc) · 1.7 KB
/
qmail-smtpd-log-badmailfrom.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
45
46
47
On Sun, Jun 17, 2001 at 03:53:35PM +0200, Johan Almqvist wrote:
> I wonder if anyone has made a patch to log badmailfrom "hits" from
> qmail-smtpd?
This should work:
--- Makefile.orig Sun Jun 17 10:25:23 2001
+++ Makefile Sun Jun 17 10:23:24 2001
@@ -1535,13 +1535,13 @@
load qmail-smtpd.o rcpthosts.o commands.o timeoutread.o \
timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o received.o \
date822fmt.o now.o qmail.o cdb.a fd.a wait.a datetime.a getln.a \
-open.a sig.a case.a env.a stralloc.a alloc.a substdio.a error.a str.a \
+open.a sig.a case.a env.a stralloc.a alloc.a strerr.a substdio.a error.a str.a \
fs.a auto_qmail.o socket.lib
./load qmail-smtpd rcpthosts.o commands.o timeoutread.o \
timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o \
received.o date822fmt.o now.o qmail.o cdb.a fd.a wait.a \
datetime.a getln.a open.a sig.a case.a env.a stralloc.a \
- alloc.a substdio.a error.a str.a fs.a auto_qmail.o `cat \
+ alloc.a strerr.a substdio.a error.a str.a fs.a auto_qmail.o `cat \
socket.lib`
qmail-smtpd.0: \
--- qmail-smtpd.c.orig Sun Jun 17 10:25:36 2001
+++ qmail-smtpd.c Sun Jun 17 10:28:47 2001
@@ -23,6 +23,7 @@
#include "timeoutread.h"
#include "timeoutwrite.h"
#include "commands.h"
+#include "strerr.h"
#define MAXHOPS 100
unsigned int databytes = 0;
@@ -250,7 +251,11 @@
void smtp_rcpt(arg) char *arg; {
if (!seenmail) { err_wantmail(); return; }
if (!addrparse(arg)) { err_syntax(); return; }
- if (flagbarf) { err_bmf(); return; }
+ if (flagbarf) {
+ strerr_warn4("qmail-smtpd: badmailfrom: ",mailfrom.s," at ",remoteip,0);
+ err_bmf();
+ return;
+ }
if (relayclient) {
--addr.len;
if (!stralloc_cats(&addr,relayclient)) die_nomem();