montgomery-auber / postfix-containerized

Postfix Server with Letsencrypt Certs and Roundcube
GNU General Public License v3.0
2 stars 1 forks source link

Add line ending to the end of /etc/postfix/main.cf #3

Closed montgomery-auber closed 1 year ago

montgomery-auber commented 2 years ago

when running postconf the last line without line ending gets combined with one of the lines in the postconf command. for next version add empty lines to main.cf . quick fix is to add the contents of last line to the postconf command.

docker exec -it postfix postconf -e \
 "relayhost = email-smtp.us-east-1.amazonaws.com:587" \
"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" 

the above would end up looking like


smtpd_tls_auth_only = yes
inet_protocols = ipv4smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = encrypt
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
relayhost = email-smtp.us-east-1.amazonaws.com:587
smtp_sasl_auth_enable = yes

` The line starting with inet_protocols got combined

The solution was to add the last line to the postconf command , then it worked.


docker exec -it postfix postconf -e \
"inet_protocols = ipv4"  \
 "relayhost = email-smtp.us-east-1.amazonaws.com:587" \
"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" 
montgomery-auber commented 1 year ago

https://github.com/montgomery-auber/postfix-containerized/commit/f0b17f8d02e78178aa3703b924cdf3c683759e55 added this