This article describes how to install a postfix mail server with no extras or optimization. It's intended only for users who are experienced administrators or who just want a basic mail server installed for a single purpose like sending email alerts from another service.
Setting up an email server has a reputation for being complicated, fiddly and requiring a lot of work to keep safe and secure. Well, there is a good reason for that: it can be complicated, fiddly and can take a lot of work to keep safe and secure.
However, once you get to grips with the basics, you begin to see how mail works and what is actually happening behind the scenes. These articles take you from the very basics such as setting the Slice hostname and sending mail to running a full blown mail server.
Please also note that we teamed up with the nice folks at Rackspace Email to offer a promotion to our customers who don't necessarily want to dabble with setting up their own mail server on the slice. The first two articles on this page will walk you through the process of purchasing an account with Rackspace Email as well as setting up the necessary MX records for your domain.
Rackspace Email & Apps:
Rackspace Email & Apps - Initial Signup Process: In order to begin using Rackspace Email, we must first purchase an account. This article will walk you through the initial signup process for Rackspace Email & Apps.
Creating MX Records for Rackspace Email & Apps: Now that you have purchased an account with Rackspace Email & Apps and setup your mailboxes, let's move forward with creating the necessary MX Records for use with this service.
Email - Slice basics:
Email - Preparing the Slice: It is vital the Slice has the basics such as the hostname and Reverse DNS correctly set before we configure any sort of mail service.
Email - Setting a Sender Policy Framework (SPF) record: Setting correct SPF records for your domain's mail server can help in reducing spammers using your domain for nefarious purposes!
Email - Sending email from the Slice:
Note: the articles in this section are for sending mail from the Slice. This is a common requirement when a web application sends mail to the admin user or other users. It is not intended to be used for setting up a full mail server (articles will follow on that subject).
Postfix - Installation: Now we've set the Slice basics, we can move onto installing postfix. This MTA (Mail Transfer Agent) is the base package of all our mail needs.
Postfix - basic settings in main.cf: Let's move on and see what the main.cf file contains and how we can change some of the settings for easier administration.
Postfix - MX records and receiving emails: This article examines MX records and how to set them so we receive emails on the Slice.
Postfix - using telnet to test postfix: Using mail clients on our workstation to send mail to the server is fine, but let's use telnet to investigate the postfix responses in detail.
Postfix - checking for an open relay: Running an open relay means anyone can use your mail server to send mail. Let's check the postfix install is not running an open relay.
Removing a mail server from the Spamhaus PBL: Spamhaus keeps a list of IP addresses that might not need to run mail servers, and your slice may be on it. Remove it easily with these instructions.
Barebones Postfix install overview: A barebones set of instructions for installing Postfix. Aimed at experienced admins who just want to set up a basic postfix install to send email from a slice. This overview links to distribution-specific articles.
Email - mail server setup:
Note: The articles in this section are for those who want to run a mail server. It is aimed at users who have multiple domains and users, however, it can be used with a single domain.
Mail Server overview: Before diving into installing and configuring the multiple packages that are required for a mail server, let's take an overall look at what is required.
Mail Server - Slice setup: Let's start the process by preparing the Slice to host our mail server.
Mail Server - Vmail user and mailboxes: Creating multiple domains and users for our system is all well and good, but we still need somewhere to physically place the emails.
Mail Server - Postfix and MySQL installation: Now the ground has been prepared, we can install the main components: Postfix and MySQL.
Mail Server - Creating the MySQL database: Once MySQL has been installed, we need to create the 'mail' database that will hold the information for our domains and users.
Mail Server - Configuring Postfix to use MySQL part 1: Now MySQL has been installed and the db created, we need to look at configuring Postfix to use it.
Mail Server - Configuring Postfix to use MySQL part 2: Continuing the theme of configuring Postfix to utilise the MySQL installation.
Mail Server - Secure connection, configuring saslauthd: Now we need to setup and configure saslauthd to allow us to utilise a secure connection to our mail server.
Mail Server - Secure connection, creating the SSL certificate: Let's create a self-signed certificate for our Postfix connections.
Mail Server - Secure connection, configuring Postfix: Now more security aspects are in place, we can now move into configuring Postfix.
Mail Server - Courier installation: To enable pop and imap (along with secure pop and imap) we need to install and configure Courier.
Mail Server - Opening ports in the firewall: The base Slice setup had minimal ports open - let's open the relevant ports in our iptables configuration.
Mail Server - Adding domains and users to MySQL: Now we have the basic mail server setup - we need to add domains and users to the MySQL 'mail' database.
CentOS - Email - Mail Server Setup:
Note: The articles in this section are specifically aimed at users running CentOS on their slice. They are designed for users who have multiple email users and domains, however, they can be used for a single domain as well.
CentOS - Email - Preparing the Slice: It is vital that the Slice has the basics such as the hostname and Reverse DNS correctly set before we configure any sort of mail service.
CentOS - Email - Setting a Sender Policy Framework (SPF) Record: Setting the correct SPF records for your domain's mail server can help in reducing spammers from using your domain for nefarious purposes!
CentOS - Mail Server - Installation: Now that we've setup the Slice basics, we can move onto installing Postfix. This MTA (Mail Transfer Agent) is the base package for all of our mail needs.
CentOS - Mail Server - Basic Settings in Main.cf: Let's move on and see what the main.cf file contains and how we can change some of the settings for easier administration.
CentOS - Mail Server - Secure Connection, Configuring Saslauthd: Now we need to setup and configure saslauthd to allow us to utilize a secure connection to our mail server.
CentOS - Mail Server - Secure Connection, Creating the SSL Certificate: Let's create a self-signed certificate for our Postfix connections.
CentOS - Mail Server - Secure Connection, Configuring Postfix: Now that more security aspects are in please, we can move onto configuring Postfix to use them.
CentOS - Mail Server - Dovecot Installation: To enable POP and IMAP (along with secure POP and IMAP) we need to install and configure Dovecot.
CentOS - Mail Server - Opening Ports in the Firewall: The base Slice setup had minimal ports open - let's open the relevant ports in our iptables configuration for our mail server.
CentOS - Mail Server - Adding Domains and Users: Now that we have the basic mail server setup, we need to add our domains and users..
Please feel free to request articles or comment with any suggestions or ideas of your own.