Difference between revisions of "CentOS 7.x postfix email virtualhosting"

From Notes_Wiki
(Created page with "<yambe:breadcrumb>CentOS_7.x_postfix_configuration|CentOS 7.x postfix configuration</yambe:breadcrumb> =CentOS 7.x postfix email virtualhosting= It is possible to setup postf...")
 
m
 
Line 1: Line 1:
<yambe:breadcrumb>CentOS_7.x_postfix_configuration|CentOS 7.x postfix configuration</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x email configuration|Email configuration]] > [[CentOS 7.x postfix configuration|Postfix configuration]] > [[CentOS 7.x postfix email virtualhosting]]
=CentOS 7.x postfix email virtualhosting=


It is possible to setup postfix server for multiple domains (eg sbarjatiya.com, pbarjatiya.com, etc.) on a single server.  To perform postfix email virtualhosting use following steps:
It is possible to setup postfix server for multiple domains (eg sbarjatiya.com, pbarjatiya.com, etc.) on a single server.  To perform postfix email virtualhosting use following steps:
Line 38: Line 37:
Refer;
Refer;
* https://www.howtoforge.com/linux_postfix_virtual_hosting
* https://www.howtoforge.com/linux_postfix_virtual_hosting
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x email configuration|Email configuration]] > [[CentOS 7.x postfix configuration|Postfix configuration]] > [[CentOS 7.x postfix email virtualhosting]]

Latest revision as of 15:49, 28 August 2022

Home > CentOS > CentOS 7.x > Email configuration > Postfix configuration > CentOS 7.x postfix email virtualhosting

It is possible to setup postfix server for multiple domains (eg sbarjatiya.com, pbarjatiya.com, etc.) on a single server. To perform postfix email virtualhosting use following steps:

  1. Edit /etc/postfix/main.cf as follows
    1. Set myhostname = localhost
    2. Add following lines at bottom
      virtual_mailbox_domains = /etc/postfix/vhosts.txt
      virtual_alias_maps = hash:/etc/postfix/valias.txt
  2. Create /etc/postfix/vhosts.txt and write one domain name on each line. For example
    sbarjatiya.com
    pbarjatiya.com
  3. Create /etc/postfix/valias.txt. Write incoming and forwarding address one on each line. For domain forwarding mention incoming address as @domain.
    saurabh@sbarjatiya.com barjatiya.saurabh@gmail.com
    spam@sbarjatiya.com saurabhisgood@yahoo.com
    @sbarjatiya.com check-when-free@gmail.com
    parag@pbarjatiya.com parag@gmail.com
    priyanka@pbarjatiya.com priyanka@gmail.com
    @pbarjatiya.com check-when-free@gmail.com
  4. Create map using
    cd /etc/postfix
    postmap valias.txt
  5. Reload postfix using
    systemctl reload postfix
  6. Test by sending various emails to different domains. You can check queue on server using "postqueue -p" in case email is not delivered. Also check /var/log/maillog for troubleshooting.


Refer;


Home > CentOS > CentOS 7.x > Email configuration > Postfix configuration > CentOS 7.x postfix email virtualhosting