feat(mail): add stunnel support for Dovecot and Postfix with configuration and certificate management
This commit is contained in:
@@ -15,14 +15,6 @@ if [ -z "$SMTP_PASSWORD" ]; then
|
||||
echo "SMTP_PASSWORD is required"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$DOVECOT_AUTH_ADDRESS" ]; then
|
||||
echo "DOVECOT_AUTH_ADDRESS is required"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$DOVECOT_AUTH_PORT" ]; then
|
||||
echo "DOVECOT_AUTH_PORT is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
postconf -e "myhostname=$MAILNAME"
|
||||
postconf -e "mydomain=$MY_PRIMARY_DOMAIN"
|
||||
@@ -41,7 +33,7 @@ postconf -e "smtp_tls_CAfile=/etc/ssl/certs/ca-certificates.crt"
|
||||
|
||||
# SASL configuration
|
||||
postconf -e "smtpd_sasl_type=dovecot"
|
||||
postconf -e "smtpd_sasl_path=inet:$DOVECOT_AUTH_ADDRESS:$DOVECOT_AUTH_PORT"
|
||||
postconf -e "smtpd_sasl_path=inet:localhost:31000"
|
||||
postconf -e "smtpd_sasl_auth_enable=yes"
|
||||
postconf -e "smtpd_sasl_security_options=noanonymous"
|
||||
postconf -e "smtpd_recipient_restrictions=permit_sasl_authenticated, reject"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
foreground = yes
|
||||
|
||||
[dovecot-auth]
|
||||
client = yes
|
||||
accept = 127.0.0.1:31000
|
||||
connect = dovecot-auth.mail.svc.cluster.local:31000
|
||||
CAfile = /etc/ssl/certs/ca.pem
|
||||
Reference in New Issue
Block a user