Deliverability

[SSL: WRONG_VERSION_NUMBER] Postmark SMTP in Odoo: the fix

Odoo raises this error when it starts an implicit SSL handshake on a port that speaks plain SMTP first. For Postmark, use smtp.postmarkapp.com on port 587 with TLS (STARTTLS) as the connection security, not SSL. If it persists, test the connection from a shell on the Odoo server.

Sohail HussainSohail Hussain8 min read

Short answer

  • Odoo is starting TLS the instant it connects, but Postmark's SMTP port speaks plain SMTP first and upgrades later.
  • In your Odoo outgoing mail server, set SMTP Port to 587 and Connection Security to TLS (STARTTLS), not SSL/TLS, then click Test Connection.
  • Do not switch to port 465. Postmark does not support it.

You added Postmark as an outgoing mail server in Odoo, clicked Test Connection, and got this:

[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:852)

The message sounds like a TLS version problem. It usually is not. The two sides disagree about how encryption starts, and the fix is a settings change in Odoo.

Why it happens

Python's ssl module raises this error and Odoo only displays it. Python sent a TLS ClientHello and got back bytes that did not look like a TLS record. From an SMTP server, those bytes are almost always the plain-text greeting, a line that starts with 220.

SMTP has two ways to encrypt:

  • Implicit TLS (labeled SSL or SSL/TLS in many apps): TLS begins as soon as the TCP connection opens. It needs a port that only accepts TLS, usually 465.
  • STARTTLS: the connection opens in plain text and the client then sends a STARTTLS command to upgrade. RFC 3207 defines this extension.

Postmark supports STARTTLS on ports 25, 2525, and 587, and the connection starts plain and upgrades to a secure one. Postmark does not support port 465 (implicit SSL) and tells you to use port 587 with STARTTLS instead. If Odoo's Connection Security is set to SSL/TLS, Odoo starts a handshake against a port that is waiting to say hello in plain text, and the handshake fails with this error.

The same error appears with any provider when the mode and port disagree, so it is not a sign that Postmark is down. I could not find a confirmed fix for this exact Postmark and Odoo case in a vendor source. The fix below follows from Postmark's documented ports and from how SMTP works, and the test commands later let you confirm it in a minute.

Step-by-step fixes

Fix 1: use STARTTLS on port 587

  1. In Odoo, open Settings > Technical > Outgoing Mail Servers. Turn on developer mode if Technical is hidden.
  2. Open the Postmark record, or click New to create one.
  3. Set SMTP Server to smtp.postmarkapp.com.
  4. Set SMTP Port to 587.
  5. Set Connection Security to TLS (STARTTLS).
  6. Fill in Username and Password (see Fix 2).
  7. Save, then click Test Connection.

Labels differ a little between Odoo versions. The three fields that matter are server, port and connection security.

Do not switch to port 465

Some generic SMTP guides say to use port 465 with SSL/TLS. Postmark does not support that port, so the change swaps one error for a connection failure. Stay on 587 with STARTTLS.

Fix 2: use the right Postmark credentials

Once TLS works, the next failure is usually authentication. With the API Token option, the Server API Token acts as both the Username and the Password. The Server Token is in your Postmark account under Server > API Tokens.

The alternative is an SMTP Token. It has an Access Key (the username) and a Secret Key (the password), and the Secret Key is not visible after it is generated. If you lose it, generate a new token.

Fix 3: check the host and the sender address

  • Type the host exactly as smtp.postmarkapp.com, with no https:// prefix and no trailing space.
  • Postmark uses smtp-broadcasts.postmarkapp.com for broadcast messages and smtp.postmarkapp.com for transactional ones. Use the host that matches the message stream your credentials belong to.
  • The From address must be added to your Postmark account as a Sender Signature. A rejected sender shows up after TLS succeeds, as a normal SMTP error and not this one.

Fix 4: test from the Odoo server

Run these on the machine that hosts Odoo, not your laptop, because firewalls differ. Postmark's connection-error guide gives this STARTTLS test. Details are in Postmark's common SMTP connection errors page.

openssl s_client -starttls smtp -connect smtp.postmarkapp.com:587

A working setup prints a certificate chain and then waits. To reproduce your Odoo error on purpose, try implicit TLS against the STARTTLS port:

openssl s_client -connect smtp.postmarkapp.com:587

That should fail with wrong version number, which confirms the diagnosis. To see the plain greeting yourself:

nc smtp.postmarkapp.com 587

A response starting with 220 means the port is open and the connection is working. It also shows that Odoo must use STARTTLS on that port.

Which symptom means which cause

Symptom in OdooLikely causeFix
WRONG_VERSION_NUMBERSSL/TLS selected on a STARTTLS portChoose TLS (STARTTLS) on 587
Connection fails on port 465Postmark does not support 465Use 587 with STARTTLS
Timeout or hangPort blocked by host or firewallTry 2525 or 587
535 authentication errorWrong username or passwordUse the Server API Token or an SMTP Token pair
Rejection after loginFrom address not a Sender SignatureAdd and confirm the sender in Postmark
Same error after the changeAnother outgoing server record used firstCheck Priority and edit the right record

When the settings are right and it still fails

  • Blocked ports. If a connection hangs at "Connecting...", the port is blocked by your firewall or ISP. Postmark supports ports 25, 2525 and 587, and 2525 is designed to bypass the common blocks on port 25. Try 2525 with STARTTLS.
  • A proxy or TLS-inspecting appliance in front of the Odoo server can return non-TLS data. Test from a different network to rule it out.
  • An old TLS stack. Postmark requires TLS v1.1 or higher. A very old self-hosted server, or a client pinned to an old version, can fail to connect.
  • The wrong record. Odoo can hold several outgoing servers, and it tries the one with the lowest Priority number first. Make sure it is the one you edited.

Checklist before you test again

  • SMTP Server is smtp.postmarkapp.com
  • SMTP Port is 587 (or 2525)
  • Connection Security is TLS (STARTTLS)
  • Username and password are the Server API Token (both fields) or an SMTP Token pair
  • The From address is a confirmed Sender Signature or on a verified domain
  • The openssl s_client -starttls smtp command works from the Odoo server

If nothing works

If the openssl test succeeds from the Odoo server but Odoo still fails, the problem is on the Odoo side, so ask your Odoo host or integrator. If openssl fails on ports 587 and 2525 too, contact Postmark support. Include the exact error, the time of the attempt, the host, port and connection-security mode, your Odoo version, and the openssl output.

Subject: SMTP connection from Odoo fails on smtp.postmarkapp.com:587

Hello,

Odoo cannot send through Postmark SMTP. Test Connection returns:
[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:852)

Settings: host smtp.postmarkapp.com, port 587, Connection Security
TLS (STARTTLS). Odoo version: {version}. Server IP: {ip}.
Time of last attempt (UTC): {timestamp}

Output of "openssl s_client -starttls smtp -connect smtp.postmarkapp.com:587"
from the Odoo server is attached. I have also tried port 2525.

Please check whether anything on your side is rejecting the connection.
Thank you.

Common questions

Does this mean Postmark is down?

No. This error comes from a mismatch between Odoo's encryption setting and the port, so it is a configuration issue on your side. An outage would more likely show up as timeouts or 4xx and 5xx SMTP replies.

Can I use SSL/TLS on port 465 with Postmark?

No. Postmark does not support port 465. STARTTLS on 587 is still encrypted once the upgrade completes. Postmark says tokens and content are encrypted in transit over that connection. See Postmark's SMTP details article.

Why does Odoo call it TLS (STARTTLS) and not just TLS?

Because there are two different mechanisms. SSL/TLS in Odoo means encryption from the first byte, and TLS (STARTTLS) means start in plain text and upgrade. Our guide to SSL/TLS for SMTP covers both, and the SMTP glossary entry explains the basics.

Will the same fix work for other providers?

The principle does: match the mode to the port. The ports differ by provider, so check which port each one documents for which mode, and do not copy the mode from another provider's setup guide.

deliverabilitypostmark-smtp-odooerror-codes
Share this article
Sohail Hussain

Sohail Hussain

Founder & CEO at Mailneo

Building Mailneo — AI-powered email marketing for growing businesses.

Related Articles

Deliverability

0x800ccc0e: Outlook Unable to Connect to SMTP Server, Fixed

Outlook error 0x800ccc0e means the app could not open a connection to your outgoing (SMTP) server. Usually the port, encryption setting or password is wrong, or antivirus, a firewall or your ISP is blocking it. Set port 587 with STARTTLS, turn on SMTP authentication, and test again.

Sohail Hussain|10 min read
Deliverability

SocketLabs "421 4.5.1 Too many errors" blacklist: how to fix it

`421 4.5.1 Too many errors, you have been temporarily blacklisted` means a SocketLabs server saw repeated auth or bad-address errors from your IP and paused it. Stop whatever is retrying, fix credentials and invalid recipients, clear the queue, and wait. The block usually lifts within minutes, but returns if retries resume.

Sohail Hussain|9 min read
Deliverability

421-4.7.0 Gmail Has Detected This Message Is Suspicious: Fix

The 421-4.7.0 "suspicious due to the nature of the content and/or the links" error means Gmail's content filter rejected your message after DATA, not an authentication check. Remove click tracking or move it to your own domain, drop URL shorteners, check link reputation, then retest with a plain message.

Sohail Hussain|10 min read
Deliverability

421 4.7.0 IP not in whitelist for RCPT domain: what it means

The error 421 4.7.0 IP not in whitelist for RCPT domain means the recipient's mail gateway, usually Mimecast in reports, only accepts connections from approved IPs, and the Google sending IP isn't on that list. The fix is on the recipient side: their admin must allow the IPs or change the mail routing.

Sohail Hussain|9 min read

Ready to supercharge your email marketing?

Start sending smarter emails with AI-powered campaigns. No credit card required.

Get Started Free