How connect Dovecot with Postfix in docker-compose

0

I made mail server with this tutorial.

Everything works, but I want to put mysql, postfix and dovecot in containers. I used mysql image. I made Postfix container for my own.

I have no problem with connect to mysql database from postfix container.

Problem is with connect Postfix and Dovecot

In /etc/postfix/main.cf:

virtual_transport = lmtp:unix:private/dovecot-lmtp

In /etc/dovecot/conf.d/10-master.conf

service lmtp {
   unix_listener /var/spool/postfix/private/dovecot-lmtp {
       mode = 0600
       user = postfix
       group = postfix
   }
  #inet_listener lmtp {
    # Avoid making LMTP visible for the entire internet
    #address =
    #port =
  #}
} 

When I am running Dovecot container I see OUTPUT: Fatal: service(lmtp) User doesn't exist: postfix (See service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { user } } setting)

How change configuration to made able to connect Postfix with Dovecot?

gongarek

Posted 2019-09-24T16:23:46.980

Reputation: 135

Answers

0

I've setup something similar.

The relevent documentation is here; https://wiki2.dovecot.org/HowTo/PostfixAndDovecotSASL

I've had no joy using the MDA's hostname to connect to it's container, so give dovecot a static ip.

you want dovecot to listen for lmtp connections over ip so you want that bit uncommented. And I found it doesnt work if you leave the config for the unix socket in there, which doesn't matter as it sounds like you dont want it anyway :)

/etc/dovecot/conf.d/10-master.conf

service lmtp {
  inet_listener lmtp {
    port = 24
  }
}

/etc/postfix/main.cf

virtual_transport = lmtp:inet:127.20.0.201:24

I also reference it in /etc/postfix/master.cf, but then you dont seem to be using dovecot for auth so you might not need to set it there.

Also note, that lmtp isnt encrypted or anything, so maybe think about giving postfix and dovecot their own bridge for this.

Rob

Posted 2019-09-24T16:23:46.980

Reputation: 1