Cannot use dovecot with vpopmail and sendmail

Matthias Fechner idefix at fechner.net
Thu Aug 14 22:18:28 UTC 2014


Hi,

I setup a configuration that will use sendmail with dovecot as imap/pop3
service and vpopmail as backend to handle virtual users and store email
there.

For this I created a dovecot.m4 as described in the wiki, it looks like:
######################*****##############
###   DOVECOT Mailer specification                              ###
##################*****##################
Mdovecot,       P=/usr/local/libexec/dovecot/dovecot-lda,
                F=l59DFMPhnu,
                S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrFromSMTP,
                M=51200000,
                U=vpopmail:vchkpw,
                T=DNS/RFC822/X-Unix,
                A=/usr/local/libexec/dovecot/dovecot-lda -d $u

Then I added to my .mc file:
MAILER(dovecot)

I added to my mailertable:
dovecot.fechner.net     dovecot:dovecot

I create one entry in the virtusertable to catch a email and forward it
to dovecot (all other email have to handled by another imap server till
dovecot is running fine):
dovecot at fechner.net     idefix at dovecot.fechner.net

I created a domain and a user in vpopmail to catch
idefix at dovecot.fechner.net.

If I execute:
doveadm auth test idefix at dovecot.fechner.net
Password:
passdb: idefix at dovecot.fechner.net auth succeeded
extra fields:
  user=idefix at dovecot.fechner.net

So I think the first part is fine.

But if I try to sent an email to dovecot at fechner.net I get the error
message:
Aug 14 21:48:34 anny dovecot: lda(idefix at dovecot.fechner.net): Fatal:
setuid(89(vpopmail) from userdb lookup) failed with euid=1002(idefix):
Operation not permitted (This binary should probably be called with
process user set to 89(vpopmail) instead of 1002(idefix))
Aug 14 21:48:34 anny sendmail[94303]: s7EJXgma087740:
to=<dovecot at fechner.net>, ctladdr=<idefix at anny.lostinspace.de> (1002/0),
delay=00:14:52, xdelay=00:00:00, mailer=dovecot, pri=120389,
relay=dovecot, dsn=4.0.0, stat=Deferred: dovecot mailer
(/usr/local/libexec/dovecot/dovecot-lda) exited with EX_TEMPFAIL

It seems to be a problem with dovecot-lda but I have no idea what is
wrong. The user is set in the .m4 file and permission/group/user is set
in the auth socket correctly.

The output of doveconf -n is:
# 2.2.13: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 10.0-STABLE amd64  zfs
auth_debug_passwords = yes
auth_mechanisms = plain login
auth_verbose = yes
first_valid_uid = 10
mail_debug = yes
mail_location = maildir:/usr/local/vpopmail/domains/%d/%n/Maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date ihave duplicate
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  args = cache_key=%u%r%l webmail=127.0.0.1
  driver = vpopmail
}
service auth-worker {
  unix_listener auth-worker {
    group = vchkpw
    user = vpopmail
  }
}
service auth {
  unix_listener auth-userdb {
    group = vchkpw
    mode = 0666
    user = vpopmail
  }
  user = vpopmail
}
service imap-login {
  inet_listener imap {
    port = 22143
  }
  inet_listener imaps {
    port = 22993
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 22110
  }
  inet_listener pop3s {
    port = 22995
  }
}
userdb {
  args = quota_template=quota_rule=*:backend=%q
  driver = vpopmail
}

Thanks for any ideas who this could be fixed.

Matthias

-- 

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook


More information about the dovecot mailing list