Traccar 3.7 SMTP Issue

abyss8 years ago

@markus
According to error text you have some issues in DNS names resolving.

lawnmoverman7 years ago

Dear good people,

Can somebody please help me with gmail account for notifications, I have tried everything from forum to get it work but I can't. I'm using traccar3.9
from wrapper.log I always get msg:
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first
in default.xml(or traccar.xml) I added:

    <!-- EMAIL SETTINGS -->
    <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'>someuser@gmail.com</entry>
    <entry key='mail.smtp.auth'>true</entry>
    <entry key='mail.smtp.username'>someuser@gmail.com</entry>
    <entry key='mail.smtp.password'>somePwd</entry>

I don't know how to enable STARTTLS I also tried with 587 port

    <!-- EMAIL SETTINGS -->
    <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.ssl.trust'>*</entry>  
    <entry key='mail.smtp.from'>someuser@gmail.com</entry>
    <entry key='mail.smtp.auth'>true</entry>
    <entry key='mail.smtp.username'>someuser@gmail.com</entry>
    <entry key='mail.smtp.password'>somePwd</entry>

I have 2 factor enabled on gmail

Please Help !

Anton Tananaev7 years ago

I would recommend searching on forum. There were some examples of SMTP settings.

lawnmoverman7 years ago

I tried everything but without results. I think this is some problem with gmail certificates. Do I need to store some gmail certs. manually to ubuntu ?

Do I need to configure Postfix ?

AnduriƱo7 years ago
config

May sound strange... but try after changing your Gmail account password

Anton Tananaev7 years ago

Also, are you sure you have done following?

http://stackoverflow.com/a/27130058/2548565

lawnmoverman7 years ago

Yes, I followed steps for 2 factor auth. I installed mutt email client yesterday and I can access mail using new app password, but mutt use IMAP not SMTP. Anyway password is working...

I hope that order of entries in traccar.xml is not important ? Also this is on VPS machine but I think that is also not important.

I tried to change pass as Arturo suggested, but nothing

Now I'm thinking to set Postfix to use gmail ...

Somewhere I read that was some problems with com.sun.mail.smtp class in some other projects and that class always use port 25 so I'm also thinking to NAT port 25 to 465

If you have some more suggestions please help, this is driving me crazy :)

    <!-- EMAIL SETTINGS -->
    <entry key='mail.smtp.from'>someone@gmail.com</entry>
    <entry key='mail.smtp.port'>465</entry>
    <entry key='mail.smtp.auth'>true</entry>
    <entry key='mail.smtp.username'>someone@gmail.com</entry>
    <entry key='mail.smtp.ssl.enable'>true</entry>
    <entry key='mail.smtp.ssl.trust'>*</entry>
    <entry key='mail.smtp.password'>passddufrzyhhhxp</entry>
    <entry key='mail.smtp.host'>smtp.gmail.com</entry>
AnduriƱo7 years ago

My configuration not working until I did 3 things:

  • Disable verification in 2 steps

  • ALLOW access to less secure applications

  • CHANGE the usual Gmail password.

Then to press the test button (the icon of an envelope) should get us an input message. Are you receiving that message ??

Anton Tananaev7 years ago

Order of entries in the config doesn't matter.

lawnmoverman7 years ago

Thank you for you support !!
It finally working !
I just want to write what I did maybe somebody will stock like me or be stupied like me :)
I thought if I set smtp in config file I mean traccar.xml it just be fine and that those settings will be forwarded for every user. But I have erase everithing from traccer.xml(there is nothing in conf files) and put parameters directly in GUI notifications tab and I had to use 2 factor auth. password instead standard gmail password.

So every user can set own gmail account so params. are probably in database. I thought that I need to set one email account that handling notifications for all users.

Thank you very much for your time this fantastic project !!!

BR Ivan

Anton Tananaev7 years ago

There is no "notifications tab" in official version of Traccar. It sounds like you are not using official version.

markus7 years ago

Hello!

Concerning my last post a few months ago I'd like to share how I solved the problem. Maybe it helps some other Traccar fans who have the same issues.
I mentioned that after upgrading from Traccar 3.9 to 3.10 I had some problems with the SSL connection.

The only thing I had to do was upgrading my Java Runtime on the Ubuntu-Server. After that everything was fine and working again.
I guess it was a problem with the integrated trusted sites (or something like that) from my previous Java-Version.

By the way ... the Java-Upgrade also solved my problem concerning the no more working Reverse Geocoding. (I explained this in an other thread).

Happy Car-Tracking :-)
Yours
Markus

jkkostov5 years ago

Hello, when I trying to send a test email I received the following error

Traccar 4.8

unable to find valid certification path to requested target - SunCertPathBuilderException (... < MailManager:139 < *:92 < NotificatorMail:34 < NotificationResource:63 < ...)

traccar.xml.........

<entry key='mail.smtp.host'>mail.xxxx.xx</entry>
<entry key='mail.smtp.port'>465</entry>
<entry key='mail.smtp.ssl.protocols'>TLSv1.2</entry>
<entry key='mail.smtp.ssl.enable'>true</entry>
<entry key='mail.smtp.from'>my@xxxxx.xx</entry>
<entry key='mail.smtp.auth'>true</entry>
<entry key='mail.smtp.username'>user</entry>
<entry key='mail.smtp.password'>password</entry>

What could be the problem???

Anton Tananaev5 years ago

Try different Java version.