GithubHelp home page GithubHelp logo

docker-postfix's Introduction

Postfix

This repository is a docker image for postfix.

Build and Run

Start the server:

docker build . -t postfix
docker run --rm --name pf postfix

Start a shell inside the container:

docker exec -it pf bash

Users

List of users created in this container

vmail

uid=5000 gid=5000 groups=mail

postfix

uid=101 gid=102 groups=postfix

Environment Variable

POSTFIX_CONFIG_MAIN_CF

The content of this variable will overwrite everything in /etc/postfix/main.cf.

POSTFIX_CONFIG_MASTER_CF

The content of this variable will overwrite everything in /etc/postfix/master.cf.

POSTFIX_VIRTUAL_MAILBOX_DOMAINS_CF

The content of this variable will overwrite everything in /etc/postfix/virtual_mailbox_domains.cf

POSTFIX_VIRTUAL_MAILBOX_MAPS_CF

The content of this variable will overwrite everything in /etc/postfix/virtual_mailbox_maps.cf

POSTFIX_VIRTUAL_ALIAS_MAPS_CF

The content of this variable will overwrite everything in /etc/postfix/virtual_alias_maps.cf

Example

Docker Compose

version: '3'
services:
  postfix:
    build: .
    ports:
      - 25:25
      - 465:465
      - 587:587
    environment:
      POSTFIX_CONFIG_MAIN_CF: |
        smtpd_banner = $$myhostname ESMTP $$mail_name (Debian/GNU)
        biff = no
        append_dot_mydomain = no
        readme_directory = no
        compatibility_level = 2
        smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
        smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
        smtpd_use_tls=yes
        smtpd_tls_session_cache_database = btree:$${data_directory}/smtpd_scache
        smtp_tls_session_cache_database = btree:$${data_directory}/smtp_scache
        smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
        myhostname = postfix
        alias_maps = hash:/etc/aliases
        alias_database = hash:/etc/aliases
        mydestination = $$myhostname, /etc/mailname, 9bd7189230cb, localhost.localdomain, localhost
        relayhost =
        mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
        mailbox_size_limit = 0
        recipient_delimiter = +
        inet_interfaces = all
        inet_protocols = all

      POSTFIX_CONFIG_MASTER_CF: |
        smtp      inet  n       -       y       -       -       smtpd
        pickup    unix  n       -       y       60      1       pickup
        cleanup   unix  n       -       y       -       0       cleanup
        qmgr      unix  n       -       n       300     1       qmgr
        tlsmgr    unix  -       -       y       1000?   1       tlsmgr
        rewrite   unix  -       -       y       -       -       trivial-rewrite
        bounce    unix  -       -       y       -       0       bounce
        defer     unix  -       -       y       -       0       bounce
        trace     unix  -       -       y       -       0       bounce
        verify    unix  -       -       y       -       1       verify
        flush     unix  n       -       y       1000?   0       flush
        proxymap  unix  -       -       n       -       -       proxymap
        proxywrite unix -       -       n       -       1       proxymap
        smtp      unix  -       -       y       -       -       smtp
        relay     unix  -       -       y       -       -       smtp
        showq     unix  n       -       y       -       -       showq
        error     unix  -       -       y       -       -       error
        retry     unix  -       -       y       -       -       error
        discard   unix  -       -       y       -       -       discard
        local     unix  -       n       n       -       -       local
        virtual   unix  -       n       n       -       -       virtual
        lmtp      unix  -       -       y       -       -       lmtp
        anvil     unix  -       -       y       -       1       anvil
        scache    unix  -       -       y       -       1       scache
        maildrop  unix  -       n       n       -       -       pipe
          flags=DRhu user=vmail argv=/usr/bin/maildrop -d $${recipient}
        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=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$$nexthop -f$$sender $$recipient
        scalemail-backend unix	-	n	n	-	2	pipe
          flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store $${nexthop} $${user} $${extension}
        mailman   unix  -       n       n       -       -       pipe
          flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
          $${nexthop} $${user}

docker-postfix's People

Contributors

nvanheuverzwijn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.