Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
4.19k stars 563 forks source link

SMTP issues with Office365 #1817

Closed LostSoulfly closed 8 months ago

LostSoulfly commented 4 years ago

Here's my config: image

I do not need to specify a username or password. We use SPF records and "direct send" which limits verified senders to specific IP addresses and only specific hosts on the network are allowed to send to port 25. The issue is not authentication, I assure you. This same host has services sending mail just fine.

This address is not pingable, however (by design).

The docker container that houses Meshcentral has internet access, however: image

This is all I get when I do a email trace: image

Nothing else appears in the trace log!

Please help!

Ylianst commented 4 years ago

MeshCentral uses 'nodemailer', you can find about the details about this module at: https://nodemailer.com/about/. A quick search shows there are various reports of issues with Office365, but I am not sure what would apply in your case.

You would probably need to look at making changes to 'meshmail.js' in MeshCentral, near the top of this file there is 'options' you could change and report back what works for you.

Since I can't replicate your situation, not sure how much more I can help.

LostSoulfly commented 4 years ago

Can you help me understand why checkEmail is returning false? Do I just need to hard-code it to be true? It doesn't even attempt to send an email at all. https://github.com/Ylianst/MeshCentral/blob/d31d371cd2609d9f7a981bf78f543a64bb51854d/meshmail.js#L152

Ylianst commented 4 years ago

That line check that MeshCentral can correctly connect to the mail server. It returns false if its can't indicating that the SMTP settings are not correct. You are free to force it to true but it's very much unlikely that any outbound email will even work because when sending an email, MeshCentral will try to connect to the SMTP server and the connection will likely again fail.

OutbackMatt commented 3 years ago

Try using port 587 rather than port 25

LostSoulfly commented 3 years ago

Try using port 587 rather than port 25

Unfortunately not an option for my environment.

OutbackMatt commented 3 years ago

You can, if you use option 1, and use a username and password

Also, even thought you have tls = disabled, the connection will try StartTLS connections if offered, and Outlook.com will offer that. Make sure that you have set your MesshCentral server to use TLSv1.2 or higher

https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365#option-1-recommended-authenticate-your-device-or-application-directly-with-a-microsoft-365-or-office-365-mailbox-and-send-mail-using-smtp-auth-client-submission

LostSoulfly commented 3 years ago

I appreciate your input but option 1 requires signing in with an account which requires allocating a license. It's not worth contacting my vendor to purchase an additional license. Additionally, every other project or service I've used can support options 2 and 3 except the library used by MeshCentral. Those are free options and I am using direct send with the same exact settings on half a dozen other services as I type this message all on the same host.

A far easier solution was to just forego SMTP altogether sadly.

si458 commented 8 months ago

closing as stale, please try updating to the latest version 1.1.21 and use node 18 or above, if issue persists, please reply back