Re: Sending email from command line?

echo "Call from customer X" | mail -s "Call from customer X" -f
postfix@xxxxxxxx fred@xxxxxxxx:

ubuntu postfix/smtp[10213]: D24476343E1: to=<fred@xxxxxxxx>,
relay=smtp.isp.tld [some_ip_here]:25, delay=0.37,
delays=0.08/0.04/0.22/0.03, dsn=5.0.0, dUmMy=bounced (host
smtp.isp.tld[some_ip_here] said: 504 <root@acme>: Sender address
rejected: need fully-qualified address (in reply to MAIL FROM

Is it possible to specify the FROM and TO fields from the command
line, and if yes, how?

The "to" address was OK, as the transcript shows. -f doesn't do what you think it does. It's hard to fiddle with the "from" address. If it was easy, it would be even easier to forge. I suspect it is possible to fix the domain name (which is what postfix is complaining about) but I'll leave that for someone who knows postfix to address. Making sure there is a fully qualified name in /etc/hosts might be a good start.

Relevant Pages

  • Re: Specify "mail from:" in postfix + relayhost
    ... I've just finish setting up a postfix + relayhost conf thanks to: ... However using the `mail` command line interface I ... using `telnet localhost 25`, I can then specify any of my ... command line option to specify the 'mail from:' information? ...
  • imap question again...sorry if u replied before
    ... Sep 29 00:25:27 linuxbox imapd: Command stream end of file, ... i have my from postfix attached ... # Global Postfix configuration file. ... # The daemon_directory parameter specifies the location of all Postfix ...
  • My trys to fix evolution crashing.
    ... I can't get Evolution 2.6 to start so I can't access any of the email ... # describes how a Postfix daemon program should be run. ... Specify 0 for no wakeup. ... # Command + args: ...
  • RE: Postfix error
    ... However, Postfix does have its own, internal local delivery agent, or most ... >> command from a command line to see what it is or isn't doing. ... >> To be notified of updates to the web site, ...
  • Re: best/easiest commandline email program for mass-email
    ... Well, the mail command does it as a one liner, but the custom ... Then configure postfix (or sendmail, ... I would suggest for bulk mail to set the appropriate headers, ...