/* 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 22.214.171.124 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 126.96.36.199 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:
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.
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:
In this case I have three users username1, username2, and username3. Basically, when an email comes in addressed to email@example.com it will be directed to username1's mailbox on the server. Mail addressed to firstname.lastname@example.org will go to account username2. The last one will deliver mail addressed to email@example.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
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!
home/ procedures/ stories/ archive/ links/ portfolio/ about/
Last Updated 04/30/2017
Copyright © 2003-2017 uberlinux.org