From 634b329dd965e8e419f1cec8ccb4cd79da4d4019 Mon Sep 17 00:00:00 2001 From: Val Date: Tue, 11 Nov 2014 11:58:44 +0000 Subject: [PATCH] Some info on SPAM measures and OpenDKIM setup --- README.md | 9 ++++++--- dovecot/process_settings | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 495ded7..ae818bb 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,19 @@ Based on https://github.com/lava/dockermail A secure, minimal-configuration mail server in a docker container. This repository is tailored to small private servers, where you own some domain(s) and -want to receive the mail for and send mail from this domain: +want to receive the mail for and send mail from this domain. The SMTP and IMAP server. This container uses postfix as MTA and dovecot as IMAP server. All incoming mail to your own domains is accepted. For outgoing mail, only authenticated (logged in with username and password) clients can send messages via STARTTLS on port 587. -In theory it works with all mail clients, but it was only tested with Thunderbird. +Outgoing mail is configured to get OpenDKIM signature, you need to generate a key and set up your domain records. +Also you should add PTR record to your IP (aka reverse DNS) which is done by your server provider and add an SPF record to your domain - otherwise you may get your mail spam filtered. Setup ===== Create 2 folders: one for mail configuration (`/opt/dockermail/settings`), another for mail storage (`/opt/dockermail/vmail`). - +Use the the example config files in `dovecot/example` of this repo. 1) Add all domains you want to receive mail for to the file `/opt/dockermail/settings/domains`, like this: @@ -47,6 +48,8 @@ container and run `doveadm pw -s ` inside. 5) Add DKIM settings files: `/opt/dockermail/settings/opendkim.conf` and `/opt/dockermail/settings/mail.private` See https://help.ubuntu.com/community/Postfix/DKIM on the info about these settings. + You will need to generate your own `mail.private` key and set up your domain records, the `opendkim.conf` from `dovecot/examples` + is ready to use. 6) Build container diff --git a/dovecot/process_settings b/dovecot/process_settings index 5d72af6..b805c2f 100644 --- a/dovecot/process_settings +++ b/dovecot/process_settings @@ -1,6 +1,8 @@ # Copy OpenDKIM config cp /mail_settings/opendkim.conf /etc/opendkim.conf -cp /mail_settings/mail.private /etc/postfix/dkim.key +cp /mail_settings/mail.private /etc/dkim.key +chown opendkim:opendkim /etc/dkim.key +chmod 600 /etc/dkim.key if [ -f /mail_settings/myhostname ]; then sed -i -e "s/myhostname = localhost/myhostname = $(sed 's:/:\\/:g' /mail_settings/myhostname)/" /etc/postfix/main.cf @@ -30,4 +32,4 @@ chown -R vmail:vmail /vmail chmod u+w /vmail # Add password file -cp /mail_settings/passwords /etc/dovecot/passwd \ No newline at end of file +cp /mail_settings/passwords /etc/dovecot/passwd