Created
July 23, 2009 16:19
-
-
Save codeprimate/153149 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| groupadd -g 5000 vmail | |
| useradd -g vmail -u 5000 vmail | |
| mkdir -p /var/mail/vhosts/example.com | |
| mkdir -p /var/mail/vhosts/example2.com | |
| chown vmail:vmail /var/mail/vhosts/example.com | |
| chown vmail:vmail /var/mail/vhosts/example2.com | |
| /etc/postfix/main.cf: | |
| virtual_mailbox_domains = example.com, example2.com | |
| virtual_mailbox_base = /var/mail/vhosts | |
| virtual_mailbox_maps = hash:/etc/postfix/vmailbox | |
| virtual_minimum_uid = 100 | |
| virtual_uid_maps = static:5000 | |
| virtual_gid_maps = static:5000 | |
| virtual_alias_maps = hash:/etc/postfix/virtual | |
| /etc/postfix/vmailbox: | |
| info@example.com example.com/info/ | |
| sales@example.com example2.com/sales/ | |
| info@example2.com example2.com/info/ | |
| sales@example2.com example2.com/sales/ | |
| # Comment out the entry below to implement a catch-all. | |
| # @example.com example.com/catchall/ | |
| /etc/postfix/virtual: | |
| # to direct virtual account traffic to a real system account | |
| postmaster@example.com postmaster | |
| /etc/courier/authdaemonrc | |
| authmodulelist="authuserdb authpam" | |
| postmap /etc/vmailbox | |
| postmap /etc/virtual | |
| /etc/init.d/postfix restart | |
| /etc/init.d/courier-authdaemon restart | |
| echo "First Post" | mail -s "Welcome" info@example.com | |
| echo "First Post" | mail -s "Welcome" sales@example.com | |
| echo "First Post" | mail -s "Welcome" info@example2.com | |
| echo "First Post" | mail -s "Welcome" sales@example2.com | |
| userdb "info@example.com" set uid=vmail gid=vmail home=/var/mail/vhosts/example.com/info mail=/var/mail/vhosts/example.com/info | |
| userdbpw | userdb "info@example.com" set systempw | |
| userdb "sales@example.com" set uid=vmail gid=vmail home=/var/mail/vhosts/example.com/sales mail=/var/mail/vhosts/example.com/sales | |
| userdbpw | userdb "sales@example.com" set systempw | |
| userdb "info@example2.com" set uid=vmail gid=vmail home=/var/mail/vhosts/example2.com/info mail=/var/mail/vhosts/example2.com/info | |
| userdbpw | userdb "info@example.com" set systempw | |
| userdb "sales@example2.com" set uid=vmail gid=vmail home=/var/mail/vhosts/example2.com/sales mail=/var/mail/vhosts/example2.com/sales | |
| userdbpw | userdb "sales@example.com" set systempw | |
| makeuserdb | |
| # For some reason this setup may have problems with IMAP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment