Can't send mails

yaniv setton 8 years ago

Hi,
i can't send mails, check all possibles configurations
please see the logs that came from the container when trying to send mail from server
i also use mysql container if it change anything..

Exception in thread "Thread-12" java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
at org.traccar.model.ExtendedModel.getString(ExtendedModel.java:89)
at org.traccar.notification.PropertiesProvider.getString(PropertiesProvider.java:39)
at org.traccar.notification.NotificationMail.getProperties(NotificationMail.java:48)
at org.traccar.notification.NotificationMail.sendMailSync(NotificationMail.java:92)
at org.traccar.notification.NotificationMail$1.run(NotificationMail.java:134)
at java.lang.Thread.run(Thread.java:748)

configuration from server side

Mail: SMTP Host | smtp.gmail.com
Mail: SMTP Port | 587
Mail: SMTP From | ***@gmail.com
Mail: SMTP Auth Enable | true
Mail: SMTP Username | ***@gmail.com
Mail: SMTP Password | ***
Mail: SMTP STARTTLS Enable | true

check that with ssl port 465

please help

thanks

Anton Tananaev 8 years ago

There is a problem with boolean values. You need to add them as string attributes manually. That's a known issue in the last release.

astronaut 8 years ago
java.lang.Boolean cannot be cast to java.lang.String - ClassCastException (ExtendedModel:89 < PropertiesProvider:39 < NotificationMail:57 < ...)
yaniv setton 8 years ago

Can someone please explain how to fix that

astronaut 8 years ago

Yes please!

astronaut 8 years ago
astronaut 8 years ago

Putty:
cd /var/docker/traccar/default.xml
vi traccar.xml
(Press insert)
(https://imgur.com/a/OXyu1)

<entry key='filter.enable'>true</entry>
<entry key='filter.invalid'>true</entry>
<entry key='filter.zero'>true</entry>
<entry key='filter.distance'>10</entry>
<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.from'>youremail@gmail.com</entry>
<entry key='mail.smtp.auth'>true</entry>
<entry key='mail.smtp.username'>youremail@gmail.com</entry>
<entry key='mail.smtp.password'>yourpass</entry>

Scape
:x

AnduriƱo 8 years ago

mail.smtp.starttls.enable true
mail.smtp.ssl.enable true

"You need to add them as string attributes manually."

...for Traccar Demo Servers???
(Error: ClassCastException)

Anton Tananaev 8 years ago

Those attributes should be string type instead of boolean. Unfortunately there is no way to do it through official web app. The only way to do it is via web API:

https://www.traccar.org/traccar-api/