Skip to content

Multi-domain Mailgun configuration #922

@crazystick

Description

@crazystick

The AWS SES settings work well for a single domain using Mailgun to relay email. However for a multi-domain setup it isn't quite enough, as we want to authenticate as different users depending on the sender's domain.

The configuration is described well in this forum post.

From looking at the code, it looks like this will need code adding in start-mailserver.sh#_setup_dovecot_local_user() and in check-for-changes,sh and a new function along the lines of start-mailserver.sh#_setup_postfix_relay_amazon_ses()

I'm happy to have a go at this so here's my plan:

  • maintain another file postfix-sasl-password.cf to provide the multiple username passwords
  • add extra env variables:
    • MULTI_DOMAIN_RELAY_HOST
    • MULTI_DOMAIN_RELAY_PORT
    • MULTI_DOMAIN_RELAY_DEFAULT_USER
    • MULTI_DOMAIN_RELAY_DEFAULT_PASSWORD
  • update relayhost_map file at startup and on changes
  • (bonus) add a function to setup.sh which creates/updates postfix-sasl-password.cf

A couple of thoughts/questions:

  1. Relay passwords will be stored in plain text in config/postfix-sasl-password.cf (I guess it's not really worse than the current solution which needs the password in the docker-compose.yml or in .env)
  2. MULTI_DOMAIN_RELAY_HOST and AWS_SES_HOST can't both be true - can this merely be documented in README?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions