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


cat myfile.txt | mail -s test -F /tmp/.muttrc [email protected]

where /tmp/.muttrc contains:

send-hook . 'my_hdr From: Alternative user <[email protected]>'

Or a smarter way is to add a formula to send always to [email protected]
as from [email protected] something like this (in your regular .muttrc
file):

send-hook '~C ^[email protected]$' 'my_hdr From: Alternative user name 
<[email protected]>'

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