[Dovecot] "Real" users AND Virtual users
Dear all, How can I use dovecot for both "real" users and virtual users?
I could configure dovecot for real users, by using these lines in /etc/dovecot.conf: default_mail_env = maildir:%h/Maildir auth default { passdb pam { } userdb passwd { } }
To accept virtual users, I used these lines: default_mail_env = maildir:/usr/local/virtual/%u/ auth default { passdb sql { args = /etc/dovecot-mysql.conf } userdb sql { args = /etc/dovecot-mysql.conf } }
But, again, how to accept both kind of users? I use Postfix as mail server, and use LDAP/PAM for real users that have home-directory on the system. My OS is Mandriva 2007, and I use dovecot that is bundled as an RPM package (dovecot 1.9 rc7) in the OS. The content of file /etc/pam.d/dovecot: #%PAM-1.0 auth required pam_stack.so service=system-auth account required pam_stack.so service=system-auth
Thanks.
Regards, Muhamad
----- Muhamad A. Martoprawiro muhamad@chem.itb.ac.id wrote:
My OS is Mandriva 2007, and I use dovecot that is bundled as an RPM package (dovecot 1.9 rc7) in the OS.
Sorry, I mean dovecot 1.0 rc7
Muhamad
* On 25/10/06 01:38 +0700, Muhamad A. Martoprawiro wrote:
| Dear all,
| How can I use dovecot for both "real" users and virtual users?
|
| I could configure dovecot for real users, by using these lines
| in /etc/dovecot.conf:
| default_mail_env = maildir:%h/Maildir
| auth default {
| passdb pam {
| }
| userdb passwd {
| }
| }
|
| To accept virtual users, I used these lines:
| default_mail_env = maildir:/usr/local/virtual/%u/
| auth default {
| passdb sql {
| args = /etc/dovecot-mysql.conf
| }
| userdb sql {
| args = /etc/dovecot-mysql.conf
| }
| }
|
| But, again, how to accept both kind of users?
Use something like this (I use FreeBSD, hence master.passwd):
passdb pam {
args = *
}
userdb passwd {
args = /etc/master.passwd
}
passdb sql {
args = /etc/dovecot-mysql.conf
}
userdb sql {
args = /etc/dovecot-mysql.conf
}
If the 1st option fails, Dovecot tries the alternative, IIRC.
[snip irrelevant stuff]
-Wash
http://www.netmeister.org/news/learn2quote.html
DISCLAIMER: See http://www.wananchi.com/bms/terms.php
--
+======================================================================+
|\ _,,,---,,_ | Odhiambo Washington
----- Odhiambo WASHINGTON odhiambo.raburu@wananchi.com wrote:
Use something like this (I use FreeBSD, hence master.passwd):
passdb pam { args = * } userdb passwd { args = /etc/master.passwd } passdb sql { args = /etc/dovecot-mysql.conf } userdb sql { args = /etc/dovecot-mysql.conf }
Thanks a lot, Wash. So, now I can login as real users as well as virtual users. However, there is still a problem with the mailboxes.
If I use the following in dovecot.conf:
default_mail_env = maildir:%h/Maildir default_mail_env = maildir:/usr/local/virtual/%u/
I can not access mails in real users' mailbox, only virtual users can. If I commented the second line:
default_mail_env = maildir:%h/Maildir # default_mail_env = maildir:/usr/local/virtual/%u/
I can access mails in real users mailbox (for example, via Squirrelmail), but I cannot access virtual users' mail.
Can anyone help me?
Thanks.
Muhamad
Great! Real users with account on the system can login to Squirrelmail with his loginname (without @) & password, and virtual users (from different domains) can also use Squirrelmail with login-name: hisname@domain.tld.
Both can read their mails, send, reply ..
Thanks a lot. 'Terima kasih' (lang: id)
With best wishes for Dovecot, .. :-) Muhamad
----- Timo Sirainen tss@iki.fi wrote:
On 25.10.2006, at 14.00, Muhamad A. Martoprawiro wrote:
default_mail_env = maildir:%h/Maildir
Keep this.
default_mail_env = maildir:/usr/local/virtual/%u/
And in dovecot-mysql.conf do this:
user_query = SELECT 'maildir:/usr/local/virtual/%u/' as mail, .. the rest ..
On Wed, Oct 25, 2006 at 01:38:51AM +0700, Muhamad A. Martoprawiro may have written:
But, again, how to accept both kind of users? I use Postfix as mail server, and use LDAP/PAM for real users that have home-directory on the system.
Why not make your virtual users LDAP users also? The objectClass posixAccount is what makes a user a system user by default, so just leave that out of your virtual users. I force the uid and gid to a certain user called "vmail" which has no shell and no login privileges. This user then keeps all the homedirs and Maildirs for my virtual users.
This seems far simpler than trying to manage users in both mysql and ldap.
Enjoy,
http://www.delink.net/ "It's almost like there's a record full of incomprehensible bullshit playing in your mind 24/7, and you put the needle down randomly and whatever it picks up, you just type it up in an email and shoot it off to me, usually mid-sentence." - Red Drag Diva in the monastery
participants (4)
-
Brian T Glenn
-
Muhamad A. Martoprawiro
-
Odhiambo WASHINGTON
-
Timo Sirainen