"Jan Stanik" <[EMAIL PROTECTED]> writes:
| I need to log rcpthosts failures:
| 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
| Is there any patch to qmail-smtpd?
--- qmail-smtpd.c 1998/06/25 03:48:14 1.1
+++ qmail-smtpd.c 1998/06/25 03:54:58
@@ -42,16 +42,28 @@
void flush() { substdio_flush(&ssout); }
void out(s) char *s; { substdio_puts(&ssout,s); }
+void eout(s) char *s;
+{
+ char buf[FMT_ULONG];
+
+ write(2, "smtpd: pid ", 11);
+ buf[fmt_ulong(buf,(unsigned long) getpid())] = 0;
+ write(2, buf, str_len(buf));
+ write(2, " ", 1);
+ write(2, s, str_len(s));
+ out(s);
+}
+
void die_read() { _exit(1); }
-void die_alarm() { out("451 timeout (#4.4.2)\r\n"); flush(); _exit(1); }
-void die_nomem() { out("421 out of memory (#4.3.0)\r\n"); flush(); _exit(1); }
-void die_control() { out("421 unable to read controls (#4.3.0)\r\n"); flush();
_exit(1); }
-void die_ipme() { out("421 unable to figure out my IP addresses (#4.3.0)\r\n");
flush(); _exit(1); }
-void straynewline() { out("451 See http://pobox.com/~djb/docs/smtplf.html.\r\n");
flush(); _exit(1); }
-
-void err_bmf() { out("553 sorry, your envelope sender is in my badmailfrom list
(#5.7.1)\r\n"); }
-void err_nogateway() { out("553 sorry, that domain isn't in my list of allowed
rcpthosts (#5.7.1)\r\n"); }
-void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); }
+void die_alarm() { eout("451 timeout (#4.4.2)\r\n"); flush(); _exit(1); }
+void die_nomem() { eout("421 out of memory (#4.3.0)\r\n"); flush(); _exit(1); }
+void die_control() { eout("421 unable to read controls (#4.3.0)\r\n"); flush();
+_exit(1); }
+void die_ipme() { eout("421 unable to figure out my IP addresses (#4.3.0)\r\n");
+flush(); _exit(1); }
+void straynewline() { eout("451 See http://pobox.com/~djb/docs/smtplf.html.\r\n");
+flush(); _exit(1); }
+
+void err_bmf() { eout("553 sorry, your envelope sender is in my badmailfrom list
+(#5.7.1)\r\n"); }
+void err_nogateway() { eout("553 sorry, that domain isn't in my list of allowed
+rcpthosts (#5.7.1)\r\n"); }
+void err_unimpl() { eout("502 unimplemented (#5.5.1)\r\n"); }
void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); }
void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); }
void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); }
@@ -387,8 +399,8 @@
qqx = qmail_close(&qqt);
if (!*qqx) { acceptmessage(qp); return; }
- if (hops) { out("554 too many hops, this message is looping (#5.4.6)\r\n"); return;
}
- if (databytes) if (!bytestooverflow) { out("552 sorry, that message size exceeds my
databytes limit (#5.3.4)\r\n"); return; }
+ if (hops) { eout("554 too many hops, this message is looping (#5.4.6)\r\n");
+return; }
+ if (databytes) if (!bytestooverflow) { eout("552 sorry, that message size exceeds
+my databytes limit (#5.3.4)\r\n"); return; }
if (*qqx == 'D') out("554 "); else out("451 ");
out(qqx + 1);
out("\r\n");