On 1/14/19 11:09 AM, Fazzina, Angelo wrote:
Hi, can you manually use commands to test the U/P are working from your postfix 
server ?

1. Run this to test connectivity to your server
openssl s_client -starttls smtp -connect your.host.name:587
        Typical OUTPUT =
                250 DSN
                quit
                221 2.0.0 Bye
                closed

2. Run this to create a hash
python -c 'import base64,sys; u,p=sys.argv[1:3]; print 
base64.encodestring("%s\x00%s\x00%s" % (u,u,p))' username password
        OUTPUT = dXNlcm5hbWUAdXNlcm5hbWUAcGFzc3dvcmQ=
Replace username and password with real ones


Once Steps 1 and 2 work, you can test authentication with the hash in Step 3

3. Run the openssl commands and connect to your server.
        A. do and "ehlo domain" to see commands supported
                EXAMPLE :
                ehlo domain
                250-localpart.domain.part
                250-PIPELINING
                250-SIZE 31457280
                250-VRFY
                250-ETRN
                250-AUTH PLAIN LOGIN
                250-ENHANCEDSTATUSCODES
                250-8BITMIME
                250 DSN
        B. execute the AUTH PLAIN LOGIN command option using the HASH you made 
in Step 3
                AUTH PLAIN dXNlcm5hbWUAdXNlcm5hbWUAcGFzc3dvcmQ=         

        C. look for output
                235 2.7.0 Authentication successful


Thanks Angelo.   This is quite useful for debugging.   I spent many hours today not getting authentication successful messages. I ultimately turned off 2FA on google and got rid of the app passwords.   Then I enabled insecure apps.   Once that is done, I can now get a 235 2.7.0 Accepted message.


However, I am still getting these messages when postfix tries to relay.

Jan 15 12:43:35 deathstar postfix/smtp[32233]: A90511E0963: to=<mich...@kmaclub.com>, relay=smtp.gmail.com[74.125.142.109]:587, delay=98478, delays=98477/0.04/0.94/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.142.109]: invalid parameter supplied)

Michael



Reply via email to