LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Dovecot - password file for virtual email users (https://www.linuxquestions.org/questions/linux-software-2/dovecot-password-file-for-virtual-email-users-4175452868/)

compused 03-05-2013 07:41 PM

Dovecot - password file for virtual email users
 
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:
Code:

protocols = imap imaps pop3 pop3s

disable_plaintext_auth = no

protocol imap {
}
 
protocol pop3 {

}

protocol lda {
}

auth default {
mechanisms = plain
}

passdb pam {
}


  userdb passwd {
  }

  user = root

dict {

}

plugin {

}

Thanks
Compfused

jlinkels 03-06-2013 04:56 PM

This is the best guide I ever found for virtual mail:
http://workaround.org/ispmail/squeeze

The package install procedures are for Debian and don't apply to you, but I trust you understand how to install packages.

jlinkels

compused 03-12-2013 08:02 AM

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
}

In dovecot_passdb I have:
Code:

user:{PLAIN}Mypassword
How can I fix this?

compused 03-13-2013 03:58 AM

I have [SOLVED] it. In /etc/dovecot.conf:
Code:

#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



All times are GMT -5. The time now is 10:38 AM.