Hi everyone i’m trying to setup the mail action addon receiving error
23:10:20.504 [ERROR] [rg.openhab.action.mail.internal.Mail] - Could not send e-mail to 'sXXXXX4@live.com'.
org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:587
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1421)
at org.apache.commons.mail.Email.send(Email.java:1448)
at org.openhab.action.mail.internal.Mail.sendMail(Mail.java:157)
at org.openhab.action.mail.internal.Mail.sendMail(Mail.java:89)
at org.openhab.action.mail.internal.Mail.sendMail(Mail.java:67)
at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_161]
at java.lang.reflect.Method.invoke(Unknown Source)[:1.8.0_161]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:1085)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:1060)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._invokeFeature(XbaseInterpreter.java:1046)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeFeature(XbaseInterpreter.java:991)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.invokeFeature(ScriptInterpreter.java:114)[129:org.eclipse.smarthome.model.script:0.9.0.b5]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:901)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:864)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:223)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:446)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:227)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:189)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.smarthome.model.script.runtime.internal.engine.ScriptImpl.execute(ScriptImpl.java:77)[130:org.eclipse.smarthome.model.script.runtime:0.9.0.b5]
at org.eclipse.smarthome.model.script.engine.ScriptExecutionThread.run(ScriptExecutionThread.java:42)[129:org.eclipse.smarthome.model.script:0.9.0.b5]
Caused by: javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1880)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:648)
at javax.mail.Service.connect(Service.java:317)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1411)
... 22 more
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Unknown Source)[:1.8.0_161]
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)[:1.8.0_161]
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)[:1.8.0_161]
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)[:1.8.0_161]
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)[:1.8.0_161]
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)[:1.8.0_161]
at sun.security.ssl.Handshaker.processLoop(Unknown Source)[:1.8.0_161]
at sun.security.ssl.Handshaker.process_record(Unknown Source)[:1.8.0_161]
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)[:1.8.0_161]
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)[:1.8.0_161]
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)[:1.8.0_161]
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)[:1.8.0_161]
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:507)
at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:447)
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1875)
... 29 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)[:1.8.0_161]
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)[:1.8.0_161]
at sun.security.validator.Validator.validate(Unknown Source)[:1.8.0_161]
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)[:1.8.0_161]
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)[:1.8.0_161]
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)[:1.8.0_161]
... 40 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)[:1.8.0_161]
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)[:1.8.0_161]
at java.security.cert.CertPathBuilder.build(Unknown Source)[:1.8.0_161]
... 46 more
chopped the rest off will post if needed
i have installed the binding/addon and filled in the mail.cfg with details found in other post and my own details
Mail.cfg
# The SMTP server hostname, e.g. "smtp.gmail.com"
hostname=smtp.gmail.com
# the SMTP port to use (optional, defaults to 25 (resp. 587 for TLS/SSL))
port=587
# the username and password if the SMTP server requires authentication
mail:username=sXxxxxx1@gmail.com
mail:password=XXXXXXXXXXX
# The email address to use for sending mails
from=sXxxxxx1@gmail.com
# set to "true", if STARTTLS is enabled (not required) for the connection
# (optional, defaults to false)
tls=true
# set to "true", if SSL negotiation should occur on connection
# do not use both tls=true and ssl=true
# (optional, defaults to false)
#ssl=
# set to "true", if POP before SMTP (another authentication mechanism)
# should be enabled. Username and Password are taken from the above
# configuration (optional, default to false)
popbeforesmtp=false
My message rule
rule "rule name"
when
Item Test_Rule_Trigger changed from OFF to ON
then
sendMail ("sXXXXX4@live.com", "Test", "This is the message.")
end
Any recommendations welcome