# Email Notifications Problem

**URL:** <https://community.vikunja.io/t/email-notifications-problem/787>\
**Category:** Support\
**Created:** [31 August 2022 22:18 UTC](https://community.vikunja.io/t/email-notifications-problem/787 "2022-08-31T22:18:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikesellt](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mikesellt](https://community.vikunja.io/u/mikesellt)\
**Post date:** [31 August 2022 22:18 UTC](https://community.vikunja.io/t/email-notifications-problem/787/1 "2022-08-31T22:18:45Z")

</div>

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 ▶ 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.

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [1 September 2022 12:20 UTC](https://community.vikunja.io/t/email-notifications-problem/787/2 "2022-09-01T12:20:08Z")

</div>

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

> [@mikesellt](#):
>
> Also, the time in the logs is off. I’ve tried setting the environment variable like this:

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

---

<div class="post-metadata">

**Author:** ![mikesellt](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mikesellt](https://community.vikunja.io/u/mikesellt)\
**Post date:** [1 September 2022 14:53 UTC](https://community.vikunja.io/t/email-notifications-problem/787/3 "2022-09-01T14:53:59Z")

</div>

Thanks for the reply! Here’s what I get from nmap on [smtp.gmail.com](http://smtp.gmail.com):

Tim@ServerMeTmbrs2:/volume2/docker/vikunja$ nmap [smtp.gmail.com](http://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

---

<div class="post-metadata">

**Author:** ![mikesellt](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mikesellt](https://community.vikunja.io/u/mikesellt)\
**Post date:** [1 September 2022 14:55 UTC](https://community.vikunja.io/t/email-notifications-problem/787/4 "2022-09-01T14:55:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [1 September 2022 15:19 UTC](https://community.vikunja.io/t/email-notifications-problem/787/5 "2022-09-01T15:19:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikesellt](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mikesellt](https://community.vikunja.io/u/mikesellt)\
**Post date:** [1 September 2022 15:26 UTC](https://community.vikunja.io/t/email-notifications-problem/787/6 "2022-09-01T15:26:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [1 September 2022 15:56 UTC](https://community.vikunja.io/t/email-notifications-problem/787/7 "2022-09-01T15:56:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikesellt](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mikesellt](https://community.vikunja.io/u/mikesellt)\
**Post date:** [2 September 2022 22:25 UTC](https://community.vikunja.io/t/email-notifications-problem/787/8 "2022-09-02T22:25:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [5 September 2022 14:45 UTC](https://community.vikunja.io/t/email-notifications-problem/787/9 "2022-09-05T14:45:18Z")

</div>

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

```auto
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:

```auto
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):

> **[Less secure apps & your Google Account - Google Account Help](https://support.google.com/accounts/answer/6010255?hl=en)**
>
> To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your

You might be able to use an “App Password” instead: [Sign in with App Passwords - Gmail Help](https://support.google.com/mail/answer/185833?hl=en)

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

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [5 September 2022 15:34 UTC](https://community.vikunja.io/t/email-notifications-problem/787/10 "2022-09-05T15:34:53Z")

</div>

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

> [@Getting error when sending an E-Mail](https://community.vikunja.io/t/getting-error-when-sending-an-e-mail/801/5):
>
> Can you try setting the mailer port to 25 instead of 465? That worked in my tests with a free mail account on infomaniak.
