[comp.mail.mush] my_hdr question

fletcher@cs.utexas.edu (Fletcher Mattox) (08/14/90)

If I want my own From: header with, say, 

	my_hdr From: Fletcher Mattox <fletcher@cs.utexas.edu>

then mush 7.1.2 puts no From: in my $record.  Though it happily
sends the custom From:, as expected, to the MTA.  Why is that?

The code in add_headers() seems to intentionally wipe out the
buffer after writing to the MTA with ...

	if (own_from)
	    (void) fputs(own_from, files[i]), *own_from = 0;
	else
	    (void) fputs(From_buf, files[i]);

schaefer@ogicse.ogi.edu (Barton E. Schaefer) (08/14/90)

In article <11154@cs.utexas.edu> fletcher@cs.utexas.edu (Fletcher Mattox) writes:
} If I want my own From: header [with my_hdr]
} then mush 7.1.2 puts no From: in my $record.  Though it happily
} sends the custom From:, as expected, to the MTA.  Why is that?

Well, because it's a bug, obviously. :-}  It works fine if you use the
edit_hdrs facility ... or if you have a PICKY_MAILER ....

} The code in add_headers() seems to intentionally wipe out the
} buffer after writing to the MTA with ...
} 
} 	if (own_from)
} 	    (void) fputs(own_from, files[i]), *own_from = 0;
} 	else
} 	    (void) fputs(From_buf, files[i]);

See the WARNING comment higher up; own_from makes temporary use of
the buf[] array to store the string, and buf[0] == 0 is tested later
on for an edit_hdrs-specific purpose.  The clobbering of buf[0] via
*own_from is happening a little too eagerly; it should happen after the
for (i = ...) loop, not inside it.
-- 
Bart Schaefer						schaefer@cse.ogi.edu