Communication between containers (programm call into another container)?

Hi there,

i have been toying around with docker for about two weeks now and learned a few things down the road.

My goal is to recreate my current email server environment (running on a raspberry pi), as a docker environment (composition).
I have learned that with docker every process should reside in it’s own container.
This means for my project, I would need to create four containers (getmail, exim, dovecot, spamassassin).

I am using getmail to receive mails from my Mailprovider(higher availability + no hassle with setup and maintenance) and exim for receiving Emails that do not need to go outside of my LAN (like scan to mail or smth.). Dovecot to access my Maildir/Inboxes and spamassassin, well for handling spam…

So far I have learned that the most used connections from a container to the host are either via the network (and exposed sockets) or via mounted volumes.

But for my docker mail setup, the getmail container would need to call a the dovecot-lda directly for delivering new mail to the maildir (and running sieve filters on it):


[destination]
type = MDA_external
path = /usr/libexec/dovecot/dovecot-lda
arguments = ("-e",)
user = vmail

Likewise exim should deliver mail to the dovecot-lda:

dovecot_pipe:
  debug_print = "T: maildrop_pipe for $local_part@$domain"
  driver = pipe

  # You may or may not want to add -d $local_part@$domain depending on if you need a userdb lookup done.
  command = /usr/libexec/dovecot/dovecot-lda -f $sender_address

  message_prefix =
  message_suffix =
  log_output
  delivery_date_add
  envelope_to_add
  return_path_add
  #group = mail
  #mode = 0660
  temp_errors = 64 : 69 : 70: 71 : 72 : 73 : 74 : 75 : 78

But since these processes reside in different containers I believe this is not possible without specific configuration (if at all)?

Is there an easy way of implementing the desired behaviour ?

kind regards
steve