Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exchange Online SMTP Auth #46

Closed
hennibadger16 opened this issue Jul 31, 2023 · 14 comments
Closed

Exchange Online SMTP Auth #46

hennibadger16 opened this issue Jul 31, 2023 · 14 comments

Comments

@hennibadger16
Copy link

Hi there!

Looks really promising but I just can't seem to get mails running via Exchange Online SMTP Auth.

Has there been tested and verified?

Can you share a working setup? Or where to find some helpful logging as "docker logs" does not seem to catch it.

Much appreciated!

Thanks :)

@AlexBTurchyn
Copy link
Contributor

@hennibadger16 I was able to verify this because I don't have access to such type of SMTP Auth. You can share the error information and maybe I can help you after that

@hennibadger16
Copy link
Author

Hi,

yeah that's my problem. There is just nothing happening when trying to send a mail after putting in credentials. I can't seem to find a relevant logfile as "docker logs" does not log it. Can you tell me where to look?

Thank you!

@AlexBTurchyn
Copy link
Contributor

@hennibadger16 Try docker logs -f docuseal

@hennibadger16
Copy link
Author

Hi, that's all that seems related:

I, [2023-08-02T07:28:12.108577 #1] INFO -- : [ActiveJob] [ActionMailer::MailDeliveryJob] [bd226dce-c233-47ee-b830-37e1d2ddeb07] Performing ActionMailer::MailDeliveryJob (Job ID: bd226dce-c233-47ee-b830-37e1d2ddeb07) from Async(default) enqueued at 2023-08-02T07:28:12Z with arguments: "SubmitterMailer", "invitation_email", "deliver_now!", {:args=>[#<GlobalID:0x00007ff41d00dd18 @uri=#<URI::GID gid://docu-seal/Submitter/27>>, {:message=>"You have been invited to submit the \"Agreement | Local Administrative Permissions\" form:"}]} I, [2023-08-02T07:28:12.218916 #1] INFO -- : [053c22eb-a4b5-428b-8354-cbc22ea64d9d] {"method":"GET","path":"/templates/1","format":"turbo_stream","controller":"TemplatesController","action":"show","status":200,"duration":17.43,"view":10.73,"db":2.55,"fwd":"85.22.69.98"} E, [2023-08-02T07:28:17.265430 #1] ERROR -- : [ActiveJob] [ActionMailer::MailDeliveryJob] [bd226dce-c233-47ee-b830-37e1d2ddeb07] Error performing ActionMailer::MailDeliveryJob (Job ID: bd226dce-c233-47ee-b830-37e1d2ddeb07) from Async(default) in 5192.33ms: Net::ReadTimeout (Net::ReadTimeout with #<Socket:(closed)>): /usr/local/lib/ruby/3.2.0/net/protocol.rb:229:in rbuf_fill'
/usr/local/lib/ruby/3.2.0/net/protocol.rb:199:in readuntil' /usr/local/lib/ruby/3.2.0/net/protocol.rb:209:in readline'
/usr/local/lib/ruby/gems/3.2.0/gems/net-smtp-0.3.3/lib/net/smtp.rb:1057:in recv_response' /usr/local/lib/ruby/gems/3.2.0/gems/net-smtp-0.3.3/lib/net/smtp.rb:1051:in get_response'
/usr/local/lib/ruby/gems/3.2.0/gems/net-smtp-0.3.3/lib/net/smtp.rb:843:in block in auth_plain' /usr/local/lib/ruby/gems/3.2.0/gems/net-smtp-0.3.3/lib/net/smtp.rb:1067:in critical'
/usr/local/lib/ruby/gems/3.2.0/gems/net-smtp-0.3.3/lib/net/smtp.rb:842:in auth_plain' /usr/local/lib/ruby/gems/3.2.0/gems/net-smtp-0.3.3/lib/net/smtp.rb:837:in public_send'
/usr/local/lib/ruby/gems/3.2.0/gems/net-smtp-0.3.3/lib/net/smtp.rb:837:in authenticate' /usr/local/lib/ruby/gems/3.2.0/gems/net-smtp-0.3.3/lib/net/smtp.rb:670:in do_start'
/usr/local/lib/ruby/gems/3.2.0/gems/net-smtp-0.3.3/lib/net/smtp.rb:611:in start' /usr/local/bundle/gems/mail-2.8.1/lib/mail/network/delivery_methods/smtp.rb:109:in start_smtp_session'
/usr/local/bundle/gems/mail-2.8.1/lib/mail/network/delivery_methods/smtp.rb:100:in deliver!' /usr/local/bundle/gems/mail-2.8.1/lib/mail/message.rb:269:in deliver!'
/usr/local/bundle/gems/actionmailer-7.0.5/lib/action_mailer/message_delivery.rb:109:in block in deliver_now!' /usr/local/bundle/gems/actionmailer-7.0.5/lib/action_mailer/rescuable.rb:17:in handle_exceptions'
/usr/local/bundle/gems/actionmailer-7.0.5/lib/action_mailer/message_delivery.rb:108:in deliver_now!' /usr/local/bundle/gems/actionmailer-7.0.5/lib/action_mailer/mail_delivery_job.rb:23:in perform'
/usr/local/bundle/gems/activejob-7.0.5/lib/active_job/execution.rb:59:in block in _perform_job' /usr/local/bundle/gems/activesupport-7.0.5/lib/active_support/callbacks.rb:118:in block in run_callbacks'
`

@AlexBTurchyn
Copy link
Contributor

@hennibadger16 Your SMTP host is unavailable (5192.33ms: Net::ReadTimeout). First, make sure you have access to it. Here is this link you might find helpful.

@hennibadger16
Copy link
Author

yeah - that's working perfectly fine. Has of course been tested in advance :)

@AlexBTurchyn
Copy link
Contributor

@hennibadger16 I wish I could help you, but I'm out of ideas and can't reproduce this bug. Sorry 😞

@lordpayder
Copy link

lordpayder commented Sep 1, 2023

Hi, I'm also trying to setup smtp with Office 365, without success.

A few hours ago I setup another application (paperless-ngx) that required incoming E-Mails (IMAP) and struggled a bit with O365. I got it working using a email oauth2 proxy. This proxy also supports smtp, so I gave that a try, also without success.

I noticed in the proxy logs that the SMTP encoding is set to SMTPUTF8. I had to change the encoding for IMAP to US-ASCII to work in paperless-ngx, so my guess is the same encoding is required for SMTP too.

@Omnichannel-nz
Copy link

Omnichannel-nz commented Sep 26, 2023

No luck here either, even after setting up an M365 relay. Source.

I'm getting "SSL_connect returned=1 errno=0 peeraddr=104.47.71.202:25 state=error: wrong version number" when using [domain].mail.protection.outlook.com on port 25, plain authentication, and TLS.

SSL and Login authentication make no difference.

@AlexBTurchyn
Copy link
Contributor

AlexBTurchyn commented Oct 1, 2023 via email

@skyrunner15
Copy link

Similar error using AWS SES as the SMTP provider -> SSL_connect returned=1 errno=0 state=error: wrong version number

@phrz
Copy link

phrz commented Oct 15, 2023

I had this issue with M365 normally, with an Exchange Connector registered to my docuseal hostname, and with Fastmail (a completely different email provider with full SMTP support, unlike M365). I am curious what email providers docuseal has been tested against?

@Omnichannel-nz
Copy link

No luck here either, even after setting up an M365 relay. Source.

I'm getting "SSL_connect returned=1 errno=0 peeraddr=104.47.71.202:25 state=error: wrong version number" when using [domain].mail.protection.outlook.com on port 25, plain authentication, and TLS.

SSL and Login authentication make no difference.

I should mention that this is now resolved. Fix implemented by Docuseal to remove username/password requirement, no longer mandatory so that IP Whitelist M365 SMTP Relay could operate without account credentials. (Source)

@omohokcoj
Copy link
Contributor

Looks like those issues with Outlook are not related to the app but to SMTP misconfigurations (wrong port/auth).
Also SMTP should be enabled in office365 by the organization admin.
Closing since the issue is not related to the app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants