View Full Version : My machine as an smtp server?

Titanium Man
05-19-2002, 01:29 PM
Hello everyone, I was wondering if its possible to use my machine as an smtp server, and if so, how to set it up. Here's my sob story: I got DSL the other day (a big change from dialup) but outgoing mail to my mac.com account wasn't happening. I had to change my smtp server to the smtp server of my isp, and disable smtp authentication. Now, I've checked out this hint:


and couldn't get it to work for me. I have a powerbook, and would like to be able to send mail from various locations, so the reponses toward the bottom of the hint referenced above (about using sendmail as an smtp server) looked intriguing to me. I currently have sendmail running, and can send myself little love notes using the 'mail' command. What should I do now to be able to use my machine as my own smtp server (if that's possible in my situation)? Here's my setup:

Titanium PB 400mhz
OS 10.1.4
Developer's tools installed
sendmail enabled
Earthlink DSL (home) LAN (work)
Transparent Terminal windows


05-19-2002, 09:29 PM

Here is a good tip on how to set your machine as an smtp server :


Hope it helps.


Titanium Man
05-19-2002, 10:09 PM
Thanks, sao, that has some good stuff! Only thing is, I don't have a DNS. I'll maybe look into getting one if it won't cost too much, just so I can check my email from various locations though. Anyone else have any ideas as to how to solve the problem? Maybe I'm going about it the wrong way with pursuing setting up my machine as an smtp server...

05-20-2002, 06:26 AM
You don't necessarily need a DNS to have an SMTP server. Get a dynamic IP like one from dyndns.org and use that to point to your machine with the ip. Interesting note in the FAQ at dyndns about peoples's misconceptions needing an MX record (part of DNS setup). They imply that assuming you are a simple small LAN an dthe machine being pointed to by the dyndns address does not need a specific MX record. What SMTP software will you be using to setup your server? I have had quite a bit of luck with Postfix (SMTP) and QPopper (POP3) myself.

05-20-2002, 09:03 AM

An MX is only required if you have failover mailservers (for when your main server is unavailable). If no MX record exists for your PB, MTAs will simply use the host name as given in the email address.

It is worth mentioning that without a failover, you may miss mail if your DSL goes down. It is also means that your PB has to be on all the time, and connected. What's the point of a laptop in that case? :)

Now, if you won't be receiving any mail on this machine, you don't have to worry about any of that. You also don't have to worry at all about your hostname. You may have other problems if you can't receive on this machine, but sending mail won't be one of them.

- Avi

05-20-2002, 09:06 AM
Exactly - unless you are setting up for a network or LAN I would personally stay away from SMTP servers unless you really have the need. In a pinch the built-in Sendmail will do fine.

Titanium Man
05-20-2002, 09:26 AM
Hello everyone, thanks for responding. Ok, it seems that the smtp server thing on a powerbook is kind of silly after all. bluehz, I'm intrigued by your last comment. Does that mean I can use sendmail to send out an email from my mac.com account using Entourage, or does that mean I'd use the 'mail' command? Frankly, I don't know why my smtp server can't remain smtp.mac.com. I had Earthlink dialup and used the mac.com smtp with no problems, but suddenly with Earthlink DSL, it has to be smtp.earthlink.net.

Craig R. Arko
05-20-2002, 10:19 AM
It's because Earthlink blocks other smtp servers to try to eliminate spam relaying. Just use the Earthlink smtp server for your outbound mail and whatever server you need for incoming (POP/IMAP). The two needn't be related to each other.

Titanium Man
05-20-2002, 10:32 AM
I wish I could, but since I have a powerbook, I'd like to be able to send mail from various locations. smtp.earthlink.net works fine at home, but not when I'm connected through a different isp or when I'm at work on a LAN. :(

05-20-2002, 10:37 AM
Going on a small tangent here...

It would be really nice if there were hooks in the Network Preferences/Location switching to run a script on location change. This script could be changed by each user to make whatever changes were necessary outside of whatever the PrefsPane does.

This could handle changing your smtp server, for example.

- Avi

Titanium Man
05-20-2002, 10:58 AM
Yeah, I had though of writing a cron script that would check what the value of $HOSTNAME is, and if it were not my home value (ie, 'localhost'), would execute an applescript to tell Entourage to change my smtp server to smtp.mac.com instead of smtp.earthlink.net. The only thing is, when I get home from work, the value for $HOSTNAME is still the work setting until I restart. Bummer!

Titanium Man
05-20-2002, 11:18 PM
I love how much of a Rube Goldberg I can be. I was all set to try to configure my powerbook as an smtp server (ha!), and compile mutt and pine in order to figure out how to send email from a different smtp server than my home isp's smtp server. As a last resort, I called Earthlink, and they said that normally only people on their network could use their server in order to prevent abuse (as you pointed out Craig). However, they also have a separate server for people with portable computers, which requires authentication. DUH! I didn't think to call them until the end of this wild goose chase. I still haven't tried out sending email from work, but I was able to do so from home using the alternate server, and all is well. I still might play around with mutt just for fun, but am glad that there are other options. Thanks to all who replied :)


05-21-2002, 12:08 AM

Maybe I'm simple here, but there's a somewhat easy way to do this. In fact, it's the method that I use.

I use my dialup Earthlink account as my primary e-mail account. I have Cox cable at home but I always want my e-mail to be from my Earthlink dialup account. So, I set up multiple POP accounts ( Tools menu then Accounts). On my Cox setup, I use the normal settings but I use my Earthlink e-mail address as my e-mail with the POP and SMTP settings set to Cox's servers. I also have an Earthlink dialup POP account with all the correct settings too. When I'm at home, I just select the Cox account and then it send with the correct e-mail address but it uses Cox's servers.

What I suggest is that you setup a POP account for location(home, work, dialup) and then when you compose the message, you merely choose the account that you wish to use to send the mail based on where you are. You can even make Entourage not check e-mail off of certain accounts when you click the "Send & Receive" button which is nice if you're not dialed up and don't want to check your dialup account.

I know it's not clean and frankly I've been contemplating using sendmail on my Powerbook just so I don't have to do this constant selection process when I compose e-mail, but I've done it this way for a long time since I was a Windows user and there is no such thing as Sendmail for Windows 2000. Ok, there is, but would you want to trust your e-mail to Windows 2000 running a native Unix program to send for you?

The downside to this is that you need a mail server to be a mail relay server everywhere you go, but everyone locks them down to their domain. It's understandable, but a pain for those of us who travel. The nice part is that nearly everyone lets you POP your mail from anywhere. It's just the sending part that snags you.

Anyways, this as close as I have to changing Locations on the fly. I do the same thing with Mail.app too. The only time this didn't work for me was when I was at work where they used Microsoft Exchange to send e-mail. You could only send e-mail with the Outlook client. I have an OpenBSD firewall though and I used it as my mail server when I was at work.

05-21-2002, 06:16 AM
Mac.com mail accts allow you to send mail out from anywhere after authentication.

06-26-2002, 01:36 PM
After a lot of wading through all the online tutorials, I have my iBook set up to send it's own SMTP mail over DSL. All I have been wanting to do is send mail without always changing SMTP server in different locations or relying on the unreliable DNS update.

I setup sendmail for OSX 10.1.5 using the tutorials from www.kung-foo.tv/osxtips.php and from O'Reilly's MacDev Center (http://www.macdevcenter.com/mac/) which includes important new info for 10.1.5

I signed up for a Dynamic DNS with www.dyndns.org, then installed the free "DNS Update" tool to make sure it was always kept up to date. If your connected through a router to DSL, make sure you set the connection to "External" in DNS Update (More hair torn out - was pointing to the local address for the router).

Set your hostname in the Sendmail config files to your dynDNS domain name, then from Entourage (or, I assume, any other email app) set the SMTP server to "localhost" or enter your IP address (for me, both seem to work). Hopefully you should now be able to send mail no problem without using anyone elses SMTP server. Usefully, I've found that Entourage seems to pick up error messages from Sendmail and pops up with a window. Don't know how reliable this is though, so best check mail.log now and again to check the mail is getting sent OK.

I think there is an option in Sendmail to ignore unresolved addresses. This appears to be the problem with needing a domain name - it wants to check the email address you are sending from or something. I am wondering if you can turn on this option you can just enter a phoney domain in sendmails "hostname" config and still just send mail. Still searching...

Hope this helps someone in the same situation as me (I don't think anything I've sent using mac.com SMTP has actually arrived.)


06-26-2002, 01:50 PM
I wish it were that easy now - I used to have a mail server running on my iBook, I chose Postfix. Setup was relatively painless and it worked...nuff said. Ever since I picked up an old PC out of a dumpster, installed Linux and delegated it as a DNS-caching nameserver, I have not been able to get my mail server on any machine to work. Some strangeness between the mailserver and the DNS server that is beyond my knowledge of either. Unfortunately - the benefits of the DNS-caching nameserver outweigh the benefits of my own mailserver, so I keep that. About once a week though - I get the urge to twiddle and I spend several hours trying in vain to get a mailserver, ANY mailserver running - alas - no such luck. Hey - at least it keeps me off the streets....