On 21-07-2009, at 13h 27'04", steve wrote about "Re: Sending mail from the 
command line"
> >
> > cat myfile.txt | mail -s 'test' m...@example.com
> 
> 
> No. This will send a mail to m...@example.com (which is alright) but I
> want to send a mail to m...@example.com from account t...@example.com (I'm
> sorry I mixed things up in my previous message). The question is how can
> I specify t...@example.com on the command line?


cat myfile.txt | mail -s test -F /tmp/.muttrc m...@example.com

where /tmp/.muttrc contains:

send-hook . 'my_hdr From: Alternative user <t...@example.com>'

Or a smarter way is to add a formula to send always to m...@example.com
as from t...@example.com something like this (in your regular .muttrc
file):

send-hook '~C ^...@example.com$' 'my_hdr From: Alternative user name 
<t...@example.com>'

and then use mutt as usual (without -F).


I suggest also to read about use_envelope_from variable from mutt.
Also about the option -f of sendmail or similar MTA.



Ionel

Reply via email to