[comp.sources.bugs] minor bug in smail2.5

jv@mhres.mh.nl (Johan Vromans) (08/01/88)

Description:
	smail2.5 sometimes bounces a mail with a delivery failure, although
	everything went OK.
	This is caused by both 'resolve' and 'deliver' setting and using
	the global variable 'exitstat' to denote failures. If an address
	resolution fails, 'exitstat' is set to the error code by 'resolve'.
	When 'deliver' starts delivering the mail, it finally concludes
	that the delivery failed because 'exitstat' has a non-zero value.
	The mail is bounced, and 'exitstat' is cleared.

Repeat-By:
	(Assuming 'localuser' is a valid user, and 'yy' is a unknown host).

		smail -p /dev/null xx@yy localuser

	The mail will be delivered to localuser AND a bounce occurs which
	says that the delivery to localuser failed.

Solution:
	clear 'exitstat' between the parse- and delivery phases. I added a
	line

		exitstat = 0;

	somewhere in the beginning of "deliver.c", about line 102, just after

		char *send = scommand;

	Other places where 'exitstat' could be cleared are at the beginning
	of 'deliver' or in "main.c" just before the call to 'deliver'.

Regards:
	Johan Vromans	<jv@mh.nl>
-- 
	Johan