[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

smtp transport seemingly eating bounceback failures



I installed the latest Zmailer with what I think of as a pretty simply
config. Its intended for supplementing a busy exchange server for large bulk
emails to company mailing lists. Zmailer itself would never receive any
emails (and wasn't listed as an MX for the domain) just being mostly
outbound only.

While doing tests, I determined that it appears that the 'smtp' transport is
reporting Status of 'OK' (listed in maillog as 'ok3')  even when a badly
named email is sent to yahoo. (Example: asdljasdhsah@yahoo.com)
<mailto:asdljasdhsah@yahoo.com)> . No bounceback message came back to the
sending user (I tried many... root, normal users, etc..), never informing
them of the failure to reach a valid user. I know it should have, because a
logging of the SMTP session shows that it returned a 554 Error 'This user
doesn't have a yahoo.com account' after reading the Email DATA.

I turned on debugging and even added my own extra logging lines to smtp.c to
catch what it was doing with the rcptstates and rc value. I finally
determined it had some apparently faulty (?) logic that if it had earlier
gotten a DATASTATE_OK (this session apparently did) and also a DATASTATE_500
then it would set the return code to 0 (OK). I changed the logic and I think
I'm getting the behavior I want (although the return code is slightly
different then it would have for an invalid user). I'm hoping the
programmers of zmailer have an idea of what happened and how it should have
behaved.

Here is the relevant smtp log showing what happens with the apparently
faulty logic (?):

30901o0000034800#	jobspec: Y/F/26993-30747	yahoo.com
30901o0000134800#	26993-30747:
<20010312220630Z26993-30747+3@ri-intranet2.rotaryintl.org>
30901o0000234800#	smtpopen: connecting to yahoo.com
30901o0000334800#	smtpconn: host = yahoo.com
30901o0000434802#	(Connecting to `mta-v13.mail.yahoo.com'
[216.136.129.18|25] Mon Mar 12 16:06:42 2001)
30901o0000534802#	select_sleep(6,300); rc=0
30901o0000634802#	(pipebufsize=53, s=0, eol=53)
30901o0000734802r	220 YSmtp mta431.mail.yahoo.com ESMTP service ready
incoming code: 220 result code=0 result status: 2.0.0
 smtp_sync() did yield code 0 (rcptstates = 0x2)
30901o0000834802#	smtpconn: retval = 0
30901o0000934802w	EHLO ri-intranet2
30901o0001034802#	select_sleep(6,300); rc=0
30901o0001134802#	(pipebufsize=75, s=0, eol=27)
30901o0001234802r	250-mta431.mail.yahoo.com
30901o0001334802#	(pipebufsize=75, s=27, eol=41)
30901o0001434802r	250-8BITMIME
30901o0001534802#	(pipebufsize=75, s=41, eol=59)
30901o0001634802r	250-SIZE 3145728
30901o0001734802#	(pipebufsize=75, s=59, eol=75)
30901o0001834802r	250 PIPELINING
incoming code: 250 result code=0 result status: 2.0.0
 smtp_sync() did yield code 0 (rcptstates = 0x0)
30901o0001934802#	smtpopen: status = 0
30901o0002034802w	MAIL From:<root@ri-intranet2.rotaryintl.org>
BODY=8BITMIME SIZE=326
30901o0002134802w	RCPT To:<asdlkjadasjhdsa@yahoo.com>
30901o0002234802w	DATA
30901o0002334802#	select_sleep(6,300); rc=0
30901o0002434802#	(pipebufsize=96, s=0, eol=50)
30901o0002534802r	250 sender <root@ri-intranet2.rotaryintl.org> ok
incoming code: 250 result code=0 result status: 2.0.0
30901o0002634802#	(pipebufsize=46, s=0, eol=46)
30901o0002734802r	250 recipient <asdlkjadasjhdsa@yahoo.com> ok
incoming code: 250 result code=0 result status: 2.0.0
30901o0002834802#	(pipebufsize=14, s=0, eol=14)
30901o0002934802r	354 go ahead
incoming code: 354 result code=0 result status: 2.0.0
 smtp_sync() did yield code 0 (rcptstates = 0x7)
30901o0003034802w	.
30901o0003134802#	select_sleep(6,1200); rc=0
30901o0003234802#	(pipebufsize=119, s=0, eol=119)
30901o0003334802r	554 delivery error: dd This user doesn't have a
yahoo.com account (asdlkjadasjhdsa@yahoo.com) - mta431.mail.yahoo.com
incoming code: 554 result code=67 result status: 5.1.1 (No acceptable
recipients given)
 smtp_sync() area 1 yield code 67 (rcptstates = 0x7)
 smtp_sync() area 3 yield code 67 (rcptstates = 0x407)
smtp_sync() did yield code 0 (rcptstates = 0x407)
30901o0003434802#	322 bytes, 322 in header, 1 recipients, 0 secs for
envelope, 0 secs for body xfer
30901o0003534802#	jobspec: #idle
30901o0003634983w	NOOP
30901o0003734983#	select_sleep(6,300); rc=0
30901o0003834983#	(pipebufsize=8, s=0, eol=8)
30901o0003934983r	250 OK
incoming code: 250 result code=0 result status: 2.0.0
 smtp_sync() did yield code 0 (rcptstates = 0x2)
30901o0004035050#	jobspec: 
30901o0004135050w	QUIT
30901o0004235050#	(closed SMTP channel - final close) 

I modified the following logic in smtp.c:

From:
	if (rc == EX_OK) {
	  /* Study the DATA STATES! */
	  if (SS->rcptstates & DATASTATE_OK)
	    rc = EX_OK; /* Some ok! */
	  else if (SS->rcptstates & DATASTATE_400)
	    rc = EX_TEMPFAIL; /* Some TEMPFAIL */
	  else if (SS->rcptstates & DATASTATE_500)
	    rc = EX_UNAVAILABLE; /* All hard failures */
	}
To:
	if (rc == EX_OK) {
	  /* Study the DATA STATES! */
	  if (SS->rcptstates & DATASTATE_OK)
	    rc = EX_OK; /* Some ok! */
	  /* else */ 
               if (SS->rcptstates & DATASTATE_400)
	    rc = EX_TEMPFAIL; /* Some TEMPFAIL */
	  else if (SS->rcptstates & DATASTATE_500)
	    rc = EX_UNAVAILABLE; /* All hard failures */
	}

Is what I did 'correct'? I'm hoping there is a better 'standard' way to
handle this situation... Perhaps DATASTATE_OK never should have been
triggered?

-Crispin Bivans
bivansc@rotaryintl.org <mailto:bivansc@rotaryintl.org>