[net.news.b] recmail problems

msc@qubix.UUCP (06/09/83)

	I have 2 problems with recmail.

	1.	It doesn't remove the temporary file it creates in /tmp.

	2.	It produces funny exit codes such as 214, 216, & 35.

	A fix for the first problem is to put the statement

		unlink( tmpf );

	as the last line of main() in recmail.c.

	I haven't yet been able to track down the second problem.  I
	noticed it because the reply script sent out with vnews checks
	this return code and if it's != 0 it mails a message back to the
	originator of the reply telling him/her there's been an error.

				Mark

john@genrad.UUCP (John Nelson) (06/09/83)

I also noticed this problem with recmail under 4.1BSD (funny exit values) and it
appears to be because a normal termination does not return a value
from main, or call exit with an argument of zero, but rather falls
off the end (apparently leaving garbage in the register normally
used for the return value)  Maybe this is a problem exclusively with the
4.1BSD compiler.  Anyway, the solution is to put an explicit exit(0)
before the last closing bracket

sch@linus.UUCP (Stephen C. Hemminger) (06/10/83)

You better off to check the exit codes from the spawned mails,
something like:
		if(exstat != 0)
			mailerrs++;
followed by at the end of main:
	exit (mailerrs ? 1 : 0);

This will allow the reply shell script to check exit code appropriately.

chris@grkermit.UUCP (Chris T. Hibbert) (06/10/83)

I noticed the problem with recmail returning garbage values (or at
least a number of different, undocumented, and from the looks of the
code, unintentional values) as well.  My solution to the problem was to
comment out the section of the reply script that sends mail to the user
when a non-zero value is returned.  

Since recmail isn't trying to return a value to indicate problems, the
tests in reply aren't of any value.  Possibly, an exit(0) should be
inserted into recmail for the sake of style, but I see no reason to
leave the "error-check" in the reply script.