Public | Automated Build

Last pushed: 2 months ago
Short Description
NOTE: Please check out alpine-virtualmail which is smaller
Full Description

Virtualmail container

Virtualmail on Docker.

A summary of this container:

"The virtualmail container deploys and configures everything you need to provide email hosting. The container includes software for POP3 and IMAP, spam filtering, antivirus, and email groups (via a listserv)."

Thanks @timbert for pointing it out

Requirements:

- MySQL
- Docker

Build container

$ docker build -t combro2k/virtualmail https://github.com/combro2k/virtualmail.git

How to start a container:

Use a linked database:
$ docker run -d \
  --link mysql:mysql \
  -e "POSTFIX_MYSQL_PASSWORD=postfixpassword" \
  -h 'mail.example.org' \
  -v /var/vmail:/var/vmail \
  -P \
  combro2k/virtualmail:latest
Add IPV6 support:
$ docker run -d \
  --link mysql:mysql \
  -e "POSTFIX_MYSQL_PASSWORD=postfixpassword" \
  -e "IP6DEV=eth1" \
  -e "IPV6ADDR=postfixpassword" \
  -e "IPV6GW=postfixpassword" \
  -h 'mail.example.org' \
  -v /var/vmail:/var/vmail \
  -P \
  combro2k/virtualmail:latest
Use a static database:
$ docker run -d \
  -e "MYSQL_PORT_3306_TCP_ADDR=172.0.0.24" \
  -e "MYSQL_PORT_3306_TCP_PORT=3306" \
  -e "POSTFIX_MYSQL_PASSWORD=postfixpassword" \
  -h 'mail.example.org' \
  -v /var/vmail:/var/vmail \
  -P \
  combro2k/virtualmail:latest
Aditional Mailman(3) Mailinglist:
$ docker run -d \
      -e "MYSQL_PORT_3306_TCP_ADDR=172.0.0.24" \
      -e "MYSQL_PORT_3306_TCP_PORT=3306" \
      -e "POSTFIX_MYSQL_PASSWORD=postfixpassword" \
      -e "MAILINGLIST=list.example.org" \
      -h 'mail.example.org' \
      -v /var/vmail:/var/vmail \
      -v /var/mailman:/var/mailman \
      -P \
      combro2k/virtualmail:latest

Aditional volumes to be mount:

  • /etc/dovecot # configuration for Dovecot
  • /etc/postfix # configuration for Postfix
  • /etc/amavis # configuration for AMaViS
  • /etc/opendkim # configuration for OpenDKIM
  • /etc/opendmarc # configuration for OpenDMARC
  • /etc/mailman # configuration for Mailman
  • /var/mailman # mailman store

Default config

You can extract all the default configs for example:

$ tar zxvf ~/root/config.tar.gz -C / /etc/mailman

Build app again

You can build an specific app again by running /usr/local/bin/setup.sh [app]

$ /usr/local/bin/setup.sh postfix
Docker Pull Command
Owner
combro2k
Source Repository

Comments (7)
polinux
2 years ago

Error messages when running with use static database.

Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/mass_removal.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/login.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/subscription_requests.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/settings_legacy.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_address_preferences.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/domain_new.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/subscribe.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/unsubscribe.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/mass_subscribe.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/domain_confirm_delete.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/errors/generic.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/settings.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_mailmansettings.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_address_activation_link.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/archival_options.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_profile.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/index.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_tasks.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_address_activation_sent.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/metrics.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/subscriptions.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/held_messages.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/members.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_subscriptions.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_address_activation.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/site_settings.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/domain_index.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/summary.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/memberoptions.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_subscription_preferences.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/confirm_delete.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/confirm_dialog.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/lists/new.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.
Error parsing template /opt/postorius/local/lib/python2.7/site-packages/postorius/templates/postorius/user_settings.html: Invalid template name in 'extends' tag: ''. Got this from the 'postorius_base_template' variable.

combro2k
2 years ago

Sympa removed in favor of mailman 3

combro2k
2 years ago

Oh and I am trying to replace the dkim and spf with emna :-)
Because it checks it both, but still testing it out ;-)

combro2k
2 years ago

@tikker your postfix is an chroot issue in Postfix it seems.
chroot change the root of the program as /var/spool/postfix.
The mysql inside the container (mysql-server) I don't use, I use a separate database for the virtual users. (MariaDB). Vi I don't use inside the container I use the volume mount outside the container to change the config files ;-)

But for you I can add vi and/or less :-).

Cheers ;-)

tikker
2 years ago

Nice work! :-)

I've just got it to run. Just a few thoughts/findings from the process so far:

  • Inside the container, I had to copy /etc/resolv.conf and /etc/services to /var/spool/postfix/etc in order to have postfix find the files.
  • On the host, in the mysql config file, I needed to set the bind-address to 0.0.0.0 (it's 127.0.0.1 by default)
  • The database and database-user for postfix virtual tables inside the container is 'postfix' (in both cases). I started out with postfixadmin on the host, which created a 'postfixadmin' user and database by default --> didn't match (but was easy enough to lookup in /etc/postfix/mysql-* files). Maybe worth documenting.
  • I still need to replace the 'snakeoil' certificates under /etc/ssl with real ones (and configure them in /etc/postfix/main.cf).
  • A few common commands (e.g. 'less' or 'vi') in the container won't hurt. ;-)

However, thanks a lot and keep going!

combro2k
3 years ago

Btw @timbert have a look at the postfixadmin sql config you need that for the virtual users in the database :-)

timbert
3 years ago

A summary of this container:
"The virtualmail container deploys and configures everything you need to provide email hosting. The container includes software for POP3 and IMAP, spam filtering, antivirus, and email groups (via a listserv)."

Thanks for the container, looking forward to trying it out!