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 [email protected] [email protected]

References

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

Category:Linux Category:Postfix