ntopng icon indicating copy to clipboard operation
ntopng copied to clipboard

I cant send email from NtopNG

Open cabefe opened this issue 1 year ago • 6 comments

I have probed with differents configurations SMTP: Google, Microsoft, .... But NtopNG dont send email. Please, help me. Thanks.

cabefe avatar Jan 15 '24 14:01 cabefe

Hi @cabefe , Could you please provide the ntopng logs?

NicoMaio avatar Jan 15 '24 15:01 NicoMaio

I just set this up for the first time myself. Nothing worked until I entered the mail server address like this: "smtps://mail.domain.com". The mail server port should be 465, or whatever the server's SMTPS port is. It seems that ntopng does not do STARTTLS so I could not use my normal STARTTLS port 587. The documentation says nothing about any of this. I figured it out when I saw in the logs that ntopng was trying to send mail to "smtp://mail.domain.com" which meant it was trying to make a non-TLS connection, something that my server doesn't support.

dlk3 avatar Jan 19 '24 11:01 dlk3

Hi @cabefe , Could you please provide the ntopng logs?

19/Jan/2024 13:46:17 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 13:42:46 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 13:37:06 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 13:34:16 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 13:11:56 [notifications.lua:25] [recipients.lua:1159] ERROR Error while sending notifications via Informática IBIS Unable to send mails 19/Jan/2024 13:11:56 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 13:07:30 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 13:04:40 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 13:01:56 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 12:45:35 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:587/us.es): SSL connect error. Run ntopng with -v6 for more details. 19/Jan/2024 12:41:54 [Utils.cpp:2007] WARNING Unable to send email to (smtps://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 12:38:13 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 12:36:53 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:465/us.es): Timeout was reached. Run ntopng with -v6 for more details. 19/Jan/2024 12:31:06 [notifications.lua:25] [recipients.lua:1159] ERROR Error while sending notifications via Informática IBIS Unable to send mails 19/Jan/2024 12:31:06 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Failed sending data to the peer. Run ntopng with -v6 for more details. 19/Jan/2024 12:04:22 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Failed sending data to the peer. Run ntopng with -v6 for more details. 19/Jan/2024 11:59:55 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Failed sending data to the peer. Run ntopng with -v6 for more details. 19/Jan/2024 11:53:45 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Failed sending data to the peer. Run ntopng with -v6 for more details. 19/Jan/2024 11:34:15 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Failed sending data to the peer. Run ntopng with -v6 for more details. 19/Jan/2024 11:27:12 [notifications.lua:25] [recipients.lua:1159] ERROR Error while sending notifications via Informática IBIS Unable to send mails 19/Jan/2024 11:27:12 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Failed sending data to the peer. Run ntopng with -v6 for more details. 19/Jan/2024 11:26:12 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Failed sending data to the peer. Run ntopng with -v6 for more details. 19/Jan/2024 11:19:21 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Failed sending data to the peer. Run ntopng with -v6 for more details. 19/Jan/2024 11:03:42 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Failed sending data to the peer. Run ntopng with -v6 for more details. 19/Jan/2024 10:59:49 [Utils.cpp:2007] WARNING Unable to send email to (smtp://mail.us.es:587/us.es): Fa

cabefe avatar Jan 19 '24 12:01 cabefe

I just set this up for the first time myself. Nothing worked until I entered the mail server address like this: "smtps://mail.domain.com". The mail server port should be 465, or whatever the server's SMTPS port is. It seems that ntopng does not do STARTTLS so I could not use my normal STARTTLS port 587. The documentation says nothing about any of this. I figured it out when I saw in the logs that ntopng was trying to send mail to "smtp://mail.domain.com" which meant it was trying to make a non-TLS connection, something that my server doesn't support.

I think our server does not support port 465 :(

cabefe avatar Jan 19 '24 13:01 cabefe

You could check what ports the server supports by telneting to them. This will let you see if the port is open to connections. For example: telnet mail.us.es 465

EDIT On second thought, I went ahead and tested this myself. It looks like you are correct, port 465 isn't open on mail.us.es. Port 587 is the only working mail port I could find. That means ntopng would need to support STARTTLS to use that server and I don't think that it does. Try a different mail server perhaps?

ALSO From the log entries, it looks like you might not have the "Email Sender" value correct in the endpoint configuration. Some mail servers care about this and some don't. If your server cares then this might need to be a valid e-mail address in the form "[email protected]" not just "us.es". The client sends this to the mail server as part of its ELHO greeting. Some servers are configured to drop the connection if they can't validate this email address.

dlk3 avatar Jan 20 '24 04:01 dlk3

I just set this up for the first time myself. Nothing worked until I entered the mail server address like this: "smtps://mail.domain.com". The mail server port should be 465, or whatever the server's SMTPS port is. It seems that ntopng does not do STARTTLS so I could not use my normal STARTTLS port 587. The documentation says nothing about any of this. I figured it out when I saw in the logs that ntopng was trying to send mail to "smtp://mail.domain.com" which meant it was trying to make a non-TLS connection, something that my server doesn't support.

This resolved the issue for me, crazy they don't have this documented somewhere, I was troubleshooting for a while.

bigjohns97 avatar Jun 21 '24 14:06 bigjohns97

Yeah, me too. Also crazy that ntopng does not support STARTTLS. It's not that hard to implement..

jult avatar Aug 15 '24 12:08 jult