SMTP for group : ssl wrong version number error


I’m trying to implement SMTP for groups but I keep getting the following error message.

Yet I’m using the same smtp server the instance uses and I get the same error message even if I use the same credentials specified in my app.yml file… I don’t understand why it’s behaving differently : emails are sent perfectly with the default credentials.

In the logs of my SMTP server I see a connection coming from Discourse server, then I have the following message

smtp bad-input result=“500 5.5.1 Invalid command: Pipelining not supported”
smtp disconnected reason=“io-error: Connection reset by peer”

1 Like

I suspect Discourse is attempting to connect to the SMTP server with TLS instead of STARTTLS.

Can you screenshot the relevant settings?

Please do redact specific hostnames and usernames but leave port information and other settings.

1 Like

Configuration is rather classic : usual 587 port and starttls is true (default value)

general configuration :

for group smtp :

I’ve been doing some tcpdump to see whats going on and I’m noticing 3 different behaviors. For the first two cases, it’s exactly as described in this thread.

  1. Normal usage

Users creates topics, responds, etc. other users receive email notifications as expected
Also, using the test send email through the administration interface : no problem it’s well sent and well received

with tcpdump we can see there is a correct sequence, connecting through STARTTLS, etc.

  1. Discourse-doctor and rake

using discourse-doctor or rake emails:test
Email is not sent and I have an error : 503 5.5.1 Invalid command: Command not supported

  1. group smtp

When testing the group smtp, I see a “DATA fragment” packet coming from Discourse immediatly after the tcp handshake, to which the smtp server responds with 220 xxxxxxx ESMTP OpenSMTPD followed by a 500 5.5.1 Invalid command: Pipelining not supported message

1 Like

587 will support STARTTLS but not TLS (at connect time).

We should amend the options here to allow STARTTLS.

If you uncheck “Use SSL for SMTP” does it work?

Unfortunately, no it doesn’t work.
unchecking “Use SSL for SMTP” gives me the following error message :

Which is strange because I know my credentials are correct.

Looking with tcpdump, it behaves like I’ve explain for the “Discourse-doctor and rake” case.
The exchanges between Discourse and the smtp server looks like the following

< 220 [redacted] ESMTP ready
> EHLO [redacted]
< 250-[redacted]
< 250-SIZE 36700160
< 250-8BITMIME
> AUTH PLAIN [redacted]
< 500 5.5.1 Invalid command : commande not supported

It’s as though Discourse is not trying to initiate STARTTLS ; It’s exactly as described in the post I’ve linked to in my previous post.

I’m now having the same issue as I try to configure Discourse SMTP to work with an ImprovMX email address.

Any thoughts @supermathie?