[SOLVED] Dovecot - password file for virtual email users
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi
I have postfix set up for virtual users ie email users with no system id or system password. I need to associate passwords to these virtual users (who are on a different domain) so I can access their respective email boxes via webmail (squirrelmail) and POP. I will not be using authentication, just plain text for login. The dovecot documentation is not clear to me....do I use the userdb or the passdb file....or?
Also, there is no 'vmail' user, only a dovecot user in /etc/passwd and a dovecot group in /etc/group
This is all I have in /etc/dovecot.conf ie all the rest in between is commented out:
Thanks; have not worked it out as yet. My Dovecot Version 1.0.7 authenticates system users whose respective INBOXes reside under /var/spool/mail
I am trying to setup (new) virtual users in a subdirectory of /var/spool/mail
I just cant get both the existing system users and the new virtual users, working at the same time. Squirrelmail's vlogin plugin provides the web log in interface
Here is the code:
Code:
passdb passwd-file {
args = /etc/dovecot_passdb
}
# if not found, fallback to pam (looks for system users in /etc/passwd) <---this bit is the same as original
passdb pam {
}
# look up the virtual users first
# refer http://wiki.dovecot.org/AuthDatabase/Passwd
# also http://wiki.dovecot.org/UserDatabase -->advises that user and password
#databases may be the same (which is what I have done here)
# this is where I am lost
#userdb static {
# or userdb passwd-file {
# args = uid=5000 gid=5000 home=/var/spool/mail/virtual/%n
#}
# if not found, fallback to /etc/passwd <---this bit the same as original
userdb passwd {
args = /etc/passwd
}
#begin insert in dovecot.conf
#dovecot -n -->shows I am using dovecot version 1.0.7 ie relatively old
#this file can be anyname or location, as long as correctly referenced
# it contains the passwords for users referenced in userdb
# passwd-file is the simplest type, and the same structure as /etc/passwd
#reference: http://wiki.dovecot.org/PasswordDatabase
# and http://wiki.dovecot.org/AuthDatabase
# note that form in use here is user@myvirtualdomain.com.au:{PLAIN}myplaintextpassword
# without the user@domain format, the ./virtual/%d/%n format in userdb below will not work
passdb passwd-file {
args = /etc/dovecot_passdb
}
# if not found, fallback to pam (looks for system users in /etc/passwd) <---this bit the same as original
passdb pam {
}
# check the system user's email first, as per:
# http://www.lunch.org.uk/wiki/virtualmailboxeswitheximanddovecot
userdb passwd {
args = /etc/passwd
}
# then check the virtual users via userdb:
# refer http://wiki.dovecot.org/AuthDatabase/Passwd
# also http://wiki.dovecot.org/UserDatabase
# also http://wiki.dovecot.org/VirtualUsers
# and http://wiki.dovecot.org/MailLocation for mail location config
# in my setup, virtual users are located in /var/spool/mail/virtual
# therefore, in /etc/postfix/main.cf we have e.g. virtual_mailbox_domains = myvirtualdomain.com (ie the domain in question) and you # must also create myvirtualdomain.com as a <dir> under /var/spool/mail/virtual with permissions 5000:5000
# also /etc/postfix/main.cf must have: virtual_mailbox_base = /var/spool/mail/virtual
# also /etc/postfix/vmailbox must reference the mailbox location for each user eg 'myvirtualdomain.com/info/mail/inbox'
userdb static {
args = uid=5000 gid=5000 home=/var/spool/mail/virtual/%d/%n mail=mbox:~/mail:INBOX=/var/spool/mail/virtual/%d/%n/mail/inbox
}
# note there is no 'userdb' file in this config
# args = uid=5000 gid=5000 home=/var/spool/mail/virtual/%d/%n # also works ie without the mail=mbox:~/mail:INBOX= ... etc stuff... # ie autodetected
# %d and #n do not work in postfix
# I am using mbox format, not Maildir format, as that is the simplest
# uid 5000 and gid 5000 correspond with postfix, but there is really no corresponding user or group
#restart dovecot afterwards ie /etc/init.d/dovecot restart
#end insert
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.