Problems with Google Mail

gabriele4 years ago

I have a problem with emails I can't configure Gmail parameters. I entered the Gmail configuration parameters in the traccar.xml file.

    <entry key = 'mail.smtp.host'> smtp.gmail.com </entry>
    <entry key = 'mail.smtp.port'> 587 </entry>
    <entry key = 'mail.smtp.starttls.enable'> true </entry>
    <entry key = 'mail.smtp.from'> +++++++++ @ gmail.com </entry>
    <entry key = 'mail.smtp.auth'> true </entry>
    <entry key = 'mail.smtp.username'> +++++++++ @ gmail.com </entry>
    <entry key = 'mail.smtp.password'> ++++++++ </entry>

I restarted Traccar but the service does not start.

This is the error log.

2019-12-23 08:34:09 INFO: [512d771f] connected
23/12/2019 8:34:09 INFO: [512d771f: stl060 <172.104.113.6] HEX: 474554202f20485454502f312e310d0a486f73743a2035312e3137382e32352e39303a353036300d0a557365722d4167656e743a204d6f7a696c6c612f352e300d0a4163636570742d456e636f64696e673a20677a69700d0a436f6e6e656374696f6e3a20636c6f73650d0a0d0a
2019-12-23 08:34:12 INFO: [512d771f] disconnected
2019-12-23 08:44:35 INFO: [c33ecdac] connected
2019-12-23 08:44:35 INFO: [c33ecdac: recoda <45.136.108.67] HEX: 0300002f2ae00000000000436f6f6b69653a206d737473686173683d41646d696e697374720d0a0100080003000000
2019-12-23 08:44:35 WARN: [c33ecdac] error - Adjusted frame length exceeds 1024: 57386 - discarded - TooLongFrameException (... <WrapperInboundHandler: 57 <... <StandardLoggingHandler: 43 <... <NetworkMessageHandler : 37 <...)
2019-12-23 08:44:35 INFO: [c33ecdac] disconnected
2019-12-23 10:49:24 INFO: user: 1, action: login
2019-12-23 10:49:33 INFO: user: 1, action: logout

Can you help me understand where I'm wrong.

Thanks
BR
Gabriele

PLUTARCO ORDONEZ4 years ago

in /opt/traccar/conf/traccar.xml

    <entry key='mail.smtp.host'>smtp.gmail.com</entry>
    <entry key='mail.smtp.port'>465</entry>
    <entry key='mail.smtp.ssl.enable'>true</entry>
    <entry key='mail.smtp.ssl.trust'>*</entry>
    <entry key='mail.smtp.from'>myemail@gmail.com</entry>
    <entry key='mail.smtp.auth'>true</entry>
    <entry key='mail.smtp.username'>myemail@gmail.com</entry>
    <entry key='mail.smtp.password'>xxx</entry>

the password is an application password because two-step authentication must be activated...
it work for me

Anton Tananaev4 years ago

Your log indicates that the service is running.

gabriele4 years ago

The service is offline after making the change when i try to access the machine it tells me unreachable.
I try to change the password.

gabriele4 years ago

unfortunately, even if the settings are changed, the machine does not start
Any other suggestions?

root@vps763138:~# sudo systemctl status traccar.service
● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-12-23 17:36:37 CET; 47s ago
  Process: 18529 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, st
 Main PID: 18529 (code=exited, status=1/FAILURE)

dic 23 17:36:37 vps763138 traccar[18529]:         at java.base/jdk.internal.util.xml.impl.Parser.ent(Parser.ja
dic 23 17:36:37 vps763138 traccar[18529]:         at java.base/jdk.internal.util.xml.impl.Parser.step(Parser.j
dic 23 17:36:37 vps763138 traccar[18529]:         at java.base/jdk.internal.util.xml.impl.ParserSAX.parse(Pars
dic 23 17:36:37 vps763138 traccar[18529]:         at java.base/jdk.internal.util.xml.impl.ParserSAX.parse(Pars
dic 23 17:36:37 vps763138 traccar[18529]:         at java.base/jdk.internal.util.xml.impl.ParserSAX.parse(Pars
dic 23 17:36:37 vps763138 traccar[18529]:         at java.base/jdk.internal.util.xml.impl.SAXParserImpl.parse(
dic 23 17:36:37 vps763138 traccar[18529]:         at java.base/jdk.internal.util.xml.PropertiesDefaultHandler.
dic 23 17:36:37 vps763138 traccar[18529]:         ... 5 more
dic 23 17:36:37 vps763138 systemd[1]: traccar.service: Main process exited, code=exited, status=1/FAILURE
dic 23 17:36:37 vps763138 systemd[1]: traccar.service: Failed with result 'exit-code'.
Anton Tananaev4 years ago

Yes, you have an invalid XML file.

gabriele4 years ago

I entered the configuration for sending emails I can't understand where the error is.