OS X Journal: Sendmail - Controlling your SMTP world


By

Week 3

9:07AM up 14:45, 2 users, load averages: 0.21, 0.11, 0.00

The Latest

I updated iTunes and my iPod over the weekend. I beginning to think something might be wrong with one of my FireWire ports. I haven't really tested things, but I've often had problems with FireWire drives under OS X, which were solved by switching ports. At first I thought it was a bad cable, but now I suspect a port.

In the upgrade I had two reboots. One after the iPod update failed, presumably because of a suspect FireWire port, and a second when installing iTunes. The iPod update failed in the middle. I canceled the update and unplugged the iPod to start over. OS X didn't like that and gave me a kernel panic. The second reboot was from the iTunes software after the install. A pet peeve of mine is superfluous reboots by OS X installers. Hopefully OS X actually needed to be rebooted, and the installer didn't just do it as a mater of course.

Also this week I updated my Adaptec SCSI 2906 card in another G4 system. The latest drivers came out last month, but I'm just now getting around to checking it out. Now Toast 5.1.2 r2 recognized my external LaCie CD-R drive for burning -- the only problem is Toast won't recognize an inserted CD-R disk. I didn't see anything in the line of firmware from LaCie. Anyone have any thoughts?

Sendmail

My latest adventure is OS X-ing is Sendmail. My Internet situation makes sending email increasing difficult. This week, we look towards OS X to solve my problems.

For those geek-disadvantaged, an SMTP server is how you send email over the Internet. Basically, your email program sends your email to this server, which then transmits the data to the recipient's mail host. Sort of like the postal service, except, well faster. One of the most popular SMTP servers is sendmail, which is an open source application available for unix-based operating systems.

There have been a lot of issues lately with SMTP servers, mainly due to SPAMMERS. In the good old days, ISPs ran SMTP servers for their customers with little problems. Now every entrepreneur in a cheap suit thinks somehow they can make money off of unsolicited email ads. There's nothing really stopping them from trying because email is free. What these low-lifes do is seek out people who run unrestricted SMTP servers and use their servers to broadcast their filth around the world. As a result, people started cracking down on SMTP servers.

My situation is that I've got a couple main email addresses. For IGM, it's flaminio@insanely-great.com and is hosted by my web hosting company. A while back they decided to stop offering SMTP services because they host a lot of domains, and they decided it was too much work to correctly secure SMTP on all these domain. So then I said, now what? Their solution was to use my ISP's SMTP server. The problem is, my ISP's SMTP server will only accept email from their own email domain, not others such as those from insanely-great.com. My next step was to use my old college's SMTP server, with which I still have an active account. They were cool with that since a lot of people use their services off campus. I had my solution for a few years and I was happy.

Then came along AOL/Time-Warner. AOL started the practice of not accepting SMTP servers that allowed open relaying, which is allowing basically any one to send email from their servers. I was somewhat intrigued by AOL's solution to its customer's SPAM problem, which is to look to the outside rather than at itself. I mean I know a handful of people who have a AOL accounts that haven't been used for years, but still manage to daily collect SPAM. People are getting these addresses somehow, whether they're stealing them or AOL is selling them. Anyway, AOL had ruined my day and I need a new solution.

The problem is, MSU needed a solution too, since now no one from an msu.edu domain could email to AOL accounts. As a result, they locked down the main SMTP server to only accept email sent from on-campus while at the same time starting a new open-relay SMTP server for people like me. I figured that this is a good solution as long as it kept working. Well, after about a year, now it's not.

So now I had to figure out how to get sendmail going on Mac OS X. To my surprise it was actually pretty easy. Basically Apple ships Mac OS X with the ability to be a personal SMTP server. It will allow you to send email from your computer, but restrict others from using it.

While cool, using your own SMTP server has some drawbacks. The first can be security. Sendmail has a history of being a favorite exploit for hackers. By running sendmail, you'll likely need to keep tuned to problems with the installed version. You may even need to update sendmail yourself, rather than waiting for an update from Apple. The second problem is kind of why people use SMTP servers to begin with. If for some reason an email can't be sent, your computer needs to be online until it can be sent. In other words, dial-up users probably wouldn't want to rely on sendmail to handle their email. But really this is a moot point as rarely this is a problem today. Back in the early days, the Internet was prone to problems where a fiber cut could brown out, even black out blocks of states. For the most part, email can be reliably sent today in real time, which kind of makes me question the need of SMTP servers any more.

So enough of my ranting, lets get to it. This is how I set up sendmail for SMTP on two different OS X machines. I found these instructions on a helpful Mac OS X page.

#1 - open the hostconfig file for editing: sudo pico /etc/hostconfig

#2 - change/check the line ROUTER to ROUTER=-AUTOMATIC-

#3 - change/check the line MAILSERVER to MAILSERVER=-YES-

#4 - sudo chmod 755 /

The last line may or may not be required. I had to do it, so you might too. This basically allows permissions for sendmail to operate.

That's about it, just reboot and you should be ready to go. In your email package you can set the SMTP server to 127.0.0.1 or localhost. You can check for errors in /var/log/mail.log.

I've been running this for about two weeks on two different machines. I've had two problems so far. First hotmail.com address apparently won't accept email sent through my SMTP setup. Anyone have any thoughts on this one? Second, one of my machines suddenly stopped working. This was actually shortly after I update iTunes, iPod and my kernel panic. I'm not sure if they're connected. I did the chmod 755 again, and that seemed to have cleared things up. We'll wait and see.

Let me know how it goes!