Today at 7:51pm, Andrew Jorgensen said:

>I need a way to set the 'From' address in a email sent from the
>command-line using the 'mail' program (the BSD version I think, whatever
>Red Hat / Fedora is using).  I imagine that this program uses the local
>mail service (postfix in this case), so a configuration there would be fine.

Depending on the version of 'mail' you have, you can do it in several
ways. Sometimes the "From:" header can just be passed in on stdin with the
rest of the headers and the message by using the -t switch, IIRC. Some
versions also have a -f flag that lets you pass a from address through to
sendmail.

>Heck, even if I could manually set the Reply-To: field using 'mail'
>(perhaps some directive in mail.rc?) that would be sufficient. I've
>scoured the man page a couple of times, but it's a little muddled
>because 'mail' is also used for reading mail.

Again, you can also set Reply-To: on standard in, at least with some
versions, by using -t.

One version I use with a perl script I wrote does the following:

mail -a "Reply-To: Name <[EMAIL PROTECTED]>" \
-a "From: Name <[EMAIL PROTECTED]>" \
-s "This is my Subject" \
"Recipient <[EMAIL PROTECTED]>"

Some versions use -r for return address, too.

Mac

--
Mac Newbold             MNE - Mac Newbold Enterprises, LLC
[EMAIL PROTECTED]       http://www.macnewbold.com/

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to