eMail (Google mail) event notification issues

#1

Hi

I have version 22.0.3 of Horizon. this is a new install and I am having problems receiving events via eMail (google email). I had this working on an older version of horizon. but now I can’t seem to get this working my new install. I am not sure where it is failing. I am wondering if someone cant point me to see where this is failing… thanks

Here is what I have done.

I have set notices to on

All event notifications in “/admin/Configuration Notifications/Event Notifications” are enabled

I have configured “Configure Destination Paths” to send email to my gmail account

Here is my "javamail-configuration.properties file

##############################################################################
# This file is the configuration for the the JavaMailer class.  It is used to
# specify the details of the JavaMailer system properties
################################################################################
#
# Properties are defined but commented out indicating the default values.
#

#
# This property defines system sender account.
#
# The default setting is root@[127.0.0.1]
#org.opennms.core.utils.fromAddress=root@[127.0.0.1]
org.opennms.core.utils.fromAddress=admin@talgor.host.local
#
# These properties define the SMTP Host.
#
org.opennms.core.utils.mailHost=127.0.0.1
#org.opennms.core.utils.mailer=smtpsend
#org.opennms.core.utils.transport=smtp
#org.opennms.core.utils.debug=true
org.opennms.core.utils.smtpport=25
#org.opennms.core.utils.smtpssl.enable=false
#org.opennms.core.utils.quitwait=true
#
# This property controls the use of the JMTA
# if it is true, mailHost will be ignored
org.opennms.core.utils.useJMTA=false
#
# These properties define the Mail authentication.
#
#org.opennms.core.utils.authenticate=false
#org.opennms.core.utils.authenticateUser=opennms
#org.opennms.core.utils.authenticatePassword=opennms
#org.opennms.core.utils.starttls.enable=false

#
# These properties configure message content
#
#org.opennms.core.utils.messageContentType=text/plain
org.opennms.core.utils.transport=smtps
org.opennms.core.utils.mailHost=[smtp.gmail.com](http://smtp.gmail.com)
org.opennms.core.utils.smtpport=465
org.opennms.core.utils.smtpssl.enable=true
org.opennms.core.utils.authenticate=true
org.opennms.core.utils.authenticateUser=[user@gmail.com](mailto:user@gmail.com)
org.opennms.core.utils.authenticatePassword=######
org.opennms.core.utils.starttls.enable=false
org.opennms.core.utils.messageContentType=text/html
org.opennms.core.utils.charset=UTF-8
#org.opennms.core.utils.charset=us-ascii
0 Likes

#2

Take a look at the following article. It is recommended to keep the default setting and let the built in Postfix server route messages based on the MX records of your mail server.

https://wiki.opennms.org/wiki/Why_using_the_default_javamail-configuration.properties_file_is_a_good_idea

0 Likes

#3

thanks I will take a look at this… although i sorry to say I am not familiar with postfix… lol

0 Likes

#4

Built into most Linux and just works without config.

0 Likes

#5

Thanks for helping me out. I appreciate this… looking at the document you referenced… one thing, my setup is a small home office setup and very simple… I would like to use the javamail api instead I believe postfix… Does the default install of Horizen install the javamail api? Looking at some of the Opennms documentation it appears so but I am not sure… Thanks for help on this… much appreciated

FYI also note… The document you listed is in a category marked “obsolete” so I am hesitant to try this

0 Likes

#6

The concept of that article is still valid. A typical, clean install of Horizon on a Linux server should be able to send e-mail notifications without modifying the javamail settings - should just setup the destination paths and event notifications.

0 Likes

#7

sorry for my ignorance… so reading from that document… what should I put for the following statement
“relayhost = [an.ip.add.ress]” is this the smtp server for google? How does this way authenticate my google account name and password as required by google (including SSL port)…

Also looking at the javamail-configuration.properties" file, I am not sure if there a bug because I originally had the following statement " org.opennms.core.utils.mailHost=smtp@gmail.com" which was incorrect and changed it to “…smtp.gmail.com” and If I look at notifd.log file I still see the following exception. (after closing down opennms and rebooting server)
Caused by: java.net.UnknownHostException: smtp@gmail.com
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) ~[?:1.8.0_181]

0 Likes

#8

I notice you have two host and port statements. Try taking out all your custom settings and see if mail works.

0 Likes

#9

here is what I have done… regarding this file…

# This property defines system sender account.
#
# The default setting is root@[127.0.0.1]
#org.opennms.core.utils.fromAddress=root@[127.0.0.1]
org.opennms.core.utils.fromAddress=admin@talgor.something.local
#
# These properties define the SMTP Host.
#
#org.opennms.core.utils.mailHost=127.0.0.1
#org.opennms.core.utils.mailer=smtpsend
#org.opennms.core.utils.transport=smtp
#org.opennms.core.utils.debug=true
#org.opennms.core.utils.smtpport=25
#org.opennms.core.utils.smtpssl.enable=false
#org.opennms.core.utils.quitwait=true
#
# This property controls the use of the JMTA
# if it is true, mailHost will be ignored
org.opennms.core.utils.useJMTA=false
#
# These properties define the Mail authentication.
#
#org.opennms.core.utils.authenticate=false
#org.opennms.core.utils.authenticateUser=opennms
#org.opennms.core.utils.authenticatePassword=opennms
#org.opennms.core.utils.starttls.enable=false

#
# These properties configure message content
#
#org.opennms.core.utils.messageContentType=text/plain
org.opennms.core.utils.transport=smtps
org.opennms.core.utils.mailHost=smtp.gmail.com
org.opennms.core.utils.smtpport=465
org.opennms.core.utils.smtpssl.enable=true
org.opennms.core.utils.authenticate=true
org.opennms.core.utils.authenticateUser=user@gmail.com
org.opennms.core.utils.authenticatePassword=#######
org.opennms.core.utils.starttls.enable=false
org.opennms.core.utils.messageContentType=text/html
org.opennms.core.utils.charset=UTF-8
#org.opennms.core.utils.charset=us-ascii
0 Likes

#10

Man!!! finally go this to work… I am not sure if this solved the problem… but here is what I did…
changed the " org.opennms.core.utils.mailHost=smtp.gmail.com" to a bogus smtp server, shutdown opennms server. added correct smtp server, shutdown opennms services, rebooted and now working…

thanks again for your help

2 Likes

#11

I forgot to ask if you tried turning it off and back on again. :smiley: Glad it is working now.

0 Likes

#12

Please can you share your configuration file

0 Likes