mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
parent
18b63c36b6
commit
f07a9ba852
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
postfix/ssl/*
|
postfix/ssl/*
|
||||||
assert.sh*
|
|
||||||
letsencrypt/
|
letsencrypt/
|
||||||
|
|
|
@ -10,7 +10,7 @@ RUN apt-get autoclean && rm -rf /var/lib/apt/lists/*
|
||||||
# Configures Saslauthd
|
# Configures Saslauthd
|
||||||
RUN rm -rf /var/run/saslauthd && ln -s /var/spool/postfix/var/run/saslauthd /var/run/saslauthd
|
RUN rm -rf /var/run/saslauthd && ln -s /var/spool/postfix/var/run/saslauthd /var/run/saslauthd
|
||||||
RUN adduser postfix sasl
|
RUN adduser postfix sasl
|
||||||
RUN echo 'NAME="saslauthd"\nSTART=yes\nMECHANISMS="sasldb"\nTHREADS=0\nPWDIR=/var/spool/postfix/var/run/saslauthd\nPIDFILE="${PWDIR}/saslauthd.pid"\nOPTIONS="-n 0 -r -m /var/spool/postfix/var/run/saslauthd"' > /etc/default/saslauthd
|
RUN echo 'NAME="saslauthd"\nSTART=yes\nMECHANISMS="sasldb"\nTHREADS=0\nPWDIR=/var/spool/postfix/var/run/saslauthd\nPIDFILE="${PWDIR}/saslauthd.pid"\nOPTIONS="-n 0 -c -m /var/spool/postfix/var/run/saslauthd"' > /etc/default/saslauthd
|
||||||
|
|
||||||
# Configures Courier
|
# Configures Courier
|
||||||
RUN sed -i -r 's/daemons=5/daemons=1/g' /etc/courier/authdaemonrc
|
RUN sed -i -r 's/daemons=5/daemons=1/g' /etc/courier/authdaemonrc
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -12,7 +12,7 @@ run:
|
||||||
cp test/virtual postfix/
|
cp test/virtual postfix/
|
||||||
# Run container
|
# Run container
|
||||||
docker run -d --name mail -v "`pwd`/postfix":/tmp/postfix -v "`pwd`/spamassassin":/tmp/spamassassin -v "`pwd`/test":/tmp/test -h mail.my-domain.com -t $(NAME):$(VERSION)
|
docker run -d --name mail -v "`pwd`/postfix":/tmp/postfix -v "`pwd`/spamassassin":/tmp/spamassassin -v "`pwd`/test":/tmp/test -h mail.my-domain.com -t $(NAME):$(VERSION)
|
||||||
sleep 15
|
sleep 25
|
||||||
|
|
||||||
prepare:
|
prepare:
|
||||||
# Reinitialize logs
|
# Reinitialize logs
|
||||||
|
|
|
@ -43,7 +43,7 @@ smtpd_tls_exclude_ciphers = aNULL, LOW, EXP, MEDIUM, ADH, AECDH, MD5, DSS, ECDSA
|
||||||
smtpd_sasl_auth_enable = yes
|
smtpd_sasl_auth_enable = yes
|
||||||
smtpd_sasl_path = smtpd
|
smtpd_sasl_path = smtpd
|
||||||
smtpd_sasl_type = cyrus
|
smtpd_sasl_type = cyrus
|
||||||
smtpd_sasl_security_options = noanonymous, noplaintext
|
smtpd_sasl_security_options = noanonymous
|
||||||
smtpd_sasl_local_domain = $myhostname
|
smtpd_sasl_local_domain = $myhostname
|
||||||
cyrus_sasl_config_path = /etc/postfix/sasl
|
cyrus_sasl_config_path = /etc/postfix/sasl
|
||||||
broken_sasl_auth_clients = yes
|
broken_sasl_auth_clients = yes
|
||||||
|
|
|
@ -73,7 +73,7 @@ smtp-amavis unix - - - - 2 smtp
|
||||||
-o disable_dns_lookups=yes
|
-o disable_dns_lookups=yes
|
||||||
-o max_use=20
|
-o max_use=20
|
||||||
|
|
||||||
127.0.0.1:10025 inet n - - - - smtpd
|
127.0.0.1:10025 inet n - n - - smtpd
|
||||||
-o content_filter=
|
-o content_filter=
|
||||||
-o local_recipient_maps=
|
-o local_recipient_maps=
|
||||||
-o relay_recipient_maps=
|
-o relay_recipient_maps=
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
pwcheck_method: auxprop
|
pwcheck_method: auxprop
|
||||||
mech_list: digest-md5 cram-md5
|
auxprop_plugin: sasldb
|
||||||
log_level: 7
|
mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5
|
||||||
|
log_level: 7
|
||||||
|
|
|
@ -102,6 +102,7 @@ esac
|
||||||
echo "Fixing permissions"
|
echo "Fixing permissions"
|
||||||
chown -R 5000:5000 /var/mail
|
chown -R 5000:5000 /var/mail
|
||||||
mkdir -p /var/log/clamav && chown -R clamav:root /var/log/clamav
|
mkdir -p /var/log/clamav && chown -R clamav:root /var/log/clamav
|
||||||
|
chown postfix.sasl /etc/sasldb2
|
||||||
|
|
||||||
echo "Creating /etc/mailname"
|
echo "Creating /etc/mailname"
|
||||||
echo $(hostname -d) > /etc/mailname
|
echo $(hostname -d) > /etc/mailname
|
||||||
|
|
|
@ -14,6 +14,10 @@ assert_raises "docker exec mail ps aux --forest | grep '/usr/sbin/amavisd-new'"
|
||||||
assert_raises "docker exec mail nc -w 1 0.0.0.0 143 | grep '* OK' | grep 'STARTTLS' | grep 'Courier-IMAP ready'" 0
|
assert_raises "docker exec mail nc -w 1 0.0.0.0 143 | grep '* OK' | grep 'STARTTLS' | grep 'Courier-IMAP ready'" 0
|
||||||
assert_raises "docker exec mail /bin/sh -c 'nc -w 1 0.0.0.0 143 < /tmp/test/email-templates/test-imap.txt'" 0
|
assert_raises "docker exec mail /bin/sh -c 'nc -w 1 0.0.0.0 143 < /tmp/test/email-templates/test-imap.txt'" 0
|
||||||
|
|
||||||
|
# Testing SASL
|
||||||
|
assert_raises "docker exec mail testsaslauthd -u user2 -r otherdomain.tld -p mypassword | grep 'OK \"Success.\"'" 0
|
||||||
|
assert_raises "docker exec mail testsaslauthd -u user2 -r otherdomain.tld -p BADPASSWORD | grep 'NO \"authentication failed\"'" 0
|
||||||
|
|
||||||
# Testing user creation
|
# Testing user creation
|
||||||
assert "docker exec mail sasldblistusers2" "user1@localhost.localdomain: userPassword\nuser2@otherdomain.tld: userPassword"
|
assert "docker exec mail sasldblistusers2" "user1@localhost.localdomain: userPassword\nuser2@otherdomain.tld: userPassword"
|
||||||
assert "docker exec mail ls -A /var/mail/localhost.localdomain/user1" "cur\nnew\ntmp"
|
assert "docker exec mail ls -A /var/mail/localhost.localdomain/user1" "cur\nnew\ntmp"
|
||||||
|
|
Loading…
Reference in a new issue