[Dovecot] Setup Question
I really want to try and get this plus addressing working correctly with Dovecot and Postfix. After doing some reading I think I am going to change my Postfix setup from mailbox_command to mailbox_transport. I have a few questions to make sure I am thinking correctly. All of my users are system users. Their mail is delivered directly to their "/home/<user>/Maildir" directory. Everything works great and I have no problems. Here is what I am thinking of doing.
- Create a new vmail user and group.
- Have all mail delivered for each user to the "/home/vmail/<user>/" directory. All mail will be owned by vmail, but that is okay since Dovecot is the only thing touching the mail files anyway.
- Change the mail_location setting in dovecot.conf to "mail_location = /home/vmail/%u
- Uncomment the auth_socket_path = /var/run/dovecot/auth-master setting in dovecot.conf
- Switch Postfix's main.cf to use "mailbox_transport = dovecot" and
put the following line in master.cf:
- dovecot unix - n n - - pipe flags=DR user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient} -n -m ${extension}
- Copy the current users mail to the new vmail location. What is the best way to copy it preserving date and time stamps on the mail?
Did I cover all of the steps are am I missing something? Here is a copy of my current dovecot -n output. Thanks for any help you can offer me.
# 1.2.rc3: /usr/local/etc/dovecot.conf # OS: Linux 2.6.29-1-amd64 x86_64 Debian squeeze/sid base_dir: /var/run/dovecot/ protocols: imap imaps pop3 pop3s ssl_cert_file: /etc/ssl/certs/ssl.crt ssl_key_file: /etc/ssl/private/ssl.key ssl_cipher_list: ALL:!LOW:!SSLv2 disable_plaintext_auth: no login_dir: /var/run/dovecot//login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(pop3): /usr/local/libexec/dovecot/pop3-login mail_location: maildir:~/Maildir mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(pop3): /usr/local/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3 auth default: mechanisms: plain login passdb: driver: pam userdb: driver: passwd plugin: sieve: sieve
Looks about right... I have a very similar setup, but i authenticate
to Active Directory via LDAP and it works very good.
If you have or may get more domains i would set up mail_location to
something like this: /home/vmail/%d/%u that way you are ready for
growth and everything is kept organized by domains. Just a thought.
On Apr 17, 2009, at 10:14 AM, Jeff Grossman wrote:
I really want to try and get this plus addressing working correctly
with Dovecot and Postfix. After doing some reading I think I am
going to change my Postfix setup from mailbox_command to
mailbox_transport. I have a few questions to make sure I am
thinking correctly. All of my users are system users. Their mail
is delivered directly to their "/home/<user>/Maildir" directory.
Everything works great and I have no problems. Here is what I am
thinking of doing.
- Create a new vmail user and group.
- Have all mail delivered for each user to the "/home/vmail/ <user>/" directory. All mail will be owned by vmail, but that is okay since Dovecot is the only thing touching the mail files anyway.
- Change the mail_location setting in dovecot.conf to
"mail_location = /home/vmail/%u- Uncomment the auth_socket_path = /var/run/dovecot/auth-master setting in dovecot.conf
- Switch Postfix's main.cf to use "mailbox_transport = dovecot" and put the following line in master.cf:
- dovecot unix - n n - - pipe flags=DR user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient} -n -m ${extension}
- Copy the current users mail to the new vmail location. What is the best way to copy it preserving date and time stamps on the
mail?Did I cover all of the steps are am I missing something? Here is a
copy of my current dovecot -n output. Thanks for any help you can
offer me.# 1.2.rc3: /usr/local/etc/dovecot.conf # OS: Linux 2.6.29-1-amd64 x86_64 Debian squeeze/sid base_dir: /var/run/dovecot/ protocols: imap imaps pop3 pop3s ssl_cert_file: /etc/ssl/certs/ssl.crt ssl_key_file: /etc/ssl/private/ssl.key ssl_cipher_list: ALL:!LOW:!SSLv2 disable_plaintext_auth: no login_dir: /var/run/dovecot//login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(pop3): /usr/local/libexec/dovecot/pop3-login mail_location: maildir:~/Maildir mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(pop3): /usr/local/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3 auth default: mechanisms: plain login passdb: driver: pam userdb: driver: passwd plugin: sieve: sieve
Thank you. I like that suggestion. I will probably do that.
Any recommendation on moving the mail over from the old location to the new location without messing up any of the date/time stamps on the messages? I use maildir format.
On 4/17/2009 8:41 AM, Romer Ventura wrote:
Looks about right... I have a very similar setup, but i authenticate to Active Directory via LDAP and it works very good.
If you have or may get more domains i would set up mail_location to something like this: /home/vmail/%d/%u that way you are ready for growth and everything is kept organized by domains. Just a thought.
On Apr 17, 2009, at 10:14 AM, Jeff Grossman wrote:
I really want to try and get this plus addressing working correctly with Dovecot and Postfix. After doing some reading I think I am going to change my Postfix setup from mailbox_command to mailbox_transport. I have a few questions to make sure I am thinking correctly. All of my users are system users. Their mail is delivered directly to their "/home/<user>/Maildir" directory.
Everything works great and I have no problems. Here is what I am thinking of doing.
- Create a new vmail user and group.
- Have all mail delivered for each user to the "/home/vmail/<user>/" directory. All mail will be owned by vmail, but that is okay since Dovecot is the only thing touching the mail files anyway.
- Change the mail_location setting in dovecot.conf to "mail_location = /home/vmail/%u
- Uncomment the auth_socket_path = /var/run/dovecot/auth-master setting in dovecot.conf
- Switch Postfix's main.cf to use "mailbox_transport = dovecot" and put the following line in master.cf:
- dovecot unix - n n - - pipe flags=DR user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient} -n -m ${extension}
- Copy the current users mail to the new vmail location. What is the best way to copy it preserving date and time stamps on the mail?
Did I cover all of the steps are am I missing something? Here is a copy of my current dovecot -n output. Thanks for any help you can offer me.
# 1.2.rc3: /usr/local/etc/dovecot.conf # OS: Linux 2.6.29-1-amd64 x86_64 Debian squeeze/sid base_dir: /var/run/dovecot/ protocols: imap imaps pop3 pop3s ssl_cert_file: /etc/ssl/certs/ssl.crt ssl_key_file: /etc/ssl/private/ssl.key ssl_cipher_list: ALL:!LOW:!SSLv2 disable_plaintext_auth: no login_dir: /var/run/dovecot//login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(pop3): /usr/local/libexec/dovecot/pop3-login mail_location: maildir:~/Maildir mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(pop3): /usr/local/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3 auth default: mechanisms: plain login passdb: driver: pam userdb: driver: passwd plugin: sieve: sieve
On Apr 17, 2009, at 11:14 AM, Jeff Grossman wrote:
- Have all mail delivered for each user to the "/home/vmail/<user>/" directory. All mail will be owned by vmail, but that is okay since Dovecot is the only thing touching the mail files anyway. ..
- Copy the current users mail to the new vmail location. What is the best way to copy it preserving date and time stamps on the
mail?
cp -a
userdb: driver: passwd
You'll probably want to use userdb static now. Or if deliver needs to
verify that the user exists, use something like:
userdb passwd { args = uid=vmail gid=vmail home=/home/vmail/user/ }
On 4/17/2009 8:46 AM, Timo Sirainen wrote:
On Apr 17, 2009, at 11:14 AM, Jeff Grossman wrote:
- Have all mail delivered for each user to the "/home/vmail/<user>/" directory. All mail will be owned by vmail, but that is okay since Dovecot is the only thing touching the mail files anyway. ..
- Copy the current users mail to the new vmail location. What is the best way to copy it preserving date and time stamps on the mail?
cp -a
userdb: driver: passwd
You'll probably want to use userdb static now. Or if deliver needs to verify that the user exists, use something like:
userdb passwd { args = uid=vmail gid=vmail home=/home/vmail/user/ }
I don't know if deliver would need to know if the user exists. If I decide to go with the example above, would the home directory be /home/vmail/%u or would it be as you entered above?
Also, when I do the cp -a command to copy the mail over, I also need to change all ownership to vmail:vmail, correct?
Thanks for all of your help with this.
Jeff
On Fri, 2009-04-17 at 09:10 -0700, Jeff Grossman wrote:
You'll probably want to use userdb static now. Or if deliver needs to verify that the user exists, use something like:
userdb passwd { args = uid=vmail gid=vmail home=/home/vmail/user/ }
I don't know if deliver would need to know if the user exists. If I decide to go with the example above, would the home directory be /home/vmail/%u or would it be as you entered above?
Oh, sorry, /home/vmail/%u of course.
Also, when I do the cp -a command to copy the mail over, I also need to change all ownership to vmail:vmail, correct?
Right.
On 4/17/2009 9:24 AM, Timo Sirainen wrote:
On Fri, 2009-04-17 at 09:10 -0700, Jeff Grossman wrote:
You'll probably want to use userdb static now. Or if deliver needs to verify that the user exists, use something like:
userdb passwd { args = uid=vmail gid=vmail home=/home/vmail/user/ }
I don't know if deliver would need to know if the user exists. If I decide to go with the example above, would the home directory be /home/vmail/%u or would it be as you entered above?
Oh, sorry, /home/vmail/%u of course.
Also, when I do the cp -a command to copy the mail over, I also need to change all ownership to vmail:vmail, correct?
Right.
Great. Thank you for your help. I think I might try and tackle this in a little bit.
Jeff
On 4/17/2009 8:14 AM, Jeff Grossman wrote:
I really want to try and get this plus addressing working correctly with Dovecot and Postfix. After doing some reading I think I am going to change my Postfix setup from mailbox_command to mailbox_transport.
I have a few questions to make sure I am thinking correctly. All of my users are system users. Their mail is delivered directly to their "/home/<user>/Maildir" directory. Everything works great and I have no problems. Here is what I am thinking of doing.
- Create a new vmail user and group.
- Have all mail delivered for each user to the "/home/vmail/<user>/" directory. All mail will be owned by vmail, but that is okay since Dovecot is the only thing touching the mail files anyway.
- Change the mail_location setting in dovecot.conf to "mail_location = /home/vmail/%u
- Uncomment the auth_socket_path = /var/run/dovecot/auth-master setting in dovecot.conf
- Switch Postfix's main.cf to use "mailbox_transport = dovecot" and put the following line in master.cf:
- dovecot unix - n n - - pipe flags=DR user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient} -n -m ${extension}
- Copy the current users mail to the new vmail location. What is the best way to copy it preserving date and time stamps on the mail?
Did I cover all of the steps are am I missing something? Here is a copy of my current dovecot -n output. Thanks for any help you can offer me. Okay, I made the change to using mailbox_transport instead of mailbox_command in Postfix. I followed the above steps only having to change one thing. Line 5.1 was wrong. I needed it to say "-d ${user}" instead of recipient. It was looking for user@domain instead of just user which is was exists in my userdb file. I decided against putting everything in "/home/vmail/domain/user" because when I would log in via IMAP it didn't know my domain name. I am assuming that is once again because my userdb only has user names and not domains. Just I just went with "/home/vmail/user" and it is working. I don't think I will be using more than one domain, so it should be fine.
Thanks for everybody's help with this. Rather painless. The only problem I had was with the user name but I got it resolved.
Jeff
On 4/17/2009 12:39 PM, Jeff Grossman wrote:
I really want to try and get this plus addressing working correctly with Dovecot and Postfix. After doing some reading I think I am going to change my Postfix setup from mailbox_command to mailbox_transport. I have a few questions to make sure I am thinking correctly. All of my users are system users. Their mail is delivered directly to their "/home/<user>/Maildir" directory.
Everything works great and I have no problems. Here is what I am thinking of doing.
- Create a new vmail user and group.
- Have all mail delivered for each user to the "/home/vmail/<user>/" directory. All mail will be owned by vmail, but that is okay since Dovecot is the only thing touching the mail files anyway.
- Change the mail_location setting in dovecot.conf to "mail_location = /home/vmail/%u
- Uncomment the auth_socket_path = /var/run/dovecot/auth-master setting in dovecot.conf
- Switch Postfix's main.cf to use "mailbox_transport = dovecot" and put the following line in master.cf:
- dovecot unix - n n - - pipe flags=DR user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient} -n -m ${extension}
- Copy the current users mail to the new vmail location. What is the best way to copy it preserving date and time stamps on the mail?
Did I cover all of the steps are am I missing something? Here is a copy of my current dovecot -n output. Thanks for any help you can offer me. Okay, I made the change to using mailbox_transport instead of mailbox_command in Postfix. I followed the above steps only having to change one thing. Line 5.1 was wrong. I needed it to say "-d ${user}" instead of recipient. It was looking for user@domain instead of just user which is was exists in my userdb file. I decided against
On 4/17/2009 8:14 AM, Jeff Grossman wrote: putting everything in "/home/vmail/domain/user" because when I would log in via IMAP it didn't know my domain name. I am assuming that is once again because my userdb only has user names and not domains.
Just I just went with "/home/vmail/user" and it is working. I don't think I will be using more than one domain, so it should be fine.Thanks for everybody's help with this. Rather painless. The only problem I had was with the user name but I got it resolved.
Jeff I have come across my more problem. If somebody sends mail to JEFF instead of jeff it is saying user unknown. How do I tell the pipe command in Postfix to lowercase the username but not the extension?
Thanks, Jeff
On Fri, 2009-04-17 at 13:05 -0700, Jeff Grossman wrote:
I have come across my more problem. If somebody sends mail to JEFF instead of jeff it is saying user unknown. How do I tell the pipe command in Postfix to lowercase the username but not the extension?
You can also do this in Dovecot. For example auth_username_format=%Lu
On 4/17/2009 1:43 PM, Timo Sirainen wrote:
On Fri, 2009-04-17 at 13:05 -0700, Jeff Grossman wrote:
I have come across my more problem. If somebody sends mail to JEFF instead of jeff it is saying user unknown. How do I tell the pipe command in Postfix to lowercase the username but not the extension?
You can also do this in Dovecot. For example auth_username_format=%Lu
I just found that parameter. I just set it and restarted Dovecot.
Going to test it right now.
Thanks.
participants (3)
-
Jeff Grossman
-
Romer Ventura
-
Timo Sirainen