Traccar Mail Setup Error

Daniel Petrov5 years ago

Hello,

I am running traccar server for testing purposes on Windows 7 machine.

After setting the required SMTP settings in traccar.xml, I get the following error when I try to test the Notifications by mail:

Received fatal alert: handshake_failure - SSLHandshakeException (... < MailManager:139 < *:92 < NotificatorMail:34 < NotificationResource:63 < ...)

Here is the content for traccar.xml:

<entry key='mail.smtp.host'>host</entry>
<entry key='mail.smtp.port'>465</entry>
<entry key='mail.smtp.ssl.enable'>true</entry>
<entry key='mail.smtp.from'>mail@domain.com</entry>
<entry key='mail.smtp.auth'>true</entry>
<entry key='mail.smtp.username'>mail@domain.com</entry>
<entry key='mail.smtp.password'>password</entry>

Also, I checked this topic and followed the instuctions but issue still persists:

Upgrade from 4.2 to 4.3

This is the code I use to start the traccar service:

C:\Program Files\Traccar\jre\bin\java.exe -Dhttps.protocols=TLSv1.2 -Duser.dir="C:\Program Files\Traccar" -jar "C:\Program Files\Traccar\tracker-server.jar" --service ".\conf\traccar.xml"

Also, cleared browser cache.

Any idea what could be the reason for this error?

Daniel Petrov5 years ago

Please, ignore.I found the issue. I was using SSL for SMTP while the traccar server was not. Therefore the error. Configured non SSL smtp and it worked!

Daniel Petrov5 years ago

Ok, now I have setup SSL certificate on the server, updated apache as per the instructions and set config in traccar.xml to use SSL -> port 465 and ssl.enable back to true.

And I get the same handshake error eventhough now traccar is accessible from https://

Received fatal alert: handshake_failure - SSLHandshakeException (... < MailManager:139 < *:92 < NotificatorMail:34 < NotificationResource:63 < ...)

Any ideas why sending notifications by SSL might fail? There are no errors in traccar logs.

Noname5 years ago

you should go back traccar 4.1,i have same issue in traccar 4.5

Anton Tananaev5 years ago

You don't need to go back. Worst case you can just downgrade Java and use the system one.

Michael Rings5 years ago

Hello, I had the same problem.
Mail: SMTP SSL protocols = TLSv1.2 and it works again.

cu

Marcin5 years ago

For future use:
This was the deciding help :)
I got same errors under 4.6
Did all the entries i found here.

But first when i add

<entry key='mail.smtp.ssl.protocols'>TLSv1.2</entry>

then it works

davejh5 years ago

Thanks @Marcin your solution adding <entry key='mail.smtp.ssl.protocols'>TLSv1.2</entry> worked for me.
Cheers

9ronin4 years ago

I would like to share config traccar.xml that I tested and it work for me


<entry key='mail.smtp.port'>587</entry>
<entry key='mail.smtp.starttls.enable'>true</entry> 
<entry key='mail.smtp.ssl.protocols'>TLSv1.2</entry> 
<entry key='mail.smtp.host'>smtp.gmail.com</entry>
<entry key='mail.smtp.from'>mydevice@gmail.com</entry>
<entry key='mail.smtp.auth'>true</entry>
<entry key='mail.smtp.username'>mydevice@gmail.com</entry>
<entry key='mail.smtp.password'>mydevice_password</entry>