Commit d2d02852 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Merge branch 'mail' of server.test:/data/indiehosters into mail

parents 4e920aa1 915537e5
service lmtp {
inet_listener lmtp {
address = 127.0.0.1
port = 10026
}
}
protocol imap {
mail_max_userip_connections = 20
}
......@@ -8,7 +8,7 @@ RUN apt-get update && \
dovecot-mysql && \
rm -rf /var/lib/apt/lists/*
COPY 99-local.conf /etc/dovecot/conf.d/99-local.conf
COPY 99-local-lmtp.conf /etc/dovecot/conf.d/99-local-lmtp.conf
COPY auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext
COPY dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext
COPY 99-local-auth.conf /etc/dovecot/conf.d/99-local-auth.conf
......
......@@ -23,7 +23,8 @@ RUN \
smtpd_banner="\$myhostname ESMTP Hi, I'm a hosted by an IndieHoster (Debian/Postfix; see https://indiehosters.net/)" \
mydestination=localhost && \
/opt/editconf.py /etc/postfix/master.cf -s -w \
"submission=inet n - - - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_ciphers=high -o smtpd_tls_protocols=!SSLv2,!SSLv3 -o cleanup_service_name=authclean" \
"submission=inet n - - - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_ciphers=high -o smtpd_tls_protocols=!SSLv2,!SSLv3 -o cleanup_service_name=authclean" && \
/opt/editconf.py /etc/postfix/master.cf -s -w \
"authclean=unix n - - - 0 cleanup -o header_checks=pcre:/etc/postfix/outgoing_mail_header_filters" && \
/opt/editconf.py /etc/postfix/main.cf \
smtpd_tls_security_level=may\
......@@ -41,7 +42,7 @@ RUN \
/opt/editconf.py /etc/postfix/main.cf virtual_transport=lmtp:unix:dovecot/lmtp && \
/opt/editconf.py /etc/postfix/main.cf \
smtpd_sender_restrictions="reject_non_fqdn_sender,reject_unknown_sender_domain,reject_rhsbl_sender dbl.spamhaus.org" \
smtpd_recipient_restrictions=permit_sasl_authenticated,permit_mynetworks,"reject_rbl_client zen.spamhaus.org",reject_unlisted_recipient,#"check_policy_service inet:127.0.0.1:10023" && \
smtpd_recipient_restrictions=permit_sasl_authenticated,permit_mynetworks,"reject_rbl_client zen.spamhaus.org",reject_unlisted_recipient && \
/opt/editconf.py /etc/postfix/main.cf \
message_size_limit=134217728 && \
/opt/editconf.py /etc/postfix/main.cf \
......
......@@ -11,7 +11,7 @@ touch /data/domains/mail/nginx/.env
pass=`echo $RANDOM ${date} | md5sum | base64 | cut -c-10`
echo MYSQL_PASS=$pass > /data/domains/mail/mysql/.env
cat /data/domains/mail/mysql/.env | sed s/MYSQL_PASS/DB_PASS/ > /data/domains/mail/.env;
echo HOSTNAME=dovecot.test >> /data/domains/mail/.env
echo HOSTNAME=pierre-o.fr >> /data/domains/mail/.env
echo APPLICATION=nginx >> /data/domains/mail/.env
echo DOCKER_ARGUMENTS="-v /data/domains/mail/static/www-content:/app" >> /data/domains/mail.env
......
#!/bin/bash -ex
DOMAIN=$1
SOURCE=$2
DESTINATION=$3
MYSQL_PASS=`cat /data/domains/mail/mysql/.env | cut -d= -f2`
/usr/bin/docker run \
--rm \
--name add_email_support_to_$DOMAIN \
--link mysql-mail:db \
pierreozoux/mysql \
mysql \
-uadmin \
-p$MYSQL_PASS \
-h db \
-e "INSERT INTO servermail.virtual_aliases (domain_id, source , destination) \
VALUES( \
(SELECT id FROM servermail.virtual_domains WHERE name='$DOMAIN'), \
'$SOURCE',
'$DESTINATION');"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment