On Thu, Oct 28, 1999 at 09:07:30PM -0700, Michael Boyiazis wrote:
> I've tried running snoop to see if I could see anything odd with the smtp
> packets, but I really don't know what to look for that is out of the
> ordinary
> so I can tell these folks what to fix. Any suggestions as to what might
> look odd? and what to tell them to fix their mail server?
What I did was to patch qmail-smtpd.c to report stray newlines:
There is a function called straynewline().
To that function I've added:
logerr("protoerror: "); logerrpid(); logerrf("error: stray newlines\n");
(before the _exit(1); :-)
To make it work you also need the following code snippet:
char strnum[FMT_ULONG];
char sserrbuf[512];
substdio sserr = SUBSTDIO_FDBUF(write,2,sserrbuf,sizeof(sserrbuf));
void logerr(s) char *s; { if(substdio_puts(&sserr,s) == -1) _exit(1); }
void logerrf(s) char *s; { if(substdio_puts(&sserr,s) == -1) _exit(1);
if(substdio_flush(&sserr) == -1) _exit(1); }
void logerrpid() { strnum[fmt_ulong(strnum,getpid())] = 0; logerr("pid "); loger
r(strnum); logerr(": ");}
(this is only tested with qmail-1.01 but should also work finde with 1.03)
I have also added logging to the other error functions like
err_unimpl(), err_wantmail(), err_wantrcpt()
via code like
logerr("proterror: "); logerrpid(); logerrf("unimplemented\n");
logerr("proterror: "); logerrpid(); logerrf("MAIL first\n");
logerr("proterror: "); logerrpid(); logerrf("RCPT first\n");
As I log the tcpserver messages to the same logfile you can easily
identify the hosts producing this errors through the pid.
\Maex
--
SpaceNet GmbH | http://www.Space.Net/ | Yeah, yo mama dresses
Research & Development | mailto:[EMAIL PROTECTED] | you funny and you need
Joseph-Dollinger-Bogen 14 | Tel: +49 (89) 32356-0 | a mouse to delete files
D-80807 Muenchen | Fax: +49 (89) 32356-299 |