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
4k stars 540 forks source link

Not showing email notification in my server #4648

Closed bravery-only closed 1 year ago

bravery-only commented 1 year ago

Meshcentral

Meshcentral

My Server My Server

How can I activate the email notification?

bravery-only commented 1 year ago

I Enabled SMTP and this page is shown when I login. I do not receive an email for confirmation,. Help me @Ylianst

2 1

vithusel commented 1 year ago

Are you connecting to your own personal server or using a provider? (365, google)

bravery-only commented 1 year ago

own personal server

personal server

bravery-only commented 1 year ago

I use Windows Server

vithusel commented 1 year ago

Sorry i meant for your SMTP.

Are you connecting to a hosted service such as Gmail or Outlook or are you hosting your own email server?

Can you send a copy of your SMTP settings (Hide anything personal)

bravery-only commented 1 year ago

"smtp": { "host": "smtp.gmail.com", "port": 465, "from": "my email@gmail.com", "user": "my email@gmail.com", "pass": "xxxxxxxxxxxxxxxxxxxxxxx", "_verifyEmail": false, "tls": true },

The interesting thing is that when I add this code, after restarting Mesh Central, this code ( "verifyEmail": false,)is deleted!! I also tested with port 587 and it didn't work.

PathfinderNetworks commented 1 year ago

Gmail requires OAuth to send email through their SMTP servers. I can't recall if Ylian has built in any functionality to support that? Edit: see this discussion for what you will need to do. https://github.com/Ylianst/MeshCentral/issues/3744

vithusel commented 1 year ago

You can use App Passwords with gmail which circumvents the need for Oauth.

Look at the below link to generate a App password.

https://www.febooti.com/products/automation-workshop/tutorials/enable-google-app-passwords-for-smtp.html

or

https://support.google.com/mail/answer/185833?hl=en-GB

bravery-only commented 1 year ago

I got App Passwords . Do you have a sample syntax for this?

bravery-only commented 1 year ago

I activated the email, but when the agent is Coneccted & Disconnected, the notification is received very late. Or email is not received!

bravery-only commented 1 year ago

It takes 5 minutes to receive the email. How to change its time? Which file should I edit?

vithusel commented 1 year ago

Thats odd. Meshcentral sends the email immediately.

@Ylianst any chance the server keeps trying to send an email or does it push to smtp once then quit?

If so then gmail is the likely culprit here. Can you paste the message header in here from the email you recieved? Gmail can be very picky about emails and what they class as junk etc. The message header typically holds enough logs to verify if thats the issur.

bravery-only commented 1 year ago

When I send an email from here, it is received immediately. Email

But when connecting and disconnecting the agent, it takes time - 4-5 minutes!!!

bravery-only commented 1 year ago

I saw the video of the email server. Here, the time to send the email when the device is connected is said to be 5 minutes. Then it can be said to be one minute. Where can I set this time? Mail Server Thank you @Ylianst

bravery-only commented 1 year ago

In the training video, you talk about starting the timer. The timer is on 5 minutes. How can I reduce the timer time? Which file should I edit?@Ylianst

bravery-only commented 1 year ago

After a few hours I was able to find the timer and changed the email receiving time to 6 seconds

brahunafisk commented 1 year ago

After a few hours I was able to find the timer and changed the email receiving time to 6 seconds

Where did you find this at? I've been looking everywhere.

silversword411 commented 1 year ago

Where did you find this at? I've been looking everywhere.

Well start with the video https://youtu.be/-L0-xjbWZJI?t=881

You know there's a help command emailnotifications to show you the notification queue, so look for that.

You'll see it's calling deviceNotifications

Looks like it's in meshmail.js

Trying to match this online with my local vscode copy (all the above searching is done locally in vscode because github search sucks)

and while I'm trying to find the code online to send a link

https://github.com/Ylianst/MeshCentral/blob/master/meshmail.js#L29

Looks like there's a recent change to the file...look at what Santa is bringing you for Christmas

https://github.com/Ylianst/MeshCentral/commit/7002ce1ea29e1bcc30321deacba0941c186d55d8