How To Send Email From the Command Line on MacOSX 10.10.5 Yosemite

I wanted to send email from cron for various reasons, but the emails would bounce with an error 554:
554 5.1.8
Clearly, Postfix was using the “internal” hostname of myappledesktop.local (MacOSX has TWO hostnames! also, myappledesktop.local is not the real hostname ;-).
So, I needed two things:
1. a public FQDN in DNS that mail servers could see and resolve properly
2. to set the sending hostname to that FQDN
For the first, I used my DNS server to create a FQDN with home’s public IP address: myappledesktop.thewyz.net
Then, I edited the Postfix configuration file and set the sending hostname manually:
1 2 |
vim /etc/postfix/main.cf myhostname = myappledesktop.thewyz.net |
That did the trick!
No need to run postfix reload
, since postfix only runs on-demand, not as a daemon.
As always, YMMV…
Leave Your Comment
All fields marked with "*" are required.