ensure that regcomp() errors get logged by having regerror() syslog them, and by having smtpd capture send's stderr and logging it even if send's exit status is good. i also changed "smtpd" to "smtpd.db" for the log file for -d output; feel free to keep or discard that change. Reference: /n/sources/patch/applied/smtpd-log-recomp-errs Date: Wed Nov 16 03:31:40 CET 2005 --- /sys/src/cmd/upas/smtp/smtpd.c Wed Nov 16 03:31:13 2005 +++ /sys/src/cmd/upas/smtp/smtpd.c Wed Nov 16 03:31:07 2005 @@ -157,7 +157,7 @@ if(debug){ close(2); - snprint(buf, sizeof(buf), "%s/smtpd", UPASLOG); + snprint(buf, sizeof(buf), "%s/smtpd.db", UPASLOG); if (open(buf, OWRITE) >= 0) { seek(2, 0, 2); fprint(2, "%d smtpd %s\n", getpid(), thedate()); @@ -1221,6 +1221,16 @@ } reply("%d mail process terminated abnormally\r\n", code); } else { + /* + * if a message appeared on stderr, despite good status, + * log it. this can happen if rewrite.in contains a bad + * r.e., for example. + */ + if(*s_to_c(err)) + syslog(0, "smtpd", + "%s returned good status, but said: %s", + s_to_c(mailer), s_to_c(err)); + if(filterstate == BLOCKED) reply("554 we believe this is spam. we don't accept it.\r\n"); else --- /sys/src/cmd/upas/send/rewrite.c Wed Nov 16 03:31:24 2005 +++ /sys/src/cmd/upas/send/rewrite.c Wed Nov 16 03:31:22 2005 @@ -282,6 +282,8 @@ regerror(char* s) { fprint(2, "rewrite: %s\n", s); + /* make sure the message is seen locally */ + syslog(0, "mail", "error in rewrite: %s", s); } extern void