Confusing success status message when mail sending fails #2767

Closed
opened 2024-10-17 20:53:56 +00:00 by toddy · 3 comments

Description

Hi,

first of all, thanks a lot for a great program! I've just installed a test version of Vikunja on my server and tried to set up the mailing functionality. The program offers a command to send a test email, which I find very comfortable. So I asked Vikunj to send a test email to my mail address:

$ ./vikunja testmail mail@example.org
2024-10-17T14:43:50+02:00: INFO ▶ 001 Using config file: /home/test/vikunja/config.yml
2024-10-17T14:43:50+02:00: INFO ▶ 002 Sending testmail...
2024-10-17T14:43:53+02:00: INFO ▶ 011 Testmail successfully sent.

However, despite Vikunja telling me that the mail has been sent successfully, it didn't arrive. (Please note that I didn't actually use mail@example.org for the testmail command, that's not the source of the error. 😄)

Turning on the DEBUG log mode, I did finally spot what was wrong: I had made a tiny typo in the config.yml file, and the initial connection to the SMTP server succeeded, but the authentication did not:

$ ./vikunja testmail mail@example.org
2024-10-17T14:43:50+02:00: INFO ▶ 001 Using config file: /home/test/vikunja/config.yml
2024-10-17T14:43:50+02:00: INFO ▶ 002 Sending testmail...
2024-10-17T14:43:50.221708022+02:00: DEBUG      ▶ [MAIL] 003 EHLO my.host.example.org
2024-10-17T14:43:50.22265456+02:00: DEBUG       ▶ [MAIL] 004 250 my.host.example.org Hello Unknown [1.1.1.1]Haraka is at your service.
PIPELINING
8BITMIME
SIZE 26214400
STARTTLS
2024-10-17T14:43:50.222815859+02:00: DEBUG      ▶ [MAIL] 005 STARTTLS
2024-10-17T14:43:50.223163142+02:00: DEBUG      ▶ [MAIL] 006 220 Go ahead.
2024-10-17T14:43:50.223265386+02:00: DEBUG      ▶ [MAIL] 007 EHLO my.host.example.org
2024-10-17T14:43:50.280249748+02:00: DEBUG      ▶ [MAIL] 008 250 my.host.example.org Hello Unknown [1.1.1.1]Haraka is at your service.
PIPELINING
8BITMIME
SIZE 26214400
AUTH PLAIN LOGIN
2024-10-17T14:43:50.280428765+02:00: DEBUG      ▶ [MAIL] 009 NOOP
2024-10-17T14:43:50.28087255+02:00: DEBUG       ▶ [MAIL] 00a 250 OK
2024-10-17T14:43:50.280936687+02:00: DEBUG      ▶ [MAIL] 00b AUTH PLAIN ***REDACTED***
2024-10-17T14:43:53.436775976+02:00: DEBUG      ▶ [MAIL] 00c 535 5.7.8 Authentication failed
2024-10-17T14:43:53.437349515+02:00: DEBUG      ▶ [MAIL] 00d *
2024-10-17T14:43:53.43830435+02:00: DEBUG       ▶ [MAIL] 00e 500 Unrecognized command
2024-10-17T14:43:53.438332067+02:00: DEBUG      ▶ [MAIL] 00f QUIT
2024-10-17T14:43:53.439407787+02:00: DEBUG      ▶ [MAIL] 010 221 my.host.example.org closing connection. Have a jolly good day.
2024-10-17T14:43:53+02:00: INFO ▶ 011 Testmail successfully sent.

I've briefly looked at the code, but I'm not really fluent in go, so I'm not sure how to properly fix this. Maybe instead of reporting "Testmail successfully sent." you could write "Testmail successfully queued."? And is there a separate queue worker which could detect the failed SMTP AUTH command and log that as ERROR?

Regards,
Tobias

Vikunja Version

0.24.4

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

### Description Hi, first of all, thanks a lot for a great program! I've just installed a test version of Vikunja on my server and tried to set up the mailing functionality. The program offers a command to send a test email, which I find very comfortable. So I asked Vikunj to send a test email to my mail address: ```shell $ ./vikunja testmail mail@example.org 2024-10-17T14:43:50+02:00: INFO ▶ 001 Using config file: /home/test/vikunja/config.yml 2024-10-17T14:43:50+02:00: INFO ▶ 002 Sending testmail... 2024-10-17T14:43:53+02:00: INFO ▶ 011 Testmail successfully sent. ``` However, despite Vikunja telling me that the mail has been sent successfully, it didn't arrive. (Please note that I didn't actually use `mail@example.org` for the testmail command, that's not the source of the error. 😄) Turning on the DEBUG log mode, I did finally spot what was wrong: I had made a tiny typo in the `config.yml` file, and the initial connection to the SMTP server succeeded, but the authentication did not: ```shell $ ./vikunja testmail mail@example.org 2024-10-17T14:43:50+02:00: INFO ▶ 001 Using config file: /home/test/vikunja/config.yml 2024-10-17T14:43:50+02:00: INFO ▶ 002 Sending testmail... 2024-10-17T14:43:50.221708022+02:00: DEBUG ▶ [MAIL] 003 EHLO my.host.example.org 2024-10-17T14:43:50.22265456+02:00: DEBUG ▶ [MAIL] 004 250 my.host.example.org Hello Unknown [1.1.1.1]Haraka is at your service. PIPELINING 8BITMIME SIZE 26214400 STARTTLS 2024-10-17T14:43:50.222815859+02:00: DEBUG ▶ [MAIL] 005 STARTTLS 2024-10-17T14:43:50.223163142+02:00: DEBUG ▶ [MAIL] 006 220 Go ahead. 2024-10-17T14:43:50.223265386+02:00: DEBUG ▶ [MAIL] 007 EHLO my.host.example.org 2024-10-17T14:43:50.280249748+02:00: DEBUG ▶ [MAIL] 008 250 my.host.example.org Hello Unknown [1.1.1.1]Haraka is at your service. PIPELINING 8BITMIME SIZE 26214400 AUTH PLAIN LOGIN 2024-10-17T14:43:50.280428765+02:00: DEBUG ▶ [MAIL] 009 NOOP 2024-10-17T14:43:50.28087255+02:00: DEBUG ▶ [MAIL] 00a 250 OK 2024-10-17T14:43:50.280936687+02:00: DEBUG ▶ [MAIL] 00b AUTH PLAIN ***REDACTED*** 2024-10-17T14:43:53.436775976+02:00: DEBUG ▶ [MAIL] 00c 535 5.7.8 Authentication failed 2024-10-17T14:43:53.437349515+02:00: DEBUG ▶ [MAIL] 00d * 2024-10-17T14:43:53.43830435+02:00: DEBUG ▶ [MAIL] 00e 500 Unrecognized command 2024-10-17T14:43:53.438332067+02:00: DEBUG ▶ [MAIL] 00f QUIT 2024-10-17T14:43:53.439407787+02:00: DEBUG ▶ [MAIL] 010 221 my.host.example.org closing connection. Have a jolly good day. 2024-10-17T14:43:53+02:00: INFO ▶ 011 Testmail successfully sent. ``` I've briefly looked at the code, but I'm not really fluent in go, so I'm not sure how to properly fix this. Maybe instead of reporting "Testmail successfully sent." you could write "Testmail successfully queued."? And is there a separate queue worker which could detect the failed SMTP AUTH command and log that as ERROR? Regards, Tobias ### Vikunja Version 0.24.4 ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
toddy added the
kind/bug
label 2024-10-17 20:53:56 +00:00
Owner

I'm not sure why the authentication failed there, but it should definitely show a proper error message in that case. Will look into making this work.

I'm not sure why the authentication failed there, but it should definitely show a proper error message in that case. Will look into making this work.
Owner

Now fixed in b5cbe99b0a, please check with the next unstable build (should be ready for deployment in ~45min, also on try).

Looks like this was a regression from 950de7c954.

Now fixed in https://kolaente.dev/vikunja/vikunja/commit/b5cbe99b0a82a2d6a86d401bb53ec44ae33bb108, please check with the next unstable build (should be ready for deployment in ~45min, also on [try](https://try.vikunja.io)). Looks like this was a regression from 950de7c954ef3799051d73bc9b728558cf166377.
Author

Hi @konrad, thanks for the quick fix. I've just tested with the unstable build and can confirm that it works as expected. 👍

Hi @konrad, thanks for the quick fix. I've just tested with the unstable build and can confirm that it works as expected. 👍
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vikunja/vikunja#2767
No description provided.