Posts Tagged ‘virtual domain’

Postfix Virtual Domain Hosting Howto

.

Hi again

regarding one of my previous post which was about installing the postfix with spam filtering, i decided to write about the another capability of the postfix. the ability of serving to multiple domain. it could be configured with my_destination option but i highly recommended you to  enable it as virtual domain hosting.

the option you should add to your main.cf file (main configuration file of postfix commonly placed in /etc/postfix) are :

virtual_alias_domains = mehdibehamin.com , mehdibehamin2.com, mehdibehamin3.com
virtual_alias_maps = hash:/etc/postfix/virtual

after all you should create a new file which name /etc/postfix/virtual and add the the following option in it.

$yourdomainname       virtual

postmaster@$yourdomainname  user1

info@$yourdomainname  user2

@$yourdomainname user1

the second line indicates that the the mail postmaster@$yourdomainname should be forwarded to user1 of your linux system.

and the last says all the other email address with your domain suffix will be forwarded to user1.

then you should create the db file for your virtual file.

postmap /etc/postfix/virtual

then you should link it to your postfile chroot address.

ln -s /etc/postfix/virtual.db /var/spool/postfix/etc/

then reload your postfix service :)

reference : http://www.afp548.com/articles/Panther/postfixvirtual.html

thats it.

regards

fatal: open database /etc/postfix/virtual.db: No such file or directory

.

Hi again

in order to cover this error you should first create your virtual.db file, by typing the following command.

postmap /etc/postfix/virtual

but perhaps this problem still exists. as i wrote in my previous posts the postfix uses chroot by default. therefore you need to link the virtual.db file into the postfix root directory.

ln -s /etc/postfix/virtual.db /var/spool/postfix/etc/

after that the error should be eliminated from your mail log files.

regards

ln -s /etc/postfix/virtual.db /var/spool/postfix/etc/

     Copyrighted Mehdi Behamin , All Rights Reserved
    
Blog has been visited 204254 times