Mac OS X 10.5 and 10.6 come with a mail-sending program called
postfix, but it is not turned on by default. This might work with 10.7, but I have not looked into that.
If you just want to send all of your outgoing mail to some relay server, like the SMTP server of your Internet service provider, you usually need to have a host name for the computer that is sending the mail. This configuration is for a server that is not being used to receive mail.
Open Terminal and enter the following commands, each on a single line. After the first command you will be prompted for your password. (Oh, you need to be logged on as a user with administrative privileges.)
First, you want to set
postfix to run when your computer tries to send mail:
% sudo launchctl unload /System/Library/LaunchDaemons/org.postfix.master.plist
% sudo defaults write /System/Library/LaunchDaemons/org.postfix.master OnDemand -bool true
% sudo launchctl load /System/Library/LaunchDaemons/org.postfix.master.plist
Next, you want to tell
postfix what the host name of the computer is:
% sudo postconf -e myhostname=<host-name-of-computer>
postfix what SMTP server to use to send email:
% sudo postconf -e relayhost=<your-isp's-smtp-server>
This works for me because my ISP does not require authentication to use their SMTP server. They only require that the traffic be coming from their network.
If the SMTP server you are using requires authentication, there are a few extra steps:
% sudo echo <you-isp's-smtp-server> <username>:<password> >> /etc/postfix/sasl_passwd
% sudo postconf -e smtp_sasl_auth_enable=yes
% sudo postconf -e smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
At this point, if
postfix tries to send email to
someone@<host-name-of-computer>, the email will be delivered locally. If your email for this host name is handled by some other server, tell
postfix that this is not the final destination for email sent to that host name:
% sudo postconf -e mydestination=localhost
I used the following specifically for my environment:
% sudo postconf -e myhostname=subtlecoolness.com
% sudo postconf -e relayhost=smtp-server.austin.rr.com
There! You should now be running
postfix and your web server will send emails!
(I wrote a blog post about this a long time ago.)