[Dovecot] Problem with Dovecot LDA / Postfix
Dominique Feyer
dfeyer at net4all.ch
Fri Jun 16 16:11:47 EEST 2006
The only difference with our setup is that we use unique UID/GID per
domain (stored in a postgresql database). So I need the LDA setuid.
Le vendredi 16 juin 2006 à 16:04 +0300, Dumitru Negara a écrit :
> Hi,
>
> Dominique Feyer wrote:
> > Our setup is ok with Postfix / Dovecot.
> >
> > I just need to add dovecot LDA.
> >
> > I use the 1.0beta9
> >
> > LDA Configuration:
> >
> > protocol lda {
> > postmaster_address = postmaster at clm.net4all.ch
> > #hostname =
> > #mail_plugins =
> > #mail_plugin_dir = /usr/lib/dovecot/imap
> > #sendmail_path = /usr/lib/sendmail
> > auth_socket_path = /var/run/dovecot/auth-master
> > }
> > auth default-socket {
> > mechanisms = plain login
> > passdb sql {
> > args = /usr/local/dovecot-1.0-beta9/etc/dovecot-pgsql.conf
> > }
> > userdb sql {
> > args = /usr/local/dovecot-1.0-beta8/etc/dovecot-pgsql.conf
> > }
> > socket listen {
> > master {
> > path = /var/run/dovecot/auth-master
> > mode = 0660
> > user = vmail
> > group = mail
> > }
> > }
> > user = dovecot
> > count = 1
> > }
> >
> > Postfix configuration, like the dovecot LDA wiki page
> >
> > Master.cf:
> > dovecot unix - n n - - pipe
> > flags=DRhu user=mail:mail
> > argv=/usr/local/dovecot-1.0-beta9/libexec/dovecot/deliver -d
> > ${recipient}
> >
> > Main.cf
> > default_destination_recipient_limit = 1
> >
> > Log:
> >
> > Jun 15 19:15:43 mail2 postfix/qmgr[4226]: 31FA27FF2:
> > from=<root at localhost.localdomain>, size=343, nrcpt=1 (queue active)
> > Jun 15 19:15:43 mail2 dovecot: auth(default-socket): master in:
> > USER^I1^Iinfo at lda.net4all.ch^Iservice=deliver
> > Jun 15 19:15:43 mail2 dovecot: auth(default-socket):
> > sql(info at lda.net4all.ch): SELECT '/var/spool/mail/'||home AS home, uid,
> > gid FROM users WHERE userid = 'info at lda.net4all.ch'
> > Jun 15 19:15:43 mail2 dovecot: auth(default-socket): master out:
> > USER^I1^Iinfo at lda.net4all.ch^Ihome=/var/spool/mail/lda.net4all.ch/mails/info^Iuid=1999^Igid=1999
> > Jun 15 19:15:43 mail2 dovecot: auth(default-socket):
> > Jun 15 19:15:43 mail2 postfix/pipe[4314]: 31FA27FF2:
> > to=<info at lda.net4all.ch>, relay=dovecot, delay=0, status=bounced
> > (Command died with status 89:
> > "/usr/local/dovecot-1.0-beta9/libexec/dovecot/deliver")
> >
> > The status 89 is for default error ... so no more informations with
> > this.
> >
> > Permision on deliver is setuid (we use a different UID per domain)
> > mail2:/etc/dovecot#
> > stat /usr/local/dovecot-1.0-beta9/libexec/dovecot/deliver
> > File: `/usr/local/dovecot-1.0-beta9/libexec/dovecot/deliver'
> > Size: 2507575 Blocks: 4912 IO Block: 4096 fichier
> > r�gulier
> > Device: 805h/2053d Inode: 65010 Links: 1
> > Access: (6755/-rwsr-sr-x) Uid: ( 0/ root) Gid: ( 0/ root)
> > Access: 2006-06-15 19:15:43.314434576 +0200
> > Modify: 2006-06-15 13:46:15.000000000 +0200
> > Change: 2006-06-15 19:18:32.821665560 +0200
> >
> > Can anyone help me ? Thanks,
> >
>
> This settings works for me.
>
> ============= dovecot.conf: =================
> protocols = imap pop3 pop3s
> ssl_cert_file = /etc/dovecot/tls/mydomai.tld.cert
> ssl_key_file = /etc/dovecot/tls/mydomain.tld.key
> log_timestamp = "%Y-%m-%d %H:%M:%S "
> first_valid_uid = 111 #vmail user uid
> first_valid_gid = 111 #vmail group gid
> mail_extra_groups = mail
> default_mail_env = maildir:/space/vmail/%d/%n
> protocol imap {
> }
> protocol pop3 {
> pop3_uidl_format = %08Xv%08Xu
> }
> protocol lda {
> postmaster_address = postmaster at mydomain.tld
> auth_socket_path = /var/run/dovecot/dovecot-auth-master
> }
> auth default {
> mechanisms = plain
> socket listen {
> master {
> path = /var/run/dovecot/dovecot-auth-master
> mode = 0660
> user = vmail # User running Dovecot LDA
> group = mail # Or alternatively mode 0660 + LDA user in this group
> }
> }
> passdb pam {
> }
> passdb sql {
> args = /etc/dovecot/dovecot-sql.conf
> }
> userdb passwd {
> }
> userdb sql {
> args = /etc/dovecot/dovecot-sql.conf
> }
> user = root
> }
> plugin {
> }
> ============= dovecot.conf: =================
>
> ============= dovecot-sql.conf =================
> driver = mysql
> connect = host=127.0.0.1 port=3306 dbname=postfix user=postfix
> password=secret client_flags=0
> default_pass_scheme = PLAIN
> password_query = SELECT password FROM mailbox WHERE username = '%u'
> #maildir is "mydomain.tld/username"
> user_query = SELECT maildir, CONCAT('/space/vmail/',maildir) AS home,
> 111 AS uid, 111 AS gid FROM mailbox WHERE username = '%u'
> ============= dovecot-sql.conf =================
>
>
> ============= postfix/main.cf ================
> ...
> virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
> virtual_gid_maps = static:111
> virtual_mailbox_base = /space/vmail
> virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
> virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
> virtual_minimum_uid = 111
> virtual_uid_maps = static:111
> #virtual_transport = virtual
> virtual_transport = dovecot
> dovecot_destination_recipient_limit = 1
> ...
> ============= postfix/main.cf ================
>
> ============= postfix/master.cf ================
> ...
> # Dovecot LDA
> dovecot unix - n n - - pipe
> flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
> ...
> ============= postfix/master.cf ================
>
>
> # ls -al /space/|grep vmail
> drwxrwx--- 3 vmail vmail 4096 2006-05-10 17:50 vmail
>
> # ls -al /space/vmail
> total 12
> drwxrwx--- 3 vmail vmail 4096 2006-05-10 17:50 .
> drwxr-xr-x 7 root root 4096 2006-06-06 10:35 ..
> drwxrwx--- 7 vmail vmail 4096 2006-06-09 16:26 mydomain.tld
>
> Regards,
> Dumitru
--
Dominique Feyer
Administrateur Système
Ch. de la Colline 5bis
CH-1007 Lausanne
dfeyer at net4all.ch
More information about the dovecot
mailing list