I'm not certain how much the sendmail differs from postfix but when I tried the below suggested in postfix it did not alter the Return-Path in the message header. -t allows you to extract recipients from the message headers but the Return-Path remained set to whichever user invoked the command.
In postfix you need the -f option as follows:
sendmail -t -f testing@taxpayer.com <<MAIL From: "Angry Taxpayer" testing@taxpayer.com To: "Dave" bob@taxisbad.com Reply-To: "Paul Martin" paulm@canadianrulingparty.gc.ca Subject: Tax cuts
Dear Sir,
I pay too much in tax
Tx
Regards,
John Lange
On Wed, 2004-02-11 at 08:23, Sean A. Walberg wrote:
Last night a couple of questions came up (both from Steve, I think). The first is for a filter that converts a month name to a month number from within an ls listing. Locale is probably the most correct approach, but BFI works great too:
ls -l | perl -p -e '@m=qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/; for ($i=0; $i<@m; $i++){ s/\b$m[$i]\b/$i+1/e}'
And, how to generate an email from the command line with custom from/reply-to headers, use sendmail -t and write down the headers yourself:
/usr/lib/sendmail -t <<MAIL From: "Angry Taxpayer" testing@taxpayer.com To: "Sean" sean@ertw.com Reply-To: "Paul Martin" paulm@canadianrulingparty.gc.ca Subject: Tax cuts
Dear Sir,
I pay too much in tax
Tx