Added SSL for courier-imap using courier-imap-ssl.

Fixed /etc/postfix/vhost issue.
This commit is contained in:
Thomas VIAL 2015-03-31 19:31:18 +02:00
parent 188356237a
commit ccca157920
3 changed files with 9 additions and 4 deletions

View file

@ -4,7 +4,7 @@ MAINTAINER Thomas VIAL
# Packages
RUN apt-get update -q
RUN apt-get -y upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install postfix sasl2-bin courier-imap courier-authdaemon supervisor libfam0 fam amavisd-new spamassassin clamav-daemon libnet-dns-perl libmail-spf-perl pyzor razor arj bzip2 cabextract cpio file gzip nomarch pax unzip zip zoo rsyslog
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install postfix sasl2-bin courier-imap courier-imap-ssl courier-authdaemon supervisor libfam0 fam amavisd-new spamassassin clamav-daemon libnet-dns-perl libmail-spf-perl pyzor razor arj bzip2 cabextract cpio file gzip nomarch pax unzip zip zoo rsyslog
RUN apt-get autoclean
# Configures Saslauthd

View file

@ -5,7 +5,7 @@ A fullstack but simple mail server (smtp, imap, antispam, antivirus...)
Includes:
- postfix with smtp auth
- courier-imap
- courier-imap with ssl support
- amavis
- spamassasin
- clamav
@ -14,6 +14,8 @@ Additional informations:
- only config files, no *sql database required
- mails are stored in `/var/mail/${domain}/${username}`
- email login are full email address (`username1@my-domain.com`)
- ssl is strongly recommended
## installation

View file

@ -20,15 +20,17 @@ do
echo "${pass}" | saslpasswd2 -p -c -u ${domain} ${login}
mkdir -p /var/mail/${domain}
maildirmake /var/mail/${domain}/${user}
echo ${domain} >> /tmp/vhost.tmp
done < /tmp/docker_mail_users
rm /tmp/docker_mail_users
makeuserdb
echo "Postfix configurations"
sed -i -r 's/DOCKER_MAIL_DOMAIN/$docker_mail_domain/g' /etc/postfix/main.cf
postmap /etc/postfix/vmailbox
[ -f /etc/postfix/virtual ] && postmap /etc/postfix/virtual
touch /etc/postfix/virtual && postmap /etc/postfix/virtual
sed -i -r 's/DOCKER_MAIL_DOMAIN/'"$docker_mail_domain"'/g' /etc/postfix/main.cf
cat /tmp/vhost.tmp | sort | uniq >> /etc/postfix/vhost && rm /tmp/vhost.tmp
echo "Fixing permissions"
chown -R 5000:5000 /var/mail
@ -43,6 +45,7 @@ echo "Starting daemons"
/etc/init.d/saslauthd start
/etc/init.d/courier-authdaemon start
/etc/init.d/courier-imap start
/etc/init.d/courier-imap-ssl start
/etc/init.d/spamassassin start
/etc/init.d/clamav-daemon start
/etc/init.d/amavis start