Giter VIP home page Giter VIP logo

altlinux-mailman-docker's Introduction

altlinux-docker-mailman

Simple Mailman 2.x docker image with SMTP authentication and multiple domain support.

It also includes rsyslog to enable logging.

I took some ideas and code from docker-postfix image.

Build instructions

Clone this repo and then:

cd altlinux-docker-mailman
sudo docker build -t alt-mailman .

How to run it

The following env variables need to be passed to the container:

  • CUSTOM_POSTFIX (Optional, Default value: unset) Use provided postfix configuration and skip all configuration steps
  • SMTP_SERVER Server address of the SMTP server to use (relay).
  • SERVER_HOSTNAME Server hostname for the Postfix container. Emails will appear to come from the hostname's domain.
  • ADMIN_EMAIL Email address of the person who should get root's mail.

The following env variable(s) are optional.

  • SMTP_HEADER_TAG This will add a header for tracking messages upstream. Helpful for spam filters. Will appear as "RelayTag: ${SMTP_HEADER_TAG}" in the email headers.

  • SMTP_NETWORKS Setting this will allow you to add additional, comma seperated, subnets to use the relay. Used like -e SMTP_NETWORKS='xxx.xxx.xxx.xxx/xx,xxx.xxx.xxx.xxx/xx'

  • SMTP_PORT (Optional, Default value: 25) Port address of the SMTP server to use.

  • SASL_ENABLED (Optional, Default is unset) Use SASL authentication on relay.

  • SMTP_USERNAME SASL Username to authenticate with.

  • SMTP_PASSWORD SASL Password of the SMTP user.

Mailman specific vars, all optional (see defaults):

  • CUSTOM_MAILMAN (Optional, Default value: unset) Use provided mailman configuration and skip all configuration steps
  • MAILMAN_LANG (Optional, Default value:ru) Default mailman language
  • MAILMAN_URL_HOST (Optional, Default value: $SERVER_HOSTNAME) Mailman URL FQDN, specified if mailman exposed outside with another name.
  • MAILMAN_EMAIL_HOST (Optional, Default value: $MAILMAN_URL_HOST) Mailman email FQDN, used in messaging
  • MAILMAN_URL_PATTERN (Optional, Default value: https://%s/mailman/) Mailman URL pattern used in messaging
  • MAILMAN_DOMAINS (Optional, Default value: $MAILMAN_URL_HOST) FQDN list to serve
  • SITE_PASSWORD (Optional, Default value: randomly generated) Mailman site (aka root) password
  • LIST_PASSWORD (Optional, Default value: randomly generated) Mailman list creation password
  • ML_PASSWORD (Optional, Default value: randomly generated) 'mailman' list password

MAILMAN_DOMAINS can be specified as a simple list:

<domain1.com> <domain2.xyz>..<domainN.zzz>

Or as key:value list with custom email hosts:

<domain1.com>:<email domain.com> <domain2.xyz>...<domainN.zzz>:<email domainY.yyy>

As you see, <domain2.xyz> doesn't have email custom url, so it will be used as email url.

To use this container from anywhere, the 25 port or the one specified by SMTP_PORT needs to be exposed to the docker host server:

docker run -d --name alt-mailman -p "25:25"  \ 
       -e SMTP_SERVER=smtp.bar.com \
       -e [email protected] \
       -e SMTP_PASSWORD=XXXXXXXX \
       -e SERVER_HOSTNAME=lists.example.com \
       alt-mailman

If you are going to use this container from other docker containers then it's better to just publish the port:

docker run -d --name alt-mailman -P \
       -e SMTP_SERVER=smtp.bar.com \
       -e [email protected] \
       -e SMTP_PASSWORD=XXXXXXXX \
       -e SERVER_HOSTNAME=internal.example.com \
       -e MAILMAN_DOMAINS='lists.example.com lists.example2.org:example3.net'
       alt-mailman

To see the system logs in real time:

docker logs -f alt-mailman (initial configuration)
docker exec -ti alt-mailman supervisorctl tail -f rsyslog (system logs)

To see mailman logs in real time:

docker exec -ti alt-mailman tail -f /var/log/mailman/error /var/log/mailman/qrunner

Debugging

If you need troubleshooting the container you can set the environment variable DEBUG=yes for a more verbose output.

altlinux-mailman-docker's People

Contributors

lakostis 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.