Turns out this wasn't something wrong with the postfix. But in case someone 
will run into the same issue -- here is how I addressed this problem:

Alpine 3.9 splitted package libsasl (which used to contain liblogin and 
libplain[1]) into three: libsasl[2], cyrus-sasl-plain[3] and cyrus-sasl-login 
[4]. Installing these two extra packages didn't solve my problem. Then I 
started looking throughout the changelogs of the cyrus-sasl and... something 
made me look into config dir of the sasl. I accidentally instead of cd used 
mkdir and after few more steps I ran "postfix flush" and this got email relayed 
to the upstream server. 

Turns out,  "mkdir /etc/sasl2" fixed the problem. I've verified on fresh 
container. 

Thanks everyone who helped. 

[1]: 
https://pkgs.alpinelinux.org/contents?file=&path=&name=libsasl&branch=v3.8&repo=main&arch=x86_64
[2]: 
https://pkgs.alpinelinux.org/contents?file=&path=&name=libsasl&branch=v3.9&repo=main&arch=x86_64
[3]: 
https://pkgs.alpinelinux.org/contents?file=&path=&name=cyrus-sasl-plain&branch=v3.9&repo=main&arch=x86_64
[4]: 
https://pkgs.alpinelinux.org/contents?file=&path=&name=cyrus-sasl-login&branch=v3.9&repo=main&arch=x86_64

16.02.2019, 11:22, "sashk" <b...@sashk.xyz>:
> Hello Patrick,
>
> Thanks for the response.
>
>>  The other side offers PLAIN LOGIN, but your smtp client doesn't like that
>>  because those are mechanisms which send identification data in clear (read:
>>  unencrypted). That's because you have this (default) in place:
>>
>>  smtp_sasl_security_options = noplaintext, noanonymous
>>
>>  Either you make sure your smtp client uses TLS, while it attempts to
>>  authenticate or you lower the security policy and configure your smtp client
>>  to permit PLAIN and/or LOGIN like this:
>>
>>  smtp_sasl_security_options = noanonymous
>
> I have tried this option as well, and it did not address the issue.
>
> Perhaps I should have included full log (see bellow), but the SMTP server 
> won't even advertise AUTH until client starts using TLS as remote server has 
> following in it's master.cf:
>
> submission inet n - n - - smtpd
>   -o syslog_name=postfix/submission
>   -o smtpd_tls_security_level=encrypt
>   -o smtpd_sasl_auth_enable=yes
>   -o smtpd_tls_auth_only=yes
>
> Here is more detailed log after I set "smtp_sasl_security_options = 
> noanonymous"
>
> smtp_1 | 2019-02-16T16:08:21.494186+00:00 xxx postfix/qmgr[86]: 366D7C0D16: 
> from=<r...@docker.smtp.blah.domain.com>, size=188, nrcpt=1 (queue active)
> smtp_1 | 2019-02-16T16:08:21.558785+00:00 xxx postfix/smtp[88]: 
> smtp_stream_setup: maxtime=300 enable_deadline=0
> smtp_1 | 2019-02-16T16:08:21.699962+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 220 SMTPSERVER.DOMAIN.COM ESMTP Postfix
> smtp_1 | 2019-02-16T16:08:21.700011+00:00 xxx postfix/smtp[88]: > 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: EHLO docker.smtp.blah.domain.com
> smtp_1 | 2019-02-16T16:08:21.736223+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-SMTPSERVER.DOMAIN.COM
> smtp_1 | 2019-02-16T16:08:21.736254+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-PIPELINING
> smtp_1 | 2019-02-16T16:08:21.736258+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-SIZE 104857600
> smtp_1 | 2019-02-16T16:08:21.736262+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-VRFY
> smtp_1 | 2019-02-16T16:08:21.736265+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-ETRN
> smtp_1 | 2019-02-16T16:08:21.736269+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-STARTTLS
> smtp_1 | 2019-02-16T16:08:21.736276+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-ENHANCEDSTATUSCODES
> smtp_1 | 2019-02-16T16:08:21.736281+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-8BITMIME
> smtp_1 | 2019-02-16T16:08:21.736306+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-DSN
> smtp_1 | 2019-02-16T16:08:21.736310+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250 SMTPUTF8
> smtp_1 | 2019-02-16T16:08:21.736331+00:00 xxx postfix/smtp[88]: server 
> features: 0x20901f size 104857600
> smtp_1 | 2019-02-16T16:08:21.736336+00:00 xxx postfix/smtp[88]: Using ESMTP 
> PIPELINING, TCP send buffer size is 87040, PIPELINING buffer size is 4096
> smtp_1 | 2019-02-16T16:08:21.736434+00:00 xxx postfix/smtp[88]: 
> smtp_stream_setup: maxtime=300 enable_deadline=0
> smtp_1 | 2019-02-16T16:08:21.736448+00:00 xxx postfix/smtp[88]: > 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: STARTTLS
> smtp_1 | 2019-02-16T16:08:21.780254+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 220 2.0.0 Ready to start TLS
> ...
> smtp_1 | 2019-02-16T16:08:21.862152+00:00 xxx postfix/smtp[88]: Trusted TLS 
> connection established to SMTPSERVER.DOMAIN.COM[IPADDR]:587: TLSv1.3 with 
> cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) 
> server-signature RSA-PSS (2048 bits) server-digest SHA256
> smtp_1 | 2019-02-16T16:08:21.862200+00:00 xxx postfix/smtp[88]: 
> smtp_stream_setup: maxtime=300 enable_deadline=0
> smtp_1 | 2019-02-16T16:08:21.862207+00:00 xxx postfix/smtp[88]: > 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: EHLO docker.smtp.blah.domain.com
> ..
> smtp_1 | 2019-02-16T16:08:21.931001+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-SMTPSERVER.DOMAIN.COM
> smtp_1 | 2019-02-16T16:08:21.931035+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-PIPELINING
> smtp_1 | 2019-02-16T16:08:21.931039+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-SIZE 104857600
> smtp_1 | 2019-02-16T16:08:21.931043+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-VRFY
> smtp_1 | 2019-02-16T16:08:21.931047+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-ETRN
> smtp_1 | 2019-02-16T16:08:21.931052+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-AUTH PLAIN LOGIN
> smtp_1 | 2019-02-16T16:08:21.931056+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-AUTH=PLAIN LOGIN
> smtp_1 | 2019-02-16T16:08:21.931064+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-ENHANCEDSTATUSCODES
> smtp_1 | 2019-02-16T16:08:21.931068+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-8BITMIME
> smtp_1 | 2019-02-16T16:08:21.931071+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250-DSN
> smtp_1 | 2019-02-16T16:08:21.931075+00:00 xxx postfix/smtp[88]: < 
> SMTPSERVER.DOMAIN.COM[IPADDR]:587: 250 SMTPUTF8
> smtp_1 | 2019-02-16T16:08:21.931086+00:00 xxx postfix/smtp[88]: match_string: 
> smtp_sasl_mechanism_filter: plain ~? auth
> smtp_1 | 2019-02-16T16:08:21.931183+00:00 xxx postfix/smtp[88]: match_string: 
> smtp_sasl_mechanism_filter: plain ~? login
> smtp_1 | 2019-02-16T16:08:21.931194+00:00 xxx postfix/smtp[88]: 
> match_list_match: PLAIN: no match
> smtp_1 | 2019-02-16T16:08:21.931222+00:00 xxx postfix/smtp[88]: match_string: 
> smtp_sasl_mechanism_filter: login ~? auth
> smtp_1 | 2019-02-16T16:08:21.931229+00:00 xxx postfix/smtp[88]: match_string: 
> smtp_sasl_mechanism_filter: login ~? login
> smtp_1 | 2019-02-16T16:08:21.931234+00:00 xxx postfix/smtp[88]: match_string: 
> smtp_sasl_mechanism_filter: plain ~? auth
> smtp_1 | 2019-02-16T16:08:21.931237+00:00 xxx postfix/smtp[88]: match_string: 
> smtp_sasl_mechanism_filter: plain ~? login
> smtp_1 | 2019-02-16T16:08:21.931240+00:00 xxx postfix/smtp[88]: 
> match_list_match: PLAIN: no match
> smtp_1 | 2019-02-16T16:08:21.931244+00:00 xxx postfix/smtp[88]: match_string: 
> smtp_sasl_mechanism_filter: login ~? auth
> smtp_1 | 2019-02-16T16:08:21.931247+00:00 xxx postfix/smtp[88]: match_string: 
> smtp_sasl_mechanism_filter: login ~? login
> smtp_1 | 2019-02-16T16:08:21.931253+00:00 xxx postfix/smtp[88]: server 
> features: 0x20902f size 104857600
> smtp_1 | 2019-02-16T16:08:21.931259+00:00 xxx postfix/smtp[88]: Using ESMTP 
> PIPELINING, TCP send buffer size is 87040, PIPELINING buffer size is 4096
> smtp_1 | 2019-02-16T16:08:21.931294+00:00 xxx postfix/smtp[88]: maps_find: 
> smtp_sasl_password_maps: SMTPSERVER.DOMAIN.COM: not found
> smtp_1 | 2019-02-16T16:08:21.931423+00:00 xxx postfix/smtp[88]: maps_find: 
> smtp_sasl_password_maps: 
> hash:/etc/postfix/sasl_passwd(0,lock|fold_fix|utf8_request): 
> [SMTPSERVER.DOMAIN.COM]:587 = username:password
> smtp_1 | 2019-02-16T16:08:21.931428+00:00 xxx postfix/smtp[88]: 
> smtp_sasl_passwd_lookup: host `SMTPSERVER.DOMAIN.COM' user `username' pass 
> `password'
> smtp_1 | 2019-02-16T16:08:21.931431+00:00 xxx postfix/smtp[88]: starting new 
> SASL client
> smtp_1 | 2019-02-16T16:08:21.931444+00:00 xxx postfix/smtp[88]: name_mask: 
> noanonymous
> smtp_1 | 2019-02-16T16:08:21.931515+00:00 xxx postfix/smtp[88]: 
> smtp_sasl_authenticate: SMTPSERVER.DOMAIN.COM[IPADDR]:587: SASL mechanisms 
> LOGIN
> smtp_1 | 2019-02-16T16:08:21.931531+00:00 xxx postfix/smtp[88]: warning: SASL 
> authentication failure: No worthy mechs found
> smtp_1 | 2019-02-16T16:08:21.931802+00:00 xxx postfix/smtp[88]: connect to 
> subsystem private/defer

Reply via email to