mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Merge branch 'master' into logrotate_fix
This commit is contained in:
commit
b7355656bf
4
Makefile
4
Makefile
|
@ -9,6 +9,7 @@ build:
|
|||
run:
|
||||
# Copy test files
|
||||
cp test/accounts.cf postfix/
|
||||
cp test/main.cf postfix/
|
||||
cp test/virtual postfix/
|
||||
# Run containers
|
||||
docker run -d --name mail \
|
||||
|
@ -18,6 +19,7 @@ run:
|
|||
-e SA_TAG=1.0 \
|
||||
-e SA_TAG2=2.0 \
|
||||
-e SA_KILL=3.0 \
|
||||
-e SASL_PASSWD=testing \
|
||||
-h mail.my-domain.com -t $(NAME)
|
||||
docker run -d --name mail_pop3 \
|
||||
-v "`pwd`/postfix":/tmp/postfix \
|
||||
|
@ -51,6 +53,6 @@ tests:
|
|||
|
||||
clean:
|
||||
# Get default files back
|
||||
git checkout postfix/accounts.cf postfix/virtual
|
||||
git checkout postfix/accounts.cf postfix/main.cf postfix/virtual
|
||||
# Remove running test containers
|
||||
docker rm -f mail mail_pop3 mail_smtponly
|
||||
|
|
|
@ -97,6 +97,9 @@ Example:
|
|||
* *6.31* (default) => add 'spam detected' headers at that level
|
||||
* SA_KILL
|
||||
* *6.31* (default) => triggers spam evasive actions)
|
||||
* SASL_PASSWORD
|
||||
* *empty* (default) => No sasl_passwd will be created
|
||||
* *string* => A /etc/postfix/sasl_passwd will be created with that content and postmap will be run on it
|
||||
|
||||
Please read [how the container starts](https://github.com/tomav/docker-mailserver/blob/master/start-mailserver.sh) to understand what's expected.
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ smtp-amavis unix - - - - 2 smtp
|
|||
-o smtp_send_xforward_command=yes
|
||||
-o disable_dns_lookups=yes
|
||||
-o max_use=20
|
||||
-o smtp_tls_security_level=none
|
||||
|
||||
127.0.0.1:10025 inet n - n - - smtpd
|
||||
-o content_filter=
|
||||
|
@ -92,3 +93,4 @@ smtp-amavis unix - - - - 2 smtp
|
|||
-o smtpd_client_connection_count_limit=0
|
||||
-o smtpd_client_connection_rate_limit=0
|
||||
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
|
||||
-o smtp_tls_security_level=none
|
||||
|
|
|
@ -4,6 +4,7 @@ UMask 002
|
|||
Syslog yes
|
||||
SyslogSuccess Yes
|
||||
LogWhy Yes
|
||||
RemoveOldSignatures Yes
|
||||
|
||||
Canonicalization relaxed/simple
|
||||
|
||||
|
|
|
@ -196,6 +196,26 @@ case $DMS_SSL in
|
|||
|
||||
esac
|
||||
|
||||
if [ -f /tmp/postfix/main.cf ]; then
|
||||
while read line; do
|
||||
postconf -e "$line"
|
||||
done < /tmp/postfix/main.cf
|
||||
echo "Loaded '/tmp/postfix/main.cf'"
|
||||
else
|
||||
echo "'/tmp/postfix/main.cf' not provided. No extra postfix settings loaded."
|
||||
fi
|
||||
|
||||
if [ ! -z "$SASL_PASSWD" ]; then
|
||||
echo "$SASL_PASSWD" > /etc/postfix/sasl_passwd
|
||||
postmap hash:/etc/postfix/sasl_passwd
|
||||
rm /etc/postfix/sasl_passwd
|
||||
chown root:root /etc/postfix/sasl_passwd.db
|
||||
chmod 0600 /etc/postfix/sasl_passwd.db
|
||||
echo "Loaded SASL_PASSWORD"
|
||||
else
|
||||
echo "==> Warning: 'SASL_PASSWORD' is not provided. /etc/postfix/sasl_passwd not created."
|
||||
fi
|
||||
|
||||
echo "Fixing permissions"
|
||||
chown -R 5000:5000 /var/mail
|
||||
mkdir -p /var/log/clamav && chown -R clamav:root /var/log/clamav
|
||||
|
|
2
test/main.cf
Normal file
2
test/main.cf
Normal file
|
@ -0,0 +1,2 @@
|
|||
max_idle = 600s
|
||||
readme_directory = /tmp
|
|
@ -105,6 +105,11 @@
|
|||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "checking sasl: sasl_passwd.db exists" {
|
||||
run docker exec mail [ -f /etc/postfix/sasl_passwd.db ]
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
#
|
||||
# smtp
|
||||
#
|
||||
|
@ -217,6 +222,13 @@
|
|||
[ "${lines[1]}" = "otherdomain.tld" ]
|
||||
}
|
||||
|
||||
@test "checking postfix: main.cf overrides" {
|
||||
run docker exec mail grep -q 'max_idle = 600s' /tmp/postfix/main.cf
|
||||
[ "$status" -eq 0 ]
|
||||
run docker exec mail grep -q 'readme_directory = /tmp' /tmp/postfix/main.cf
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
#
|
||||
# spamassassin
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue