Results 1 to 5 of 5
Hello
I'm running Ubuntu 7.04 Server to which I need to add e-mail capability. I installed Postfix through "apt-get install postfix", edited /etc/postfix/main.cf.
Since I couldn't figure out how to ...
- 11-12-2007 #1Linux Newbie
- Join Date
- Nov 2007
- Posts
- 127
Sending email from command line?
Hello
I'm running Ubuntu 7.04 Server to which I need to add e-mail capability. I installed Postfix through "apt-get install postfix", edited /etc/postfix/main.cf.
Since I couldn't figure out how to use the sendmail command, I installed mailutils... but failed finding examples on how to use /usr/bin/mail with all the fields set from the command line:
echo Call from customer X | mail -s Call from customer -f postfix@acme.com X fred@acme.com:
Is it possible to specify the FROM and TO fields from the command line, and if yes, how?ubuntu postfix/local[10214]: D24476343E1: to=<blah@ubuntu.acme>, relay=local, delay=0.19, delays=0.08/0.03/0/0.08, dsn=5.1.1, status=bounced (unknown user: "blah")
ubuntu postfix/smtp[10213]: D24476343E1: to=<fred@acme.com>, relay=smtp.isp.tld [some_ip_here]:25, delay=0.37, delays=0.08/0.04/0.22/0.03, dsn=5.0.0, status=bounced (host smtp.isp.tld[some_ip_here] said: 504 <root@acme>: Sender address rejected: need fully-qualified address (in reply to MAIL FROM command))
ubuntu postfix/local[10216]: D24476343E1: to=<from@ubuntu.acme>, relay=local, delay=0.96, delays=0.08/0.07/0/0.8, dsn=5.1.1, status=bounced (unknown user: "from")
Thank you.
- 11-13-2007 #2Linux Newbie
- Join Date
- Sep 2007
- Posts
- 161
hi,
the To: field is specified as the last argument on your command line, so
ought to send mail to fred.Code:echo "Call from customer X" | mail -s "Call from customer X" fred@acme.com
afaik the From: field default to the user who is sending the mail and there is
no option to change this -- in my view, this makes sense because else forgery
of mails would be too easy (it's easy enough though).
cheers, kai
- 11-13-2007 #3Linux Newbie
- Join Date
- Nov 2007
- Posts
- 127
- 11-21-2007 #4Just Joined!
- Join Date
- Nov 2007
- Posts
- 1
You can specify the from field from the command line in Mail.
After specifying the to email address add -- -f from_email_address
See an example in this post on mindspill technology blog
Cheers,
Mike
- 11-22-2007 #5Linux Newbie
- Join Date
- Nov 2007
- Posts
- 127


Reply With Quote
