Contents:
- postfix smtp mailserver with virtual domains/users and authentication via imap
- postfixadmin to administer email domains/mailboxes
- dovecot imap server
- dovecot sieve for filtering rules
- spamassassin for spam filtering
- Owncloud for files and calendar/contacts sync
- mysql server to hold al mail and owncloud configurations/data
NB: All latest versions on new build
NB: when you want persistence storage, please mount it under /data (see example below for host path), and all data will be moved there.
Expose everything public:
docker run -d \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
-v <path to data on host>:/data \
-p 143:143 -p 993:993 -p 4190:4190 -p 25:25 -p 465:465 -p 80:80 -p 443:443 \
--name mycloud -h <FQDN of host> \
idef1x/mail-owncloud-docker
- SQLUSR => mysql admin user (default sqladmin)
- SQLPWD => mysql user password (default random generated -> see logs for the password (docker logs <container ID>|grep password)
- SQLHOST => in case you use an external mysql server (default localhost)
- SQLDB => in case you use an extern mysql server (local default mail for mail and owncloud for owncloud)
NB: only supply de datbase for mail, since owncloud will ask for it during setup.
- WEB => if set then no SSL wil be activated (in case you use a SSL proxy or other reason why you don't want SSL)
- First setup goto http(s)://hostname/postfixadmin/setup.php to initialize database
- setup an setup password and copy paste the red $CONF string into /var/www/postfixadmin/config.local.php (before the last ?>):
- open een shell in the container: docker exec -it <container ID> bash
- edit file: export TERM=linux && nano /var/www/postfixadmin/config.local.php
- save and exit shell
- Then goto http(s)://hostname/postfixadmin to configure domains and mailboxes etc
- goto http(s)://hostname
- fill in a username/password for an admin user
- select mysql database (or sqlite if you don't care about performance)
- use the given (by your external mysql manager) sql credentials or the autogenerated ones (see environment vars)
- choose the supplied database name or use owncloud for local sql server
- choose the supplied external mysql server or choose 127.0.0.1 for local sql server
- NB: sometimes owncloud complains about not able to connect to sql server (if localhost/127.0.0.1). Most times a second try will work.
Putting 127.0.0.1 in the host field (instead of localhost) seems to work better than localhost. For now I don't know what's picky.
- you can use the mail client provided by (installable via) owncloud
- fill in details and select SSL/TLS as IMAP/SMTP security
- Use 127.0.0.1 as IMAP and SMTP host
- For Apache certificates add parameters:
for cert: -v <path to SSL cert>:/etc/ssl/certs/ssl-cert-snakeoil.pem
for key : -v <path to SSL key>:/etc/ssl/private/ssl-cert-snakeoil.key
- For dovecot/postfix certificates add parameters:
for cert: -v <path to SSL cert>:/etc/dovecot/dovecot.pem
for key : -v <path to SSL cert>:/etc/dovecot/private/dovecot.pem