diff --git a/README.md b/README.md index bb2e763..493bd14 100644 --- a/README.md +++ b/README.md @@ -40,26 +40,27 @@ be delivered to the corresponding account in the right column. john.doe@example.org:{PLAIN}password123 admin@example.org:{SHA256-CRYPT}$5$ojXGqoxOAygN91er$VQD/8dDyCYOaLl2yLJlRFXgl.NSrB3seZGXBRMdZAr6 -To get the hash values, you can either install dovecot locally or use lxc-attach to attach to the running +To get the hash values, you can either install dovecot locally or use `docker exec -it dockermail bash` to attach to the running container and run `doveadm pw -s ` inside. -4) Build container +4) Change the hostname in file `/opt/dockermail/settings/myhostname` to the correct fully qualified domain of your server. + +5) Build container make -5) Run container and map ports 25 and 143 from the host to the container. +6) Run container and map ports 25 and 143 from the host to the container. To store your mail outside the container, map `/opt/dockermail/vmail/` to a directory on your host. (This is recommended, otherwise you have to remember to backup your mail when you want to restart the container) `docker run -d -p 25:25 -p 587:587 -p 143:143 -v /opt/dockermail/settings:/mail_settings -v /opt/dockermail/vmail:/vmail dovecot_made_special/2.1.7` -6) Enjoy. +7) Enjoy. Known issues / Todo / Wishlist ============================== -- HELO isn't set correctly, which can lead to problems with outgoing mail on some servers - It would be nice to have a way of catching mail to all subdomains. diff --git a/dovecot/example/myhostname b/dovecot/example/myhostname new file mode 100644 index 0000000..d18580b --- /dev/null +++ b/dovecot/example/myhostname @@ -0,0 +1 @@ +localhost \ No newline at end of file diff --git a/dovecot/process_settings b/dovecot/process_settings index bd06f29..2dcba90 100644 --- a/dovecot/process_settings +++ b/dovecot/process_settings @@ -1,3 +1,7 @@ +if [ -f /mail_settings/myhostname ]; then + sed -i -e "s/myhostname = localhost/myhostname = $(sed 's:/:\\/:g' /mail_settings/myhostname)/" /etc/postfix/main.cf +fi + # configure mail delivery to dovecot cp /mail_settings/aliases /etc/postfix/virtual cp /mail_settings/domains /etc/postfix/virtual-mailbox-domains