LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 03-05-2013, 07:41 PM   #1
compused
Member
 
Registered: Oct 2006
Location: Melbourne Australia
Distribution: centos and redhat 8
Posts: 91

Rep: Reputation: 15
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

Last edited by compused; 03-13-2013 at 04:16 AM.
 
Old 03-06-2013, 04:56 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
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
 
Old 03-12-2013, 08:02 AM   #3
compused
Member
 
Registered: Oct 2006
Location: Melbourne Australia
Distribution: centos and redhat 8
Posts: 91

Original Poster
Rep: Reputation: 15
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?
 
Old 03-13-2013, 03:58 AM   #4
compused
Member
 
Registered: Oct 2006
Location: Melbourne Australia
Distribution: centos and redhat 8
Posts: 91

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Exim + Dovecot + virtual users on Centos Rafael25 Linux - Software 1 08-12-2012 12:37 AM
Postfix + Dovecot + virtual users without a database? MheAd Linux - Server 6 10-18-2011 08:45 AM
create postfix virtual users without dovecot obayda86 Linux - Server 1 05-29-2010 10:41 AM
postfix, dovecot, mysql virtual users problem chrismottershead Linux - Server 1 01-04-2010 07:29 AM
!!!!!!!!!!!!!!!virtual users config in dovecot !!!!!!!!!!!!!!!!! lasantha Linux - Server 3 01-16-2008 05:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration