[Dovecot] Using LDA with postfix and virtual users

Chris Cohen kildau-ml at gmx.de
Fri Mar 28 19:50:14 EET 2008


Hi list,

I have 7 virtual users in a sql database. I don't want any systemusers 
or local delivery using postfix.
On the postfix side everything works fine as long as I use the 'local' 
delivery agent. But since I want to use dovecot's sieve functionality I 
set local_transport to dovecot. From now on Postfix seems to ignore 
local_* settings like local_recipient_maps.

Here is my current configuration:
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imaps managesieve
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
mail_privileged_group: mail
mail_location: maildir:/var/mail/%u
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
sieve_storage(default):
sieve_storage(imap):
sieve_storage(managesieve): /var/mail/%u/dovecot/sieve/
sieve(default):
sieve(imap):
sieve(managesieve): /var/mail/%u/.dovecot.sieve
auth default:
  mechanisms: plain login
  verbose: yes
  debug: yes
  debug_passwords: yes
  passdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  userdb:
    driver: static
    args: uid=5000 gid=5000 home=/var/mail/%u
  socket:
    type: listen
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
      user: vmail
      group: vmail
plugin:
  sieve: /var/mail/%u/.dovecot.sieve

And my postfix configuration:
alias_maps = mysql:/etc/postfix/alias_maps-mysql.cf
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
inet_interfaces = all
local_recipient_maps = mysql:/etc/postfix/local_recipients-mysql.cf 
$alias_maps
local_transport = dovecot
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = unixhosts.org
myhostname = amy.unixhosts.org
mynetworks = 127.0.0.0/8
myorigin = $myhostname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
unknown_local_recipient_reject_code = 550

And accourding to the wiki I have:
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f 
${sender} -d ${user}

As soon as I set local_transport to dovecot postfix seems to lookup 
local_recipients using dovecot. And dovecot doesn't know anything about 
my alias table. Heres a small log:

Mar 28 14:49:25 amy postfix/smtpd[4412]: warning: 10.1.32.13: address 
not listed for hostname amy.unixhosts.org
Mar 28 14:49:25 amy postfix/smtpd[4412]: connect from 
unknown[10.1.32.13]
Mar 28 14:49:25 amy postfix/smtpd[4412]: 820D478399: 
client=unknown[10.1.32.13]
Mar 28 14:49:25 amy postfix/cleanup[4415]: 820D478399: 
message-id=<20080328134925.5E3954C444 at zoidberg.unixhosts.org>
Mar 28 14:49:25 amy postfix/qmgr[4410]: 820D478399: 
from=<virtualuser at daisy.unixhosts.org>, size=762, nrcpt=1 (queue 
active)
Mar 28 14:49:25 amy postfix/smtpd[4412]: disconnect from 
unknown[10.1.32.13]
Mar 28 14:49:25 amy dovecot: auth(default): master in: 
USER^I1^Iroot^Iservice=deliver
Mar 28 14:49:25 amy dovecot: auth-worker(default): sql(root): query: 
SELECT password FROM users WHERE username = 'root';
Mar 28 14:49:25 amy dovecot: auth-worker(default): sql(root): unknown 
user
Mar 28 14:49:25 amy dovecot: auth(default): master out: NOTFOUND^I1
Mar 28 14:49:25 amy postfix/pipe[4416]: 820D478399: 
to=<root at daisy.unixhosts.org>, relay=dovecot, delay=0.09, 
delays=0.03/0.02/0/0.04, dsn=5.1.1, status=bounced (user unknown)
Mar 28 14:49:25 amy postfix/cleanup[4415]: 914C978407: 
message-id=<20080328134925.914C978407 at amy.unixhosts.org>
Mar 28 14:49:25 amy postfix/qmgr[4410]: 914C978407: from=<>, size=2516, 
nrcpt=1 (queue active)
Mar 28 14:49:25 amy postfix/bounce[4418]: 820D478399: sender 
non-delivery notification: 914C978407
Mar 28 14:49:25 amy postfix/qmgr[4410]: 820D478399: removed
Mar 28 14:49:25 amy dovecot: auth(default): master in: 
USER^I1^Ivirtualuser^Iservice=deliver
Mar 28 14:49:25 amy dovecot: auth-worker(default): sql(virtualuser): 
query: SELECT password FROM users WHERE username = 'virtualuser';
Mar 28 14:49:25 amy dovecot: auth(default): password(virtualuser): 
Credentials: {CRYPT}{PLAIN-MD5}ebb12eb47da2af187241a0d74fc3d14f
Mar 28 14:49:25 amy dovecot: auth(default): master out: 
USER^I1^Ivirtualuser^Iuid=5000^Igid=5000^Ihome=/var/mail/virtualuser
Mar 28 14:49:25 amy postfix/pipe[4416]: 914C978407: 
to=<virtualuser at daisy.unixhosts.org>, relay=dovecot, delay=0.03, 
delays=0.01/0/0/0.02, dsn=2.0.0, status=sent (delivered via dovecot 
service)
Mar 28 14:49:25 amy postfix/qmgr[4410]: 914C978407: removed

I have already read a lot of documentation, howtos and so on, but just 
can't figure out how to get this to work.

Could someone please give me a hint?

-- 
Greetings
Chris


More information about the dovecot mailing list