Email Notifications

Hello, I have been banging my head against a wall trying to get email notifications to work. I’m self-hosting Vikunja, and using the following lines from docker compose:
VIKUNJA_SERVICE_ENABLEEMAILREMINDERS: 1
VIKUNJA_MAILER_ENABLED: 1
VIKUNJA_MAILER_FORCESSL: 1
VIKUNJA_MAILER_HOST: smtp .gmail.com
VIKUNJA_MAILER_PORT: 465
VIKUNJA_MAILER_USERNAME: xxx .xxxxxxxxxxxxx @ gmail .com
VIKUNJA_MAILER_PASSWORD: xxxxmypasswordxxxx

And here’s the error I keep getting in the api logs:
2022-08-31T22:11:12.799541029Z: ERROR :arrow_forward: mail/func1 0a6 Error during connect to smtp server: %s EOF

Also, the time in the logs is off. I’ve tried setting the environment variable like this:
VIKUNJA_SERVICE_TIMEZONE: America/Boise
But it doesn’t seem to work. I’ve also set the time zone under the user settings of the frontend.

For the email problem, I’ve tried forcing/not forcing ssl, changing the login type to “login” and “plain”, changing the port from 465 to 587, and a few other changes that didn’t work. If it helps, I’m running this on Docker on a Synology NAS. I am using the nginx proxy settings and file, and I have a separate nginx proxy that I use in front of this and all my other services.

I’ve gone through the forum and looked for the answer, and every other email-related post doesn’t seem to fix my problem.

Does anyone have any idea? I have just installed this yesterday and re-installed today, so the version is the latest as of the date of this post.

Can you verify that you have access to the mail server from the host you’re running Vikunja on? (With telnet or similar)

The time zone in the logs depends on the time configured on your server, not on the time zone setting.

Thanks for the reply! Here’s what I get from nmap on smtp.gmail.com:

Tim@ServerMeTmbrs2:/volume2/docker/vikunja$ nmap smtp.gmail.com -Pn
Starting Nmap 7.92 ( https ://nmap.org ) at 2022-09-01 08:50 MDT
Nmap scan report for smtp .gmail.com (108.177.112.109)
Host is up (0.022s latency).
Other addresses for smtp .gmail.com (not scanned): 2607:f8b0:4001:c12::6c
rDNS record for 108.177.112.109: jo-in-f109 .1e100.net
Not shown: 995 filtered tcp ports (no-response)
PORT STATE SERVICE
53/tcp open domain
465/tcp open smtps
587/tcp open submission
993/tcp open imaps
995/tcp open pop3s

Nmap done: 1 IP address (1 host up) scanned in 4.62 seconds

-It looks like the server host can see the proper open ports from gmail.

*Also, here’s my server host showing the correct time, but the logs are still hours off.

Tim@ServerMeTmbrs2:/volume2/docker/vikunja$ date
Thu Sep 1 08:50:17 MDT 2022

I also tried this from the host:

Tim@ServerMeTmbrs2:/volume2/docker/vikunja$ telnet smtp .gmail.com 465
Trying 173.194.194.109…
Connected to smtp .gmail.com.
Escape character is ‘^]’.
get
FConnection closed by foreign host.

Does it make a difference if you use the unstable version?

I updated my docker compose to use the unstable version of the API image, and I get the same result.

Really wired. Will try to reproduce with a gmail connection.

Thank you. FYI I spun up a new instance with the same settings on a different server (regular Linux box, not Synology NAS like the other), and I am getting the same error.

I’ve had a different error message with these settings:

mailer:
  enabled: true
  host: "smtp.gmail.com"
  port: 587
  username: "not-my-email@gmail.com"
  password: "password"
  fromemail: "not-my-email@gmail.com"

Note that Vikunja uses STARTTLS by default so you’ll have to use port 587 unless you change that setting.

The error was:

Error sending test mail: dial failed: SMTP AUTH failed: 535 5.7.8 Username and Password not accepted. Learn more at
5.7.8  https://support.google.com/mail/?p=BadCredentials l20-20020a05600c089400b003a30fbde91dsm16607777wmp.20 - gsmtp

I dug a little and this is probably related to gmail not allowing “unsecure apps” anymore which are third-party apps only using a username and password (and not an oauth flow):

You might be able to use an “App Password” instead: Sign in with App Passwords - Gmail Help

Unfortunately, it looks like this is nothing where Vikunja can do much.

Because it seems to have worked in the other thread: Can you try setting the host port to 25?