/*  UberLinux.org - Procedures - Postfix */

Welcome to storm.uberlinux.org
Linux Mandrake release 7.0 (Air)
Kernel 2.2.14-15mdksecure on an i586

>Postfix Mail Server v19991231 www.postfix.org

Following is the procedure that I used to set up my Postfix mail server. Postfix version 19991231 came preinstalled with the software so I will not be covering download and installation at this time. This example will use my host IP address of and the mail domain of uberlinux.org.

The first step will be to add your domain in DNS to point to the mail server. In my case, I added DNS forwarding zones for storm.uberlinux.org, uberlinux.org and mail.uberlinux.org to point to the IP which is the address of this computer. I am not currently running DNS on this machine so the configurations were placed elsewhere. Now, every request that comes in for the aforementioned mail hosts will be directed here. This is assuming that you have entered the correct nameserver(s) with your domain registrar.

The file that needs to be configured is main.cf. On my Mandrake 7.0 and Red Hat 8 boxes this file is located in the /etc/postfix directory.  Accessing the files is easy. Simply type cd /etc/postfix to go to the directory and open the main.cf file to edit the configuration.  I used the command vi main.cf to edit mine.You will need to know how to use text editors such as vi or emacs to do this from the command line.

The default settings are adequate for running a mail server for one domain. Here is the basic configuration:


Step Parameter Settings


1 myhostname = The myhostname parameter specifies the Internet hostname of this system. Syntax is myhostname =  host.domain.name. I have set mine to storm.uberlinux.org.


2 mydomain = The mydomain parameter specifies the local Internet domain name. Syntax is mydomain = domain.name. Mine has been set to uberlinux.org.


3 myorigin = The myorigin parameter specifies the domain where locally-posted mail appears to come from. Syntax is myorigin = $myhostname (host.domain.name) or myorigin = $mydomain (domain.name). Mine has been set to uberlinux.org.


4 mydestination = The mydestination parameter specifies the list of domains that the server considers itself the final destination for. Syntax varies based on need but generally is mydestination = $myhostname, localhost.$mydomain, $mydomain. Mine has been set to storm.uberlinux.org, localhost.uberlinux.org, uberlinux.org, mail.uberlinux.org.


Note that commas and white space are necessary in the mydestination = parameter. After editing the above parameters simply issue the postfix start command. This should start the postfix daemon. As a side note, you may want to set all mail addressed to root to forward to your user mail account. This can be done by adding the line root: username in the /etc/aliases file. Any newly added alias can be activated by issuing the newaliases command.

>Virtual Domains

Adding virtual domains is not difficult. First I created a file called domains and entered the mail domains I needed. Example: uberlinux.org, yeepa.com, solarisunix.com, etc. I then modified the mydestination directive to reflect the new domains:

mydestination = $myhostname, /etc/postfix/domains

Next. I added the initial users needed in the /etc/postfix/virtual file. Example:

username1@uberlinux.org     username1
username2@yeepa.com     username2
username3@solarisunix.com     username3@solarisunix.com

In this case I have three users username1, username2, and username3. Basically, when an email comes in addressed to username1@uberlinux.org it will be directed to username1's mailbox on the server. Mail addressed to username2@yeepa.com will go to account username2. The last one will deliver mail addressed to username3@solarisunix.com to account username3. The difference here is that all correspondence from the solarisunix account will appear to come from the solarisunix domain and not the uberlinux one.  

Next you will need to add a directive into the main.cf file to direct requests for virtual domains to the virtual file. I have entered two here:

virtual_alias_maps = hash:/etc/postfix/virtual
virtual_maps = hash:/etc/postfix/virtual

The final step is to refresh the system. Issue the postmap /etc/postfix/virtual command followed by the postfix reload command. Your system will then be running with the new settings. 

Last login: Thu July 17 16:06:33 from uberlinux.org
Hello. Welcome to Storm!
[chris@storm chris]$

home/    procedures/    stories/    archive/    links/    portfolio/    about/

Last Updated 04/30/2017

Copyright 2003-2017 uberlinux.org