setup smtp server to email reports

Raj5 years ago

Hi Team,

In the forum the instructions are to setup the smtp server for the whole traccar server, add the following in the

    <entry key='mail.smtp.host'>ip of smtp box</entry>
    <entry key='mail.smtp.port'>465</entry>
    <entry key='mail.smtp.ssl.enable'>true</entry>
    <entry key='mail.smtp.from'>email address from</entry>
    <entry key='mail.smtp.auth'>true</entry>
    <entry key='mail.smtp.username'>username</entry>
    <entry key='mail.smtp.password'>password</entry>

to the traccar.xml file in config folder.

As soon as I do that and reboot the box, traccar does not load. Only was to get it to work is to remove the added lines and then reboot.

Can anyone advise on how tp add the smtp server to that users can run reports.

Regards,

rajbps

Anton Tananaev5 years ago

If server doesn't start, it usually means that you made some mistake in the XML file. Note that config has to be a valid XML.

Raj5 years ago

Hi Anton,

Here is the xml file. I can`t see a mistake but there might be one

Can you advise

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <entry key='config.default'>./conf/default.xml</entry>

    <!--

    This is the main configuration file. All your configuration parameters should be placed in this file.

    Default configuration parameters are located in the "default.xml" file. You should not modify it to avoid issues
    with upgrading to a new version. Parameters in the main config file override values in the default file. Do not
    remove "config.default" parameter from this file unless you know what you are doing.

    For list of available parameters see following page: https://www.traccar.org/configuration-file/

    -->

    <entry key='database.driver'>org.h2.Driver</entry>
    <entry key='database.url'>jdbc:h2:./data/database</entry>
    <entry key='database.user'>sa</entry>
    <entry key='database.password'></entry>
    <entry key='mail.smtp.host'>192.168.1.1</entry>
    <entry key='mail.smtp.port'>587</entry>
    <entry key='mail.smtp.starttls.enable'>true</entry>
    <entry key='mail.smtp.port'>465</entry>
    <entry key='mail.smtp.ssl.enable'>true</entry>
    <entry key='mail.smtp.from'>traccar@mydomain.com</entry>
    <entry key='mail.smtp.auth'>true</entry>
    <entry key='mail.smtp.username'>traccar@mydomain.local</entry>
    <entry key='mail.smtp.password'>letmeinpls123@123</entry>

</properties>

regards,
rajbps

Anton Tananaev5 years ago

I don't see any issues.

Raj5 years ago

Hi Anton,

Any ideas as to why if I add the lines for the mail server, I see the following in the logs

systemd: traccar.service: main process exited, code=exited, status=1/FAILURE
systemd: Unit traccar.service entered failed state.
systemd: traccar.service failed.

Just cant get my head around it.

As soon as those line go it woks.

wolfbg5 years ago
  1. I think that smtp host can not be IP address. It should be domain name or host name of your mail server.
  2. Remove either 'mail.smtp.port'>587 & 'mail.smtp.starttls.enable' or 'mail.smtp.port'>465 & 'mail.smtp.ssl.enable'. Leave only one option.
  3. Check weather ports 587 or 465 are open locally too.
  4. Lines mail.smtp.from & mail.smtp.username should be identical. Full email address of email account you are using to send massages from.
trackinguser4455 years ago

Raj: did you solve this issue? do you have active smtp credentials that work?

Raj5 years ago

not yet added the name instead of the ip takes me further but then I can see the following error on the mail server end :

Mar 12 15:13:57 mail postfix/submission/smtpd[31954]: connect from unknown[192.168.39.29]
Mar 12 15:13:58 mail postfix/submission/smtpd[31954]: SSL_accept error from unknown[192.168.39.29]: 0
Mar 12 15:13:58 mail postfix/submission/smtpd[31954]: warning: TLS library problem: 31954:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:s3_pkt.c:1493:SSL alert number 46:
Mar 12 15:13:58 mail postfix/submission/smtpd[31954]: lost connection after STARTTLS from unknown[192.168.39.29]
Mar 12 15:13:58 mail postfix/submission/smtpd[31954]: disconnect from unknown[192.168.39.29]
Mar 12 15:13:58 mail postfix/submission/smtpd[31954]: connect from unknown[192.168.39.29]
Mar 12 15:13:58 mail postfix/submission/smtpd[31954]: SSL_accept error from unknown[192.168.39.29]: 0
Mar 12 15:13:58 mail postfix/submission/smtpd[31954]: warning: TLS library problem: 31954:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:s3_pkt.c:1493:SSL alert number 46:
Mar 12 15:13:58 mail postfix/submission/smtpd[31954]: lost connection after STARTTLS from unknown[192.168.39.29]
Mar 12 15:13:58 mail postfix/submission/smtpd[31954]: disconnect from unknown[192.168.39.29]

So unsure on that one now

Raj5 years ago

Hi everyone,

does anyone has traccar working with emails. I use iredmail and when I asked the maintainer about this error, this is the reply he send me :

  • With same Postfix configuration, can you send email with a MUA (e.g. Thunderbird) and same smtp user + password + port number?
  • if MUA works, then it's possible that this tracking system cannot correctly handle smtp + tls. Better check it first.

Now I use outlook and that works well so unsure where to turn next.

Thanks in advance for the help

rajbps

conny dittmann4 years ago

Hello Raj,

Did you get it to work
I get the very same warning message in the logfile:
warning: TLS library problem: 32050:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown:s3_pkt.c:1278:SSL alert number 46:
I would teaar my hair out if i had any.

Cheers
Conny