postfix email erver configuration


Hosting Provider
Feb 17, 2017
Some of you use postfix email server and honestly the initial configuration is simple and easy.

Here you go!!

-------> This is the main configuration file for Postfix.

You can open this configuration file in any of your text editor like nano,vim,vi

myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =
relayhost =
mynetworks =
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

This is the section of the configuration file you must focus on.

You need to configure the above sections properly!!

myhostname: This is the hostname of your machine. But don't put the full hostname. If your machine hostname is you will only use

mydestination: This parameter specifies what destinations this machine will deliver locally. The default is:

mydestination = $myhostname localhost.$mydomain localhost

You could also use something like ; sample localhost.localdomain localhost

This call is up to you. Either way will work; but the latter line will help to avoid mailloops.

: This line is a bit trickier. This entry will define authorized destinations that mail can be relayed from. You would think that adding your subnet here would work. Sometimes that is the case; sometimes not. You could go with a mynetworks entry that looks like:

mynetworks =

The above entry is a safe entry and defines local machines only.

You could also have an entry that looks like:

mynetworks = XX.XX.XX.XX/24

The above entry would authorize local machines and your internal network addresses.

I have found, however, that the above entries will cause problems with relaying due to constantly changing dhcp addresses. Because of this I have used the following, specialized entry which will avoid this issue:

mynetworks = [::ffff:]/104 [::1]/128

Now, if your mail server serves up mail to your entire domain, you will need to add another entry to that section above. That entry is:

mydomain =

Again, as in all configurations above, the will be substituted with your real domain.

Now, save that configuration file and restart your mail server with the command:

sudo /etc/init.d/postfix reload

You are good to go now.
Older Threads
Recommended Threads

Latest Hosting OffersNew Reviews


Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.