From 47272df96b0a56a29e5bcee43fbcd3761d275973 Mon Sep 17 00:00:00 2001 From: Pierre Jaury Date: Wed, 17 Feb 2016 22:56:40 +0100 Subject: [PATCH] Simple yet functional dovecot+postfix --- Dockerfile | 10 +- README.md | 19 +-- config/dovecot/conf.d/10-auth.conf | 13 -- config/dovecot/conf.d/10-mail.conf | 6 - config/dovecot/conf.d/10-master.conf | 43 ------ config/dovecot/conf.d/10-ssl.conf | 4 - config/dovecot/conf.d/15-lda.conf | 6 - config/dovecot/conf.d/20-imap.conf | 3 - config/dovecot/conf.d/20-lmtp.conf | 3 - config/dovecot/dovecot-sql.conf.ext | 22 +-- config/dovecot/dovecot.conf | 125 +++++++++++++++++- config/postfix/main.cf | 62 +++++---- config/postfix/master.cf | 33 +---- config/postfix/pgsql-relocated_maps.cf | 14 -- .../postfix/pgsql-smtpd_sender_login_maps.cf | 18 --- config/postfix/pgsql-transport_maps.cf | 14 -- config/postfix/pgsql-virtual_alias_maps.cf | 14 -- config/postfix/pgsql-virtual_gid_maps.cf | 14 -- .../postfix/pgsql-virtual_mailbox_domains.cf | 14 -- config/postfix/pgsql-virtual_mailbox_maps.cf | 14 -- config/postfix/pgsql-virtual_uid_maps.cf | 14 -- config/postfix/sqlite-virtual_alias_maps.cf | 2 + .../postfix/sqlite-virtual_mailbox_domains.cf | 2 + config/supervisor/supervisord.conf | 4 + 24 files changed, 195 insertions(+), 278 deletions(-) delete mode 100644 config/dovecot/conf.d/10-auth.conf delete mode 100644 config/dovecot/conf.d/10-mail.conf delete mode 100644 config/dovecot/conf.d/10-master.conf delete mode 100644 config/dovecot/conf.d/10-ssl.conf delete mode 100644 config/dovecot/conf.d/15-lda.conf delete mode 100644 config/dovecot/conf.d/20-imap.conf delete mode 100644 config/dovecot/conf.d/20-lmtp.conf delete mode 100644 config/postfix/pgsql-relocated_maps.cf delete mode 100644 config/postfix/pgsql-smtpd_sender_login_maps.cf delete mode 100644 config/postfix/pgsql-transport_maps.cf delete mode 100644 config/postfix/pgsql-virtual_alias_maps.cf delete mode 100644 config/postfix/pgsql-virtual_gid_maps.cf delete mode 100644 config/postfix/pgsql-virtual_mailbox_domains.cf delete mode 100644 config/postfix/pgsql-virtual_mailbox_maps.cf delete mode 100644 config/postfix/pgsql-virtual_uid_maps.cf create mode 100644 config/postfix/sqlite-virtual_alias_maps.cf create mode 100644 config/postfix/sqlite-virtual_mailbox_domains.cf diff --git a/Dockerfile b/Dockerfile index 9ec6cf7..38f65fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,18 @@ FROM debian:jessie RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get install -y --no-install-recommends \ - postfix dovecot-imapd dovecot-sqlite \ + postfix dovecot-imapd dovecot-sqlite dovecot-lmtpd \ dovecot-sieve dovecot-managesieved \ dovecot-antispam spamassassin clamav \ - supervisor \ + supervisor rsyslog \ && apt-get clean +# When installed non-interactively, the file does not get copied to the +# postfix chroot, thus causing smtpd to fail. +RUN cp /etc/services /var/spool/postfix/etc/ + ADD config /etc/ +# Explicitely specify the configuration file to avoid problems when +# the default configuration path changes. CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/README.md b/README.md index f989c21..eeab223 100644 --- a/README.md +++ b/README.md @@ -21,22 +21,15 @@ Architecture The mail infrastructure is based on a standard MTA-LDA : - * Postfix with an SQL database for transport ; - * Dovecot with an SQL database for delivery and access ; + * Postfix with an SQLite database for transport ; + * Dovecot with an SQLite database for delivery and access ; * Spamassassin for spam filtering ; * ClamAV for malware filtering. Additional Web UI : * Roundcube Webmail (can easily be replaced) ; - * Administration UI based on Flask an VMM. - -The administration UI does not interact with the database directly but with -VMM instead, which has a great API and already implements most features while -providing solid configuration files for Postfix and Dovecot. - -Only authentication and authorization is managed directly by the Web -administration UI. + * Administration UI based on Flask. All components are monitored by supervisord. @@ -47,10 +40,10 @@ The project is still at a very (very !) early stage. This is more of a roadmap than a proper TODO list. Please poke me or pull request if you would like to join the effort. - - [ ] Import vmm configuration files and tune them to support spamassassin and clamav. - - [ ] Run a mail container with a simple vmm command line. + - [x] Import vmm configuration files and get a simple postfix/dovecot running with SQLite. + - [ ] Add support for spamassassin. + - [ ] Add support for clamav. - [ ] Draft a Web administration UI. - [ ] Implement basic features from the free (as in beer) poste.io. - [ ] Start using on a couple production mail servers. - - [ ] Find a proper way to maintain vmm without forking. - [ ] Implement some fancy features. diff --git a/config/dovecot/conf.d/10-auth.conf b/config/dovecot/conf.d/10-auth.conf deleted file mode 100644 index 3bc3bc7..0000000 --- a/config/dovecot/conf.d/10-auth.conf +++ /dev/null @@ -1,13 +0,0 @@ -auth_mechanisms = plain login cram-md5 - -passdb { - driver = sql - args = /etc/dovecot/dovecot-sql.conf.ext -} - -userdb { - driver = sql - args = /etc/dovecot/dovecot-sql.conf.ext -} - -#!include auth-system.conf.ext diff --git a/config/dovecot/conf.d/10-mail.conf b/config/dovecot/conf.d/10-mail.conf deleted file mode 100644 index a982cbc..0000000 --- a/config/dovecot/conf.d/10-mail.conf +++ /dev/null @@ -1,6 +0,0 @@ -# mailbox configuration - -first_valid_gid = 70000 -first_valid_uid = 70000 -mail_access_groups = mail -mail_location = maildir:~/Maildir diff --git a/config/dovecot/conf.d/10-master.conf b/config/dovecot/conf.d/10-master.conf deleted file mode 100644 index 47d525d..0000000 --- a/config/dovecot/conf.d/10-master.conf +++ /dev/null @@ -1,43 +0,0 @@ -service imap-login { - inet_listener imap { - port = 143 - } - inet_listener imaps { - port = 993 - } -} - -service lmtp { - unix_listener /var/spool/postfix/private/dovecot-lmtp { - user = postfix - group = postfix - mode = 0600 - } -} - -service auth { - user = doveauth - unix_listener auth-userdb { - } - unix_listener /var/spool/postfix/private/dovecot-auth { - user = postfix - group = postfix - mode = 0600 - } -} - -service auth-worker { - unix_listener auth-worker { - user = mail - group = $default_internal_user - mode = 0660 - } - user = mail -} - -service dict { - unix_listener dict { - group = mail - mode = 0660 - } -} diff --git a/config/dovecot/conf.d/10-ssl.conf b/config/dovecot/conf.d/10-ssl.conf deleted file mode 100644 index a78ba85..0000000 --- a/config/dovecot/conf.d/10-ssl.conf +++ /dev/null @@ -1,4 +0,0 @@ -# SSL/TLS support -ssl = yes -ssl_cert =