nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
846 stars 145 forks source link

Are options secure, allowInsecureAuth, authMethods, disabledCommands ['STARTTLS'] complementary ? #134

Closed ceraz68 closed 4 years ago

ceraz68 commented 4 years ago

I have two test clients connecting with [‘PLAIN’, ‘LOGIN’] authentication using basic passwords (testusr/testpassword) without using certificates. One client connects successfully when options.secure=true (the client cannot disable SSL/TLS authentication). The other client can connect when options.secure=false (the client can only enable/disable SSL nothing about TLS support).

Maybe you can help me if I've understood the smtp-server options correctly so that both can connect.

Question 1: So by default the server accepts incoming connections over TLS only. Correct?

Question 2: Setting options.secure= true and options.disabledCommands ['STARTTLS'] would appear to be contradictory. The wiki doesn't explain if there is any difference between options.secure and STARTTLS or whether one setting is priority of over the other. Can someone explain if there are any differences?

Question 3: Does allowinsecureAuth work in relation to options.secure, the STARTTLS command or both?

Thanks for your help

ceraz68 commented 4 years ago

I post my conclusions in case someone needs some input. Thanks for this great product.

The client support wasn't documented which made be question the options. By trial and error I discovered that one client only supports secured connections and no STARTTLS while the other client only supports insecure connections or secured via STARTTLS. In the end I was forced to run two SMTP servers on different port numbers like 2525 etc

My conclusion is that if secure is true, the server will refuse clients that only support STARTTLS.

=== My tests ====

If secure is true:

If secure is false