Use smarthost with mailx/mail (Postfix)

From ben.goodacre.name/tech

Jump to: navigation, search

The client mailer mail / mailx with Postfix by default will contact the MTA directly from a MX record lookup. If you are behind a firewall or otherwise cannot contact external servers and require the user of an ISP of company-provided relay the following syntax can be used:

cat email_body | mail -s "subject" -S smtp=smtp.company.net -r from@address.com to@address.com

References

http://superuser.com/questions/137461/does-mailx-send-mail-using-an-smtp-relay-or-does-it-directly-connect-to-the-targ

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox