My outbound (SMTP) mailsever was always the university server. Upon graduation they disabled our accounts. This left me with the problem of not being able to reply or indeed send any emails. My web hosts Freehostia provide free accounts for hosting websites and allow you to have email addresses but charge for SMTP. You could use gmail but they change the email so everyone knows it came through them. There are a number of SMTP services avaliable but they all seemed to have their drawbacks.
Mac OS X comes with a number of open source programs buried away, emacs is one of the many that spring to mind. Since it is a unix operating system it was a fair bet that it would be possible to install Postfix but it’s installed already by default (The SMTP program for 10.0 to 10.2 was Sendmail).
It’s really easy to get a local SMTP server up and running. Simply follow these steps:
- You must be logged in as a user that is allowed to administer the system (see System Preferences).
- Download the file Postfix. Make sure it is extracted to your desktop into a folder named Postfix.
- Start the Terminal (in /Applications/Utilities/Terminal.App) and type in the following commands:
- sudo postfix start
You should not get an error message. Now do the following steps to make sure Postfix is started when you boot up your system. Note that the first step may produce an error message (directory already exists.) - cd /System/Library
sudo mkdir StartupItems
cd StartupItems
sudo mv ~/Desktop/Postfix .
sudo chown -R 0:0 Postfix
sudo chmod +rx Postfix/Postfix - sudo pico /etc/hostconfig
- Find the line MAILSERVER=... and change it to MAILSERVER=-YES-. If there is no such line, then add one at the end.
- Set your mail client (Entourage, Mail, Eudora…) to use 127.0.0.1 (localhost) as SMTP (mail) server to send email and username as _postfix (or just postfix in Mac OS X 10.4 Tiger).
- Postfix more or less runs out of the box. You may want to configure a static name for your host. This can be done by editing the main.cf file:
sudo pico /etc/postfix/main.cf
Thanks to David Reitter for the original article. Hosting your own mailserver isn’t without risk and the required modification of files may result in unexpected system behaviour. I don’t take any responsibility for your actions in following these instructions. Use at your own risk. Although it’s very unlikely there could be a problem.
Update: Some mail servers might treat your emails as spam if you use your own SMTP. You can check if your IP address will have that problem by searching SORBS or a similar service. Some home ISPs give their customers a dynamic IP address (one that will change). If this is the case you might be able to get round the problem by restarting your router and letting it pick up a new IP.