Install and Configure Postfix for reliable email delivery

Valic —  September 7, 2010 — Leave a comment

In this article you are going to learn how to install Postfix on your already running Debian 5.0.

I am going to assume you have it networked and have a domain registered that you want to use. At the end of this article you should have a working mail server, ready for use:

Installation:

apt-get install postfix

Configuration:

The file for confugure is /etc/postfix/main.cf.

To set your Postfix installation up for your domain you will want to open that file for editing like so:

nano /etc/postfix/main.cf

The above command opens main.cf in the Nano editor. What you need to look for is this section:

myhostname = debian-tutorials
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = debian-tutorials.com, debian-tutorials, localhost.localdomain, localhost
relayhost =
#mynetworks = 127.0.0.0/8
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

NOTE: You will need to go through the above section and insert your domain where you see debian-tutorials.com.

Some people also like to use the mydomain parameter, but since mydomain is taken from $myhostname by removing the first part (unless that would cause the domain to be a top-level domain) it can be redundant. If, however, your mail server serves your entire domain, you will need to use the mydomain parameter. For that you would insert:

mydomain = debian-tutorials.com

at the top of the section shown above.

Restart Posfix:

Once you have that configuration saved, restart Postfix with the command:

/etc/init.d/postfix reload

To test your server you can use this : Tutorial: Sending Mail Through Command line

Valic

Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

No Comments

Be the first to start the conversation.

Leave a Reply