Skip to content

SASL passwords are created with the container's hostname as domain #192

@thielj

Description

@thielj

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: userPassword

When 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` $_user

When 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions