3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Using SMTP and SASL with Postfix when your ISP won't relay

Good day!

I recently spent several hours poring over configuration files and telnet sessions, trying to figure out why I couldn't send email from my linux machine any more.

For years I have used the postfix mailer to handle sending email out to the world, and enjoyed using dinosaurish text-based e-mail clients like pine and mutt, or web-based SquirrelMail. Email I write is dropped into the mail queue, and then postfix relays it to my ISP's mailserver and from there, to the world.

Well recently I changed ISPs, and I received errors from my ISP's mailserver: relay not available.
Turns out, my ISP requires authentication in order to relay mail through it - a reasonable yet annoying requirement. This is what I had to do to get it to work. Read on....

Caveat: this tutorial assumes you have a working postfix installation, and just need to add SASL authentication so that you can use your new ISP's mailserver as a relay when you didn't have to auth to a relay before.

Caveat 2: If your ISP does not want you to do this, then don't. I am not liable! I actually contacted my ISP and told them what I was doing, they didn't mind as long as I authed properly.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Determine AUTH method

Before starting, you might as well check what AUTH method your mailserver understands. Luckily, this is very easy to do with telnet (actual hostnames are masked for security).

At your shell prompt, type:

$ telnet mail.yourmailserver.com 25

This will establish a connection to your mailserver. You'll see something like this:
Trying [ip address of mail server]...Connected to mail.yourmailserver.com.Escape character is '^]'.220 YourMailServer SMTP Server Ready

The mailserver is waiting for you to send a command. Type
EHLO
and hit enter. You should see something like this:

250-SIZE 0250-AUTH LOGIN250-AUTH=LOGIN250 8BITMIME

What you're interested in is the AUTH line. My mailserver tells me it does authorization via LOGIN. You may also see PLAIN here, or potentially things like TLS or SSL. If you can use TLS or SSL, you should. The postfix website has good info on using TLS to secure your mail transactions, or google can help you with that as well.
« Previous StepDownload PDFView All StepsNext Step »
1 comment
Aug 8, 2007. 9:32 PMcpotoso says:
Thank you, this is a very useful tutorial. I will use it!

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
10
Followers
10
Author:technosapien
I am a graphic art hobbyist, web cartoonist, and wannabe electronics hobbyist. Other hobbies: cooking, baking, exercise, computers, video games, trivia, and some more I'm probably not remembering.