question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SMTP Protocol Error

See original GitHub issue

Hello guys,

we are using the proxy for IMAP to get messages from the mailbox, which is working fine. Now we are trying to send mails using smtp und we get a smtp protocal error.

Nov 2 10:51:32 shdeaahrocop01 Email OAuth 2.0 Proxy: New incoming connection to SMTP server at 192.168.16.8:1587 (unsecured) proxying smtp.office365.com:587 (SSL/TLS) Nov 2 10:51:32 shdeaahrocop01 Email OAuth 2.0 Proxy: Accepting new connection to SMTP server at 192.168.16.8:1587 (unsecured) proxying smtp.office365.com:587 (SSL/TLS) via (‘192.168.14.75’, 41770) Nov 2 10:51:32 shdeaahrocop01 Email OAuth 2.0 Proxy: SMTP (192.168.16.8:1587; 192.168.14.75:41770->smtp.office365.com:587) --> [ Client connected ] Nov 2 10:51:32 shdeaahrocop01 Email OAuth 2.0 Proxy: SMTP (192.168.16.8:1587; 192.168.14.75:41770->smtp.office365.com:587) <-> [ Starting TLS handshake ] Nov 2 10:51:32 shdeaahrocop01 Email OAuth 2.0 Proxy: Caught connection error in SMTP (192.168.16.8:1587; 192.168.14.75:41770->smtp.office365.com:587) - you have set local_certificate_path and local_key_path; is your client using a secure connection? Error type <class 'ssl.SSLErro>

All settings I can see are right. The connection between the sending client and the proxy is without tls or ssl. It seems like the error is while connecting to m365,

Do you have any idea or am I missing something?

For better understanding: Client: 192.168.14.75 oAuth Proxy: 192.168.16.8

The account settings are working fine for imap.

Kind regard André

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andre13794commented, Nov 3, 2022

Thanks. Did the trick. I thought this parameter was set so that the client needs to use starttls to connect to the oAuth Proxy.

0reactions
simonrobcommented, Nov 3, 2022

Ah – you’ve removed the STARTTLS setting from the example configuration file for some reason. The proxy used to detect this, but it is more complex now with the added support for various SSL configurations. I’ll think about how this could be achieved again.

Office 365’s SMTP server uses STARTTLS, and because the proxy needs to intercept the connection, it has to handle this on your behalf (see the readme). Re-adding starttls = True will fix this:

[SMTP-1587]
local_address = 192.168.16.8
server_address = smtp.office365.com
server_port = 587
starttls = True
Read more comments on GitHub >

github_iconTop Results From Across the Web

SMPT Error Codes: What They Mean - SocketLabs
If there is a communication error, you will receive an SMTP error code — a message that indicates the specific problem; like the...
Read more >
About SMTP error messages - Google Workspace Admin Help
SMTP is an internet standard used by mail servers to send and receive email. SMTP error messages help you understand why a message...
Read more >
SMTP errors and reply codes - turboSMTP
SMTP errors and reply codes ; 111. Connection refused or inability to open an SMTP stream. This error normally refers to a connection...
Read more >
What is SMTP and understanding the error codes - Prolateral
Every time an email is sent using SMTP the receiving server will respond with an SMTP error code. Not all SMTP error codes...
Read more >
smtp protocol error on HP LaserJet M4555 MFP - HP Community
My HP LaserJet M4555 MFP stopped scanning to user emails giving SMTP protocol error. Other printers connected to the same SMTP address on ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found