[Dovecot] postfix+dovecat: virtual domains with imap+lmtp

el07694 el07694 at mail.ntua.gr
Sat Jun 2 17:52:05 EEST 2012


 Hi to all,

 I have tryed a few days to configure postfix/dovecot to run into a VPS 
 machine (CentOs)
 -->The machine has 2 domains (but more in the future)
 -->i want info at mail.domain1.com and info at mail.domain2.com to be 
 seperated mailboxes
 -->i want to use lmtp protocol to connect dovecot with postfix
 -->It will be perfect if i can use the system users for authentication

 I /etc/postfix/main.cf file looks like this

 smtpd_soft_error_limit = 10
 smtpd_hard_error_limit = 20
 masquerade_domains = mail.going-on.com mail.commundi.de
 masquerade_exceptions = root, papinhio
 relocated_maps = hash:/etc/postfix/relocated
 smtpd_client_restrictions = check_client_access 
 hash:/etc/postfix/access
 virtual_mailbox_domains = mail.going-on.com mail.commundi.de
 virtual_mailbox_base = /var/spool/virtual_hosts
 virtual_mailbox_maps = hash:/etc/postfix/virtual
 virtual_uid_maps = static:0
 virtual_gid_maps = static:0
 mailbox_command = /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a 
 "$RECIPIENT"
 dovecot_destination_recipient_limit = 1
 mailbox_transport = lmtp:unix:private/dovecot-lmtp

 /etc/postfix/relocated file has only comments
 the same for /etc/postfix/access file
 i have made /var/spool/virtual_hosts folder with chmod 777
 inside this folder i have made mail.going-on.com folder and 
 mail.commundi.de folder

 cat /etc/postfix/virtual produce this:
 papinhio at mail.going-on.com mail.going-on.com/papinhio

 papinhio is a system_user!!

 uid,gid = 0 (the root user)

 master.cf file


 #
 # Postfix master process configuration file.  For details on the format
 # of the file, see the master(5) manual page (command: "man 5 master").
 #
 # 
 ==========================================================================
 # service type  private unpriv  chroot  wakeup  maxproc command + args
 #               (yes)   (yes)   (yes)   (never) (100)
 # 
 ==========================================================================
 smtp      inet  n       -       n       -       -       smtpd
 submission inet n       -       n       -       -       smtpd
   -o smtpd_enforce_tls=yes
   -o smtpd_sasl_auth_enable=yes
   -o smtpd_sasl_type=dovecot
   -o smtpd_sasl_path=private/auth
   -o smtpd_sasl_security_options=noanonymous
   -o smtpd_sasl_local_domain=$myhostname
   -o smtpd_client_restrictions=permit_sasl_authenticated,reject
   -o smtpd_sender_login_maps=hash:/etc/postfix/virtual
 pickup    fifo  n       -       -       60      1       pickup
 cleanup   unix  n       -       -       -       0       cleanup
 qmgr      fifo  n       -       n       300     1       qmgr
 #qmgr     fifo  n       -       n       300     1       oqmgr
 tlsmgr    unix  -       -       n       1000?   1       tlsmgr
 rewrite   unix  -       -       n       -       -       trivial-rewrite
 bounce    unix  -       -       n       -       0       bounce
 defer     unix  -       -       n       -       0       bounce
 trace     unix  -       -       n       -       0       bounce
 verify    unix  -       -       n       -       1       verify
 flush     unix  n       -       n       1000?   0       flush
 proxymap  unix  -       -       n       -       -       proxymap
 smtp      unix  -       -       n       -       -       smtp

 relay     unix  -       -       n       -       -       smtp
         -o fallback_relay=

 showq     unix  n       -       n       -       -       showq
 error     unix  -       -       n       -       -       error
 discard   unix  -       -       n       -       -       discard
 local     unix  -       n       n       -       -       local
 virtual   unix  -       n       n       -       -       virtual
 lmtp      unix  -       -       n       -       -       lmtp
 anvil     unix  -       -       n       -       1       anvil
 scache    unix  -       -       n       -       1       scache


 maildrop  unix  -       n       n       -       -       pipe
   flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
 #
 # The Cyrus deliver program has changed incompatibly, multiple times.
 #
 old-cyrus unix  -       n       n       -       -       pipe
   flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m 
 ${extension} ${user}
 # Cyrus 2.1.5 (Amos Gouaux)
 # Also specify in main.cf: cyrus_destination_recipient_limit=1
 cyrus     unix  -       n       n       -       -       pipe
   user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m 
 ${extension} ${user}
 #
 # See the Postfix UUCP_README file for configuration details.
 #
 uucp      unix  -       n       n       -       -       pipe
   flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail 
 ($recipient)

 ifmail    unix  -       n       n       -       -       pipe
   flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
 bsmtp     unix  -       n       n       -       -       pipe
   flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop 
 $recipient
 dovecot   unix  -       n       n       -       -       pipe
   flags=DRhu user=root:root argv=/usr/local/libexec/dovecot/dovecot-lda 
 -f ${sender} -d ${recipient}




 Ok, the /etc/dovecot/dovecot.conf file looks like this:

 !include conf.d/*.conf
 !include_try local.conf

 protocols = imap lmtp
 service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0660
    user = postfix
   }
 }


 protocol lmtp {
   mail_plugins = quota sieve
 }



 mail_location = mbox:/var/spool/virtual_hosts/%d/%n


 Both of the services can start this no errors/warnings
 I can send mail from bash with this command : /bin/mail -s "Hello" 
 "el07694 at mail.ntua.gr" < /etc/dovecot/dovecot.conf

 Can anyone help me, plz?
 I don't know what i do wrong

 Thanks in advance,
 Chris Pappas





More information about the dovecot mailing list