Postfix

This short walkthrough will show you how to install Postfix and get SMTP-AUTH working without having to mess with a MySQL database, all those extra .cf files under /etc/postfix, or pretty much any of the other stuff that’s in the Gentoo Mailhosting Guide. To be fair, it’s not that the guide is bad; it’s just overkill for many Postfix admins who just need a couple of mail accounts under a single domain. If you fall into that category, read on.

Postfix

Ok, so we’re using Postfix — the über-sick mail server of doom. It’s about simplicity. Postfix has relatively few moving parts and strikes me as nothing less than beautiful. Anyway, I assume that if you’re reading this you don’t need to be sold on Postfix. We’ll move on.

SMTP-AUTH

<

p>I prefer SMTP-AUTH because I tend to travel a lot and don’t want face issues with sending mail from continuously changing locations. Essentially, to avoid spammers using your shiny new mail server as a spam relay, you have to lock down who can send mail out of your box. Here are the basic rules:

  1. Anyone can send mail to your domain(incoming)

  2. Only authorized people can send email to other domains(outgoing)

<

p>The most basic way to avoid this in Postfix is to configure the mynetworks option in your main.cf file.

mynetworks = 127.0.0.0/8

What this says is that only people from 127.0.0.0/8 can send mail out of your system, which gets tedious for those that travel. If you use this method then you have to SSH into your box and edit this line every time you want to check your mail from a new IP. Bad form.

That’s where SMTP-AUTH comes in. Using it you can just connect in from wherever you are and send your mail normally. This is because the authentication is based on who you are, not where you are connecting from. When this method is used you send username and password credentials when sending mail to let your mail server know it’s you. And yes, it’s encrypted.

Getting Started

So now that we have all that out of the way, let’s get this all up and running. I use Gentoo, but most distros should work without too much trouble.

<

ol>

Related posts: