LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   postfix: virtual mailbox domains (https://www.linuxquestions.org/questions/linux-server-73/postfix-virtual-mailbox-domains-916755/)

hydraMax 12-02-2011 07:12 AM

postfix: virtual mailbox domains
 
I'm setting up a new postfix installation. This go around, I am purposefully trying to utilize virtual mailbox domains, because I don't want any of the mail users to have actual UNIX accounts on the system. I think most everything in the Virtual README makes good sense, but I was hoping for clarification on a few points:

1. What uid/gid should I use for virtual_uid_maps and virtual_guid_maps? It looks like the system already has a mail:mail account/group (8:8). Can I just use that, or do I need to create another account/group? (say, vmail:vmail)

2. Likewise, what should be the user:group and the permissions of mailbox base directory which I presumably must create? (/var/mail/vhosts) These are the permissions of /var/mail:

Code:

# ls -lh /var/mail -d
drwxrwsrwt 2 root mail 4.0K 2011-05-18 08:05 /var/mail

3. I want all the system mail (stuff for root, localhost, etc.) not to get dropped in a UNIX account, but to be dropped in one of my virtual mailboxes (my personal e-mail account for the domain). Do I specify that in /etc/aliases, or in the virtual mapping file?

hydraMax 12-03-2011 12:19 AM

Sigh... evidently, of all the thousands of system admins at LQ, I am the first one to create virtual mailboxes with postfix.

Fortunately I was able to figure it out on my own, or partly so.

1. I found a postfix tutorial for Gentoo: http://www.gentoo.org/doc/en/virt-mail-howto.xml. It indicated that a vmail user should be created with

Code:

useradd -d /home/vmail -s /bin/false -m vmail
2. This isn't actually necessary because postfix will create the directories for you. Or, at least, it did for me. I had set virtual_mailbox_base = /var/mail/vhosts, and the /var/mail directory was already created by the system. The virtual mailbox directories won't be created immediately, but as soon as mail arrives for a domain, it creates the appropriate directories and assigns them to vmail:vmail with appropriate permissions.

3. This worked out a little differently then I expected, because the myorigin variable was set to $mydomain, so sendmail appends the domain name to mail normally directed towards root. So, I just added another entry to my vmailbox map pointing from root@<mydomainname> to my personal account. And this seems to work fine, at least according to my sendmail tests.


All times are GMT -5. The time now is 12:53 PM.