0

I have recently migrated the mail sending process from php (using PHPMailer) to a newer and optimized Nodejs backend (using Nodemailer).

And this was a semi-successful miragration, as for the most part Nodemailer is able to successfully send the emails throughgmail.com and some other specific proprietary domains.

However, I have tested some client configurations that just won't work, some also from specific proprietary domains and one fromoffice365.com.

As the title mentions, the error I come across isssl3_get_record:wrong version number.
I have read multiple posts regarding this issue and tried various suggested configurations, all to no effect.
My connection request, with all the basic host, port, auth username and password settings, additionally include the following:

request = {  ..  requireTLS:           true,  ignoreTLS:            false,  tls: {    ciphers:            'TLS_AES_128_GCM_SHA256',    minVersion:         'TLSv1.2', // advisable TLS 1.2 or higher    rejectUnauthorized: false,  },}

Additionally I tried the followingtls settings, although not advised for a prodution environment, but I figured it was worth the try just to see if it would work:

  tls: {    ciphers:            'ALL',    minDHSize:          512,    minVersion:         'TLSv1',    maxVersion:         'TLSv1.3',  }

Every try and configuration combination I have tried, all resulted in thessl3_get_record:wrong version number error.

The thing is that PHPMailer was able to work with these accounts..
..all except for theoffice356.com one, if I recall correctly.

Could it be that PHPMailer is less secure and somehow bypasses this issue by sending in the information in a generalized manner that servers would just gobble up, no questions asked?

Honestly I am running out of ideas.
I find it hard to believe a more recent package like Nodemailer gets stuck in something like this, while PHPMailer is apparently able to work around it - somehow.

Any help will be greatly appreciated.
Thanks in advance.

askedSep 23 at 10:51
mformigo's user avatar
3
  • Please provide the exact code you use, not just the fragments you consider relevant. Relevant details are for example the exact host (there is no host office365.com, maybe smtp.office365.com?) and port (25, 465, 587), ...CommentedSep 23 at 16:39
  • Hello @SteffenUllrich, You are right, I should have been more specific. I knowoffice365.com is not the host, I was just refering to the domain. The host in the configuration is indeedsmtp.office365.com, with port 587 andsecure: false setting. I have come to understand that port 587 and 25 inherently use STARTTLS, which requires thesecure: false setting in Nodemailer's createTransport(..) method. Regarding port 465, it uses Implicit TLS, which requires thesecure: true setting in Nodemailer's createTransport(..) method.CommentedSep 24 at 15:53
  • So, using a port with the wrongsecure value setting would always result in thessl3_get_record:wrong version number - error that in itself is a bit misleading as to the cause. As of now I have seem to been able to work around as I am no longer getting that error, but stumbled into another smtp snap, which I am currently trying to understand and resolve - this one all indicates is specific to 'office365.com' - before I enventually publish a response here to answer the question and clarify future similar issues.CommentedSep 24 at 16:00

0

Know someone who can answer? Share a link to thisquestion viaemail,Twitter, orFacebook.

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.