Configuring sending email on Alert creation (NetXMS + hMailServer)

Started by Azur, June 10, 2022, 10:56:22 AM

Previous topic - Next topic

Azur

Hi everyone.
Hope you are having a great day, and the weekend will be even better !

I am trying to set up email notifications every time a specific alarm is logged. The alarm it self does get logged in NetXMS but I am stuck at sending this alarm to my gmail.

I am aware NetXMS does not support SMTP authentication so I have set up hMailServer locally on the same server as where NetXMS is located.
I am not sure if my hMailServer configuration is wrong, or I am doing something wrong in the NetXMS it self but I keep getting "Driver error" in Notification Channels inside NetXMS.

I am posting pictures of NetXMS configuration and hMailServer hoping those will help you understand the issue.

Thank you in advance,
Azur

Filipp Sudanov

If you double-click on the notification channel, what settings will be available there?

Azur

Thanks for the quick reply.
Here :
Server=localhost
RetryCount=5
Port=25
LocalHostName=IT-SERVER
FromName=NetXMS Server
[email protected]
MailEncoding=utf8
IsHTML=yes

Filipp Sudanov

Configuration looks correct (except for RetryCount=5 - it's now taken from a global server variable).

Most probably there is some issue with your mail relay software. I've successfully used https://sourceforge.net/projects/emailrelay/, you may try this as well.

You can simply test your email relay like this:

telnet localhost 25
EHLO localhost
MAIL FROM: <[email protected]>
RCPT TO: <[email protected]>
DATA
From: [email protected]
To: [email protected]
Subject: test email

test body
.
quit

Filipp Sudanov

Also, for testing you can use Tools->Send notification menu.

Azur

I tried testing it via Send notification menu, and I get the notification saying "Notification to [email protected]" has been enqueued.

I checked the hMailServer logs -> everything looks fine there as if the message goes through.

I still do not get the email to my inbox.

Any suggestions ?


Victor Kirhenshtein

From what you show it looks like mail relay successfully received mail from netxmsd, so if you didn;t receive it it was either not sent by relay, or rejected/dropped by receiving server. Do you have any logs from relay regarding forwarding of this mail?

Best regards,
Victor

Azur

Hi,

Yes, the problem was in the mail Server itself.
I have added a gmail to the mail Server while desperately trying to send the email to it.
Do not add your real-emails to mail servers.
That solved my problem.

Thanks for all the help,
cheers.