namshi / docker-smtp

SMTP docker container
MIT License
548 stars 198 forks source link

Is Exchange Server as a relay supported? #37

Open sctse999 opened 6 years ago

sctse999 commented 6 years ago

I tried using sendgrid and everything is fine.

SMTP<< 250-smtp.sendgrid.net 290 250-8BITMIME 290 250-PIPELINING 290 250-SIZE 31457280 290 250-STARTTLS 290 250-AUTH PLAIN LOGIN 290 250 AUTH=PLAIN LOGIN 290 SMTP>> AUTH PLAIN **** 290 SMTP<< 235 Authentication successful

Now when I am trying to use an exchange server in my internal network as a relay, it doesn't work.

292 SMTP<< 220 2.0.0 SMTP server ready 292 SMTP>> EHLO 5a941ff55a4f 292 SMTP<< 250-mail.internal Hello [123.123.123.123] 292 250-SIZE 36700160 292 250-PIPELINING 292 250-DSN 292 250-ENHANCEDSTATUSCODES 292 250-AUTH GSSAPI NTLM LOGIN 292 250-8BITMIME 292 250-BINARYMIME 292 250 CHUNKING 292 SMTP>> MAIL FROM:j@j.com SIZE=1378 292 SMTP>> RCPT TO:j@j.com 292 SMTP>> DATA 292 SMTP<< 530 5.7.1 Client was not authenticated 292 LOG: MAIN 292 TLS error on connection to mail.internal [123.123.123.123] (recv): The TLS connection was non-properly terminated. 292 SMTP>> QUIT 292 LOG: MAIN 292 TLS error on connection to mail.internal [123.123.123.123] (send): The specified session has been invalidated for some reason. 290 LOG: MAIN 290 ** j@j.com R=smarthost T=remote_smtp_smarthost X=TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256 DN="CN=mail.internal": SMTP error from remote mail server after MAIL FROM:j@j.com SIZE=1378: host mail.internal [123.123.123.123]: 530 5.7.1 Client was not authenticated

oba11 commented 6 years ago

Looks more like the authentication method with exchange didnt work. Never tried it with exchange server so cant confirm if it works with it or not.

jukito commented 5 years ago

Same problem here.

¿Any good news?

Thanks!

timothyclarke commented 4 years ago

The issue is 292 250-AUTH GSSAPI NTLM LOGIN your exchange server is only advertising the harder or proprietary protocols as auth methods. They are

I don't know Exchange, but the generic response is

  1. Whitelist the IP range for sending without authentication (This could open your server to be a spam relay so only do it on internal networks where the whitelisted ip range is secure)
  2. Enable other possibly less secure authentication mechanisms. (AUTH PLAIN send the password as plain text, but it is within a TLS session)
  3. Extend the docker pod to add the spa or sasl authenticator for NTLM see https://github.com/Exim/exim/wiki/AuthenticatedSmtpUsingNTLM