Public | Automated Build

Last pushed: 2 months ago
Short Description
Internal mail relay forwarding to Amazon SES
Full Description


Mail gateway using Amazon SES

This is the docker image build for my internal mail relay service, using postfix. It has been customized to use Amazon SES, per


  1. Either:
    a. name your container's hostname, as postfix will set its myhostname var with that. Docker switch "--hostname"
    b. set env variable "myhostname" to the hostname you want your mail relay to know itself by

  2. Set env variable "mynetworks" to the appropriate string representing subnets to allow mail from. If not set, the default, which will work for localhost and other docker containers, is:

     mynetworks =,
  3. Map your sasl_passwd file to /etc/postfix/sasl_passwd. The contents should contain your amazon credentials and look something like:

     []:587 AKIAIZY3D2SA6JSCSEBQ:AusMuXwQcquQN19UQ8MJXdAifFi/LRLivx2j3IrU8r9I

Sample Run:

docker run -d \
        --name mailrelay \
        --restart on-failure \
        -p -p \
        --hostname mailrelay \
        -e \
        -e mynetworks=",," \
        -v /root/dockerfiles/sasl_passwd:/etc/postfix/sasl_passwd \
Docker Pull Command
Source Repository