Subject: MTA no HELO -> smap dies

From: [email-masked]
Date: Thu, 1 Mar 2001 15:52:01 -0500 (EST)

[To be removed from this list send the message "unsubscribe fwtk-users" in the
BODY of a mail message to [email-masked].]

I found the following bug in smap -

given the exchange:

MTA connects to server
smap  220 mta.bar.foo SMTP/smap Ready.
MTA   NOOP
smap  220 OK
MTA   MAIL FROM:<[email-masked]>
smap  250 <[email-masked]>... Sender Ok
MTA   RCPT TO:<[email-masked]>
smap  250 <[email-masked]> OK
MTA   DATA
smap  354 Enter mail, and end with "." on a line by
itself
smap dies.

I have confirmed that sendmail and smap in Gauntlet will
accept a NOOP and continue to successfully accept mail.

The bug is the passing of a null string pointer (rhost)
to fprintf at -

fprintf(vout,"Received: from %s(%s %s) by %s via smap
(%s)\n\tid %s; %s\n",
	rhost,	
	strcasecmp(rhost,rladdr) ? rladdr : "" ,
	riaddr,myhostname,
	FWTK_VERSION_MINOR,tempfile,
	arpadate((char *)0));
	
My fix was to add the line -

        printf("220 %s SMTP/smap
Ready.\r\n",myhostname);
        fflush(stdout);
+       rhost = "lameMailer" ;

- Brion