SMTP config for 3.9

peteclyde7 years ago

I had email notifications working ok on 3.7

I had the following config in traccar.xml which I moved to traccar.xml with the new version, along with my mysql settings. (mydomain.com added rather than my real domain)

Mysql is working fine, but I'm not having any joy with email - can anyone post a working SMTP config (with appropriate private details blacked out of course)

<!-- EMAIL SETTINGS -->
<entry key='mail.smtp.host'>mail.mydomain.com</entry>
<entry key='mail.smtp.port'>25</entry>
<entry key='mail.smtp.from'>pete@mydomain.com</entry>
<entry key='mail.smtp.username'>pete@mydomain.com</entry>
<entry key='mail.smtp.password'>pass1234</entry>

Thanks !

Pete

Anton Tananaev7 years ago

If those settings worked for 3.8, they should work just fine for 3.9 as well. Check logs for error.

peteclyde7 years ago

No they didn't work for 3.8 - the last time they worked were with 3.7.

I'll add them again to the traccar.xml and restart so I can get the error messages.

peteclyde7 years ago
FINEST|15908/0|Service traccar|16-12-11 11:00:00|java.lang.NullPointerException:null
FINEST|15908/0|Service traccar|16-12-11 11:00:00|java.lang.NullPointerException
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at java.util.Hashtable.put(Hashtable.java:514)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail.getProperties(NotificationMail.java:69)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail.sendMailSync(NotificationMail.java:90)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail$1.run(NotificationMail.java:129)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at java.lang.Thread.run(Thread.java:745)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|Uncaught exception by Thread[Thread-89,5,main]:
FINEST|15908/0|Service traccar|16-12-11 11:00:00|java.lang.NullPointerException:null
FINEST|15908/0|Service traccar|16-12-11 11:00:00|java.lang.NullPointerException
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at java.util.Hashtable.put(Hashtable.java:514)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail.getProperties(NotificationMail.java:69)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail.sendMailSync(NotificationMail.java:90)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail$1.run(NotificationMail.java:129)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at java.lang.Thread.run(Thread.java:745)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|Uncaught exception by Thread[Thread-90,5,main]:
FINEST|15908/0|Service traccar|16-12-11 11:00:00|java.lang.NullPointerException:null
FINEST|15908/0|Service traccar|16-12-11 11:00:00|java.lang.NullPointerException
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at java.util.Hashtable.put(Hashtable.java:514)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail.getProperties(NotificationMail.java:69)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail.sendMailSync(NotificationMail.java:90)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail$1.run(NotificationMail.java:129)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at java.lang.Thread.run(Thread.java:745)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|Uncaught exception by Thread[Thread-91,5,main]:
FINEST|15908/0|Service traccar|16-12-11 11:00:00|java.lang.NullPointerException:null
FINEST|15908/0|Service traccar|16-12-11 11:00:00|java.lang.NullPointerException
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at java.util.Hashtable.put(Hashtable.java:514)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail.getProperties(NotificationMail.java:69)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail.sendMailSync(NotificationMail.java:90)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at org.traccar.notification.NotificationMail$1.run(NotificationMail.java:129)
FINEST|15908/0|Service traccar|16-12-11 11:00:00|       at java.lang.Thread.run(Thread.java:745)
INFO|wrapper|Service traccar|16-12-11 11:00:01|waitpid 15908 0
INFO|wrapper|Service traccar|16-12-11 11:00:01|exit code posix process: 0 application: 0
INFO|wrapper|Service traccar|16-12-11 11:00:01|killing 15908
INFO|wrapper|Service traccar|16-12-11 11:00:01|process exit code: 0
WARNING|wrapper|Service traccar|16-12-11 11:00:54|YAJSW: yajsw-beta-12.07
WARNING|wrapper|Service traccar|16-12-11 11:00:54|OS   : Linux/4.4.27-v7+/arm
WARNING|wrapper|Service traccar|16-12-11 11:00:54|JVM  : Oracle Corporation/1.7.0_101//usr/lib/jvm/java-7-openjdk-armhf/jre/32
INFO|wrapper|Service traccar|16-12-11 11:00:56|exec:"java" "-classpath" "/opt/traccar/wrapperApp.jar:/opt/traccar/tracker-server.jar:/opt/traccar/lib/log4j$
INFO|wrapper|Service traccar|16-12-11 11:00:56|posix_spawn pid 19258
INFO|wrapper|Service traccar|16-12-11 11:00:56|started process 19258
INFO|wrapper|Service traccar|16-12-11 11:00:56|started process with pid 19258
INFO|19258/0|Service traccar|16-12-11 11:01:06|[INFO] StandardFileSystemManager - Using "/tmp/vfs_cache" as temporary files store.
INFO|19258/0|Service traccar|16-12-11 11:01:10|java.lang.reflect.InvocationTargetException
INFO|19258/0|Service traccar|16-12-11 11:01:10| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at java.lang.reflect.Method.invoke(Method.java:606)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|19258/0|Service traccar|16-12-11 11:01:10|Caused by: java.util.InvalidPropertiesFormatException: org.xml.sax.SAXParseException; lineNumber: 6; columnN$
INFO|19258/0|Service traccar|16-12-11 11:01:10| at java.util.XMLUtils.load(XMLUtils.java:76)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at java.util.Properties.loadFromXML(Properties.java:868)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at org.traccar.Config.load(Config.java:30)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at org.traccar.Context.init(Context.java:168)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at org.traccar.Main.main(Main.java:35)
INFO|19258/0|Service traccar|16-12-11 11:01:10| ... 6 more
INFO|19258/0|Service traccar|16-12-11 11:01:10|Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 29; Document root element "entry", mu$
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.$
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:15$
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1877)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragm$
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocu$
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDoc$
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.$
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentS$
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:338)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:102)
INFO|19258/0|Service traccar|16-12-11 11:01:10| at java.util.XMLUtils.load(XMLUtils.java:74)
INFO|19258/0|Service traccar|16-12-11 11:01:10| ... 10 more
Anton Tananaev7 years ago

You have an invalid XML in your config.

peteclyde7 years ago

Hey all,

It's working now. The XML had some extra carriage returns from not pasting properly so I got that sorted.

I had no luck with the above configuration but when I changed to the following I got it to work ok:

<entry key='mail.smtp.host'>mail.mydomain.com</entry>
    <entry key='mail.smtp.port'>465</entry>
    <entry key='mail.smtp.ssl.enable'>true</entry>
    <entry key='mail.smtp.from'>pete@mydomain.com</entry>
    <entry key='mail.smtp.auth'>true</entry>
    <entry key='mail.smtp.username'>pete@mydomain.com</entry>
    <entry key='mail.smtp.password'>pass1234</entry>
sergwolf7 years ago

Антон, приветствую!
Вчера обновился до 3,9 сбросились настройки почты, не совсем понял где теперь править конфиг traccar.xml или defualt.xml?

Anton Tananaev7 years ago

Конфиг править там же где и всегда - traccar.xml.

jovi7 years ago

What is the correct way to configure the sending of mail?

Anton Tananaev7 years ago
jovi7 years ago

thank you ANTON