No E-Mails getting sent, Mail log remains empty

Hey everyone,

I have Vikunja running on my home server and everything seems to work as it should - except for E-Mail-Notifications.

Vikunja is manually installed in a LXC, so no Docker involved.
Base System is Debian 11, in case that matters.

This is my Mail config:

mailer:
  # Whether to enable the mailer or not. If it is disabled, all users are enabled right away and password reset is >
  enabled: true
  # SMTP Host
  host: "mail.mydomain.de"
  # SMTP Host port.
  # **NOTE:** If you're unable to send mail and the only error you see in the logs is an `EOF`, try setting the por>
  port: 465
  # SMTP Auth Type. Can be either `plain`, `login` or `cram-md5`.
  authtype: "login"
  # SMTP username
  username: "MyUsername"
  # SMTP password
  password: "MyPassword"
  # Wether to skip verification of the tls certificate on the server
  skiptlsverify: false
  # The default from address when sending emails
  fromemail: "MyEmail"
  # The length of the mail queue.
  queuelength: 100
  # The timeout in seconds after which the current open connection to the mailserver will be closed.
  queuetimeout: 30
  # By default, vikunja will try to connect with starttls, use this option to force it to use ssl.
  forcessl: false

And, for now, my logging config:

log:
  # A folder where all the logfiles should go.
  path: /opt/vikunja/logs
  # Whether to show any logging at all or none
  enabled: true
  # Where the normal log should go. Possible values are stdout, stderr, file or off to disable standard logging.
  standard: "file"
  # Change the log level. Possible values (case-insensitive) are CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG.
  level: "DEBUG"
  # Whether or not to log database queries. Useful for debugging. Possible values are stdout, stderr, file or off t>
  database: "file"
  # The log level for database log messages. Possible values (case-insensitive) are CRITICAL, ERROR, WARNING, NOTIC>
  databaselevel: "DEBUG"
  # Whether to log http requests or not. Possible values are stdout, stderr, file or off to disable http logging.
  http: "file"
  # Echo has its own logging which usually is unnecessary, which is why it is disabled by default. Possible values >
  echo: "off"
  # Whether or not to log events. Useful for debugging. Possible values are stdout, stderr, file or off to disable >
  events: "file"
  # The log level for event log messages. Possible values (case-insensitive) are ERROR, INFO, DEBUG.
  eventslevel: "DEBUG"
  # Whether or not to log mail log messages. This will not log mail contents. Possible values are stdout, stderr, f>
  mail: "file"
  # The log level for mail log messages. Possible values (case-insensitive) are ERROR, WARNING, INFO, DEBUG.
  maillevel: "DEBUG"

I have E-Mail Reminders enabled and according to the standard.log those reminders are being sent:

2024-02-16T22:07:00.027376892Z: DEBUG   â–¶ models/func1 226 [Task Reminder Cron] Sent reminder email for task 9 to user 1
2024-02-16T22:07:00.028027781Z: DEBUG   â–¶ models/func1 227 [Task Reminder Cron] Sent reminder email for task 9 to user 1

I haven’t received a single E-Mail yet and the mail.log remains completely empty. I’m using the same credentials and Settings for other services so I know those are working fine otherwise. Also I would expect an error in the logs if it’s related to the credentials.

I find it really odd that there’s absolutely nothing in the logs relating E-Mails. There’s also nothing happening when trying to get a password reset Mail.

I’m out of ideas what else to check, so I hope someone here can give me any pointers on what to check.

Thanks!

What does the vikunja testmail command say?

It’s stuck like this for 4 minutes now:

vikunja testmail MyMail
2024/02/16 22:59:27 Using config file: /etc/vikunja/config.yml
2024/02/16 22:59:27 Redis initialized

What’s in the mail logs when you try to send the mail?

You can also try to set the log to stdout and then run the command, that will show all logs in the terminal instead of piping it to the log file

Nothing at all. I get the same output as before, the log is still empty. I changed it to stdout as well but nothing in the terminal.
I just noticed that there is a new version available, so I installed it now, but it’s still the same behaviour.

Do you see any connection attempts in your mailserver’s logs?

It’s not my own mail server, so I don’t have access to the logs sadly.

The complete lack of logs is what’s odd to me. Everything else logs as it should, except mails.

From the testmail command it looks like a connection issue - as if Vikunja tries to connect to the mail server and it replies, but very slowly or not at all (filtered through firewall).

Do you have other applications running which connect to the same mailserver from the same server you’re running Vikunja on? Does it work if you try with telnet to connect to the mail server?

I haven’t used telnet for this before, so took me a while. But connection is fine:

root@vikunja:~# telnet mail.manitu.de 25
Trying 217.11.48.80...
Connected to mail.manitu.de.
Escape character is '^]'.
220 mailproxy01.manitu.net ESMTP Postfix
EHLO mail.manitu.de
250-mailproxy01.manitu.net
250-PIPELINING
250-SIZE 104857600
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 CHUNKING
STARTTLS
220 2.0.0 Ready to start TLS

And after that I could also send a test mail using telnet so connectivity seems fine.

Host is an LXC Container within Proxmox, theres only vikunja running in this container. There’s no firewall set up yet, as it’s currently only a setup within my home network. I do have other containers running on the same host that send mails via the same account fine though.

Does it work with port 465? As that’s what you set in the config file. Or if you set it to port 25 in the config file, does that work?

Sorry, should’ve been more clear. I couldn’t send anything using port 25 as my host requires TLS. So I used telnet-ssl on port 465 to send the test mail. Both ports work to connect to the mail server though.

Does it work if you set forcessl to true? Or when you set the port to 587?

1 Like

Changing the Port to 587 worked. I wonder why though? Documentation of my mail host says 465 and it works like that on every other host.
Thanks for your help!

It might be related to a combination of STARTTLS and SSL.