go-vikunja / vikunja

Mirror of vikunja from https://code.vikunja.io/api
GNU Affero General Public License v3.0
1.02k stars 70 forks source link

Testmail CLI dosent work correctly. #324

Closed majster95 closed 2 months ago

majster95 commented 2 months ago

Description

Hi, I'm trying to setup SMTP mailer.

I put my SMTP settings and run testmail function, i received "Testmail successfully sent" output but i didnt received any email. Then, I set wrong password to check for the output and for my suprise I also received "Testmail successfully sent", so that function for sure dosent work correctly.

Btw, Is any chance that Hetzner blocks SMTP requests and that's I cannot send any mail through Vikunja ?

Best regards

Vikunja Version

unstable

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Please select

Screenshots

No response

kolaente commented 2 months ago

I put my SMTP settings and run testmail function, i received "Testmail successfully sent" output but i didnt received any email.

Did you check the logs of your mail server?

You can also enable more mail logs in Vikunja: https://vikunja.io/docs/config-options#mail

Then, I set wrong password to check for the output and for my suprise I also received "Testmail successfully sent" output, so that function for sure dosent work correctly.

The cli does not ask for a password. Where did you set a password?

majster95 commented 2 months ago

I put my SMTP settings and run testmail function, i received "Testmail successfully sent" output but i didnt received any email.

Did you check the logs of your mail server?

You can also enable more mail logs in Vikunja: https://vikunja.io/docs/config-options#mail

Then, I set wrong password to check for the output and for my suprise I also received "Testmail successfully sent" output, so that function for sure dosent work correctly.

The cli does not ask for a password. Where did you set a password?

I set my password for SMTP by VIKUNJA_MAILER_PASSWORD env.

services:
  vikunja:
    image: vikunja/vikunja:unstable
    environment:
      VIKUNJA_SERVICE_PUBLICURL: website
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: password
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: vikunja
      VIKUNJA_DATABASE_DATABASE: vikunja
      VIKUNJA_SERVICE_ENABLEREGISTRATION: true
      VIKUNJA_SERVICE_JWTSECRET:  secret
      VIKUNJA_MAILER_ENABLED: true
      VIKUNJA_MAILER_HOST: smtp-mail.outlook.com
      VIKUNJA_MAILER_PORT: 587
      VIKUNJA_MAILER_USERNAME: account@outlook.com
      VIKUNJA_MAILER_PASSWORD: password 
      VIKUNJA_MAILER_FROMEMAIL: email@outlook.com
      VIKUNJA_MAILER_FORCESSL: false
      VIKUNJA_MAILER_AUTHTYPE: login

Update:

Ok, now i got more detailed output with debug log level. I'll try to investigate it more and come with an answer.

Thank you

majster95 commented 2 months ago

I still dont receive any email

2024-09-13T08:30:57.864798309Z: INFO    ▶ cmd/func12 002 Sending testmail...
2024-09-13T08:30:57.91493268Z: DEBUG    ▶ [MAIL] 003 EHLO 06f3b9808f93
2024-09-13T08:30:57.927409548Z: DEBUG   ▶ [MAIL] 004 250 changed_here.outlook.office365.com Hello [changed here]
SIZE 157286400
PIPELINING
DSN
ENHANCEDSTATUSCODES
STARTTLS
8BITMIME
BINARYMIME
CHUNKING
SMTPUTF8
2024-09-13T08:30:57.927576257Z: DEBUG   ▶ [MAIL] 005 STARTTLS
2024-09-13T08:30:57.939929403Z: DEBUG   ▶ [MAIL] 006 220 2.0.0 SMTP server ready
2024-09-13T08:30:57.940054943Z: DEBUG   ▶ [MAIL] 007 EHLO 06f3b9808f93
2024-09-13T08:30:58.006206862Z: DEBUG   ▶ [MAIL] 008 250 changed_here.outlook.office365.com Hello [changed here]
SIZE 157286400
PIPELINING
DSN
ENHANCEDSTATUSCODES
AUTH LOGIN XOAUTH2
8BITMIME
BINARYMIME
CHUNKING
SMTPUTF8
2024-09-13T08:30:58.006348683Z: DEBUG   ▶ [MAIL] 009 NOOP
2024-09-13T08:31:03.012112149Z: DEBUG   ▶ [MAIL] 00a 250 2.0.0 OK
2024-09-13T08:31:03.012299768Z: INFO    ▶ cmd/func12 00b Testmail successfully sent.
kolaente commented 2 months ago

What do the logs of your mail server say?

majster95 commented 2 months ago

It seems it was a problem with SMTP server, got it working with Gmail.

Thank you