Previously, I mentioned that I was not able to successfully send emails via sendmail. This functionality is quite useful because WordPress, among other things, uses sendmail to send emails to you when someone leaves a comment on your post. So it turns out that because most public mail servers (i.e. gmail, hotmail, etc) do not trust my “omninoggin.com” mail server domain, all messages I sent were refused. After hours of research, I found out that I can route my mail traffic through my internet service provider’s mail proxy (SBC Yahoo!) to get this to work.
I started by following the Open Addict tutorial section “Configuring Mail Services”. After the step “Edit the [hostname].mc file, add these lines, I put mine above DAEMON_OPTIONS,” I stopped following the tutorial and did the following:
- Add these lines into my [hostname].mc file (above DAEMON_OPTIONS). Also note that “smtp.sbc.mail.yahoo4.akadns.net” is SBC Yahoo’s mail proxy server.
define(`confAUTH_OPTIONS', `A')dnl define(`confAUTH_MECHANISMS', `PLAIN LOGIN')dnl TRUST_AUTH_MECH(`PLAIN LOGIN')dnl FEATURE(`authinfo',`hash /etc/mail/authinfo')dnl define(`SMART_HOST',`smtp.sbc.mail.yahoo4.akadns.net')dnl
- Create the file /etc/mail/authinfo and put the following into it (all in one line) and save (also make sure you replace <your-username> and <your-password> with your real username and password):
AuthInfo:smtp.sbc.mail.yahoo4.akadns.net "U:<your-username>@sbcglobal.net" "I:<your-username>@sbcglobal.net" "R:sbcglobal.net" "P:<your-password>" "M:PLAIN"
- Run the following command:
makemap hash /etc/mail/authinfo < /etc/mail/authinfo
- Set sendmail to start (and listen) at boot, so add this to /etc/rc.conf:
- Create the file /etc/mail/local-host-names and insert your domain name(s) to accept mail for. Then, finish the sendmail re-build.
touch /etc/mail/local-host-names make all install restart
- Send a test email to yourself
sendmail -f "firstname.lastname@example.org" -F "webmaster"
From: Webmaster <email@example.com> To: firstname.lastname@example.org Subject: Hello World! Hello World! .
This should work but in case it doesn’t, there is some good troubleshooting information on DSL Reports. It took me 5 hours to figure this out so good luck!