-
Notifications
You must be signed in to change notification settings - Fork 167
Description
Current boky/postfix:latest-alpine, postfix v3.8.4.
I've been trying to force authentication using SMTPD_SASL_USERS="user:pass". However, it didn't work as expected. Long story short, this is what ended up in sasldb
51686ed8d2b4:/tmp# sasldblistusers2
user@51686ed8d2b4: userPasswordWhen I use user@<containername> it all works as expected - except that the mail is bounced by Gmail and probably others ('From' header has non compliant domain name). I tracked this down to postfix_setup_smtpd_sasl_auth() in common-run.sh. It might need changing like this (see SASL_README):
echo $_pwd | saslpasswd2 -p -c -u `postconf -h mydomain` $_userWhen used in conjunction with the below, postfix would accept both user and [email protected] as valid user names.
POSTFIX_smtpd_sasl_local_domain: "$$mydomain"
Another option would be to specify SMTPD_SASL_USERS='[email protected]:password,...', which I've started using now. If the behaviour on other platforms is the same, it might be worth adding this to the README where it mentions SMTPD_SASL_USERS.
Speaking of other platforms, there's probably another issue in this function. When using the Debian based image boky/postfix:latest with SMTPD_SASL_USERS, the container keeps restarting:
--------8<-------------
‣ INFO Enable smtpd sasl auth.
ln: failed to create symbolic link '/etc/sasl2/smtpd.conf': File exists
★★★★★ POSTFIX STARTING UP (debian) ★★★★★
‣ NOTE Setting container timezone to: Etc/UTC
--------8<-------------
A simple check if this file exists or using ln -s -f might fix it. They both look identical, I haven't investigated any further than this.
Many thanks for providing this image, by the way!