mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-01 23:57:05 +00:00
Merge 595553dd27
into 3efd4257b5
This commit is contained in:
commit
e2e54c5cb9
@ -309,6 +309,24 @@ ufw_allow smtp
|
|||||||
ufw_allow smtps
|
ufw_allow smtps
|
||||||
ufw_allow submission
|
ufw_allow submission
|
||||||
|
|
||||||
|
# Configure SMTP Relay
|
||||||
|
|
||||||
|
if [[ -n "${SMTP_RELAY_ENDPOINT:-}" && -n "${SMTP_RELAY_PORT:-}" && \
|
||||||
|
-n "${SMTP_RELAY_USER:-}" && -n "${SMTP_RELAY_PASSWORD:-}" ]]; then
|
||||||
|
postconf -e "relayhost = [$SMTP_RELAY_ENDPOINT]:$SMTP_RELAY_PORT" \
|
||||||
|
"smtp_sasl_auth_enable = yes" \
|
||||||
|
"smtp_sasl_security_options = noanonymous" \
|
||||||
|
"smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd" \
|
||||||
|
"smtp_use_tls = yes" \
|
||||||
|
"smtp_tls_security_level = encrypt" \
|
||||||
|
"smtp_tls_note_starttls_offer = yes"
|
||||||
|
echo "[$SMTP_RELAY_ENDPOINT]:$SMTP_RELAY_PORT $SMTP_RELAY_USER:$SMTP_RELAY_PASSWORD" >> /etc/postfix/sasl_passwd
|
||||||
|
postmap hash:/etc/postfix/sasl_passwd
|
||||||
|
chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
|
||||||
|
chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
|
||||||
|
postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt'
|
||||||
|
fi
|
||||||
|
|
||||||
# Restart services
|
# Restart services
|
||||||
|
|
||||||
restart_service postfix
|
restart_service postfix
|
||||||
|
Loading…
Reference in New Issue
Block a user