SMTP error #1160

Closed
opened 2022-04-20 10:16:09 +00:00 by kosssi · 18 comments

Hello,

I would like to say thanks for Vikunja product 🤙

I test it and maybe propose it on my customers!

I have an error when I test SMTP configuration. I test two SMTP configurations but I always the same error: Error sending test mail: EOF with CLI and mail/func1 0a6 Error during connect to smtp server: %s EOF when I used frontend reset password.

Maybe this issue can help you to understand this error... I change all password by <private> and all domain by task.example.org.

CLI Test

$ docker exec -it task_example_org_api ash
/app/vikunja # echo $VIKUNJA_MAILER_HOST
mail.example.org
/app/vikunja # echo $VIKUNJA_MAILER_PORT
465
/app/vikunja # echo $VIKUNJA_MAILER_USERNAME
private@example.org
/app/vikunja # echo $VIKUNJA_MAILER_PASSWORD
<private>
/app/vikunja # ./vikunja testmail private@example.org
2022/04/20 11:43:36 Config File "config" Not Found in "[/app/vikunja /etc/vikunja /root/.config/vikunja]"
2022/04/20 11:43:36 Using default config.
2022/04/20 11:43:36 Redis initialized
2022-04-20T11:43:36.94952469+02:00: INFO	▶ cmd/func12 002 Sending testmail...
2022-04-20T11:45:36.97765362+02:00: ERROR	▶ cmd/func12 003 Error sending test mail: EOF

Docker compose file

$ docker compose config
name: task_example_org
services:
  vikunja_api:
    container_name: task_example_org_api
    depends_on:
      postgres:
        condition: service_started
      redis:
        condition: service_started
    environment:
      VIKUNJA_CACHE_ENABLED: "true"
      VIKUNJA_CACHE_TYPE: redis
      VIKUNJA_DATABASE_DATABASE: task_example_org_database
      VIKUNJA_DATABASE_HOST: task_example_org_postgres:5432
      VIKUNJA_DATABASE_MAXCONNECTIONLIFETIME: "10000"
      VIKUNJA_DATABASE_MAXIDLECONNECTIONS: "50"
      VIKUNJA_DATABASE_MAXOPENCONNECTIONS: "100"
      VIKUNJA_DATABASE_PASSWORD: <private>
      VIKUNJA_DATABASE_SSLMODE: disable
      VIKUNJA_DATABASE_TYPE: postgres
      VIKUNJA_DATABASE_USER: task_example_org_user
      VIKUNJA_FILES_BASEPATH: ./files
      VIKUNJA_FILES_MAXSIZE: 20MB
      VIKUNJA_LOG_DATABASE: stdout
      VIKUNJA_LOG_DATABASELEVEL: DEBUG
      VIKUNJA_LOG_ECHO: stdout
      VIKUNJA_LOG_ENABLED: "true"
      VIKUNJA_LOG_EVENTS: stdout
      VIKUNJA_LOG_EVENTSLEVEL: DEBUG
      VIKUNJA_LOG_HTTP: stdout
      VIKUNJA_LOG_LEVEL: DEBUG
      VIKUNJA_LOG_STANDARD: stdout
      VIKUNJA_MAILER_ENABLED: "true"
      VIKUNJA_MAILER_FORCESSL: "false"
      VIKUNJA_MAILER_FROMEMAIL: private@example.org
      VIKUNJA_MAILER_HOST: mail.example.org
      VIKUNJA_MAILER_PASSWORD: <private>
      VIKUNJA_MAILER_PORT: "465"
      VIKUNJA_MAILER_QUEUELENGTH: "100"
      VIKUNJA_MAILER_QUEUETIMEOUT: "30"
      VIKUNJA_MAILER_SKIPTLSVERIFY: "false"
      VIKUNJA_MAILER_USERNAME: private@example.org
      VIKUNJA_METRICS_ENABLED: "True"
      VIKUNJA_METRICS_PASSWORD: ""
      VIKUNJA_METRICS_USERNAME: ""
      VIKUNJA_REDIS_DB: "0"
      VIKUNJA_REDIS_ENABLED: "true"
      VIKUNJA_REDIS_HOST: task_example_org_redis:6379
      VIKUNJA_SERVICE_ENABLECALDAV: "True"
      VIKUNJA_SERVICE_ENABLEEMAILREMINDERS: "True"
      VIKUNJA_SERVICE_ENABLELINKSHARING: "True"
      VIKUNJA_SERVICE_ENABLEREGISTRATION: "True"
      VIKUNJA_SERVICE_ENABLETASKATTACHMENTS: "True"
      VIKUNJA_SERVICE_ENABLETASKCOMMENTS: "True"
      VIKUNJA_SERVICE_ENABLETOTP: "True"
      VIKUNJA_SERVICE_ENABLEUSERDELETION: "True"
      VIKUNJA_SERVICE_FRONTENDURL: task.example.org
      VIKUNJA_SERVICE_JWTSECRET: <secret>
      VIKUNJA_SERVICE_JWTTTL: "259200"
      VIKUNJA_SERVICE_JWTTTLLONG: "2592000"
      VIKUNJA_SERVICE_MAXITEMSPERPAGE: "50"
      VIKUNJA_SERVICE_TIMEZONE: Europe/Paris
    image: vikunja/api:0.18.1
    labels:
      traefik.docker.network: traefik
      traefik.enable: "true"
      traefik.http.routers.task_example_org-api.entrypoints: web
      traefik.http.routers.task_example_org-api.rule: Host(`task.example.org`)
        && PathPrefix(`/api/v1`, `/dav/`, `/.well-known/`)
    volumes:
    - type: volume
      source: vikunja
      target: /app/vikunja/files
      volume: {}
  vikunja_frontend:
    container_name: task_example_org_frontend
    image: vikunja/frontend:0.18.2
    labels:
      traefik.docker.network: traefik
      traefik.enable: "true"
      traefik.http.routers.task_example_org-frontend.entrypoints: web
      traefik.http.routers.task_example_org-frontend.rule: Host(`task.example.org`)
  postgres:
    container_name: task_example_org_postgres
    environment:
      POSTGRES_DB: task_example_org_database
      POSTGRES_PASSWORD: <private>
      POSTGRES_USER: task_example_org_user
    image: postgres:14.2-alpine
    volumes:
    - type: volume
      source: postgres
      target: /var/lib/postgresql/data
      volume: {}
  redis:
    container_name: task_example_org_redis
    image: redis:6.2.6-alpine
    volumes:
    - type: volume
      source: redis
      target: /data
      volume: {}
networks:
  default:
    name: traefik
volumes:
  postgres:
    name: task_example_org_postgres
  redis:
    name: task_example_org_redis
  vikunja:
    name: task_example_org

version

  • docker version: 20.10.14
  • docker compose version: 2.3.0
  • api image: vikunja/api:0.18.1
  • frontend image: vikunja/frontend:0.18.2
Hello, I would like to say thanks for Vikunja product 🤙 I test it and maybe propose it on my customers! I have an error when I test SMTP configuration. I test two SMTP configurations but I always the same error: `Error sending test mail: EOF` with CLI and `mail/func1 0a6 Error during connect to smtp server: %s EOF` when I used frontend reset password. Maybe this issue can help you to understand this error... I change all password by `<private>` and all domain by `task.example.org`. ## CLI Test ``` $ docker exec -it task_example_org_api ash /app/vikunja # echo $VIKUNJA_MAILER_HOST mail.example.org /app/vikunja # echo $VIKUNJA_MAILER_PORT 465 /app/vikunja # echo $VIKUNJA_MAILER_USERNAME private@example.org /app/vikunja # echo $VIKUNJA_MAILER_PASSWORD <private> /app/vikunja # ./vikunja testmail private@example.org 2022/04/20 11:43:36 Config File "config" Not Found in "[/app/vikunja /etc/vikunja /root/.config/vikunja]" 2022/04/20 11:43:36 Using default config. 2022/04/20 11:43:36 Redis initialized 2022-04-20T11:43:36.94952469+02:00: INFO ▶ cmd/func12 002 Sending testmail... 2022-04-20T11:45:36.97765362+02:00: ERROR ▶ cmd/func12 003 Error sending test mail: EOF ``` ## Docker compose file ```yml $ docker compose config name: task_example_org services: vikunja_api: container_name: task_example_org_api depends_on: postgres: condition: service_started redis: condition: service_started environment: VIKUNJA_CACHE_ENABLED: "true" VIKUNJA_CACHE_TYPE: redis VIKUNJA_DATABASE_DATABASE: task_example_org_database VIKUNJA_DATABASE_HOST: task_example_org_postgres:5432 VIKUNJA_DATABASE_MAXCONNECTIONLIFETIME: "10000" VIKUNJA_DATABASE_MAXIDLECONNECTIONS: "50" VIKUNJA_DATABASE_MAXOPENCONNECTIONS: "100" VIKUNJA_DATABASE_PASSWORD: <private> VIKUNJA_DATABASE_SSLMODE: disable VIKUNJA_DATABASE_TYPE: postgres VIKUNJA_DATABASE_USER: task_example_org_user VIKUNJA_FILES_BASEPATH: ./files VIKUNJA_FILES_MAXSIZE: 20MB VIKUNJA_LOG_DATABASE: stdout VIKUNJA_LOG_DATABASELEVEL: DEBUG VIKUNJA_LOG_ECHO: stdout VIKUNJA_LOG_ENABLED: "true" VIKUNJA_LOG_EVENTS: stdout VIKUNJA_LOG_EVENTSLEVEL: DEBUG VIKUNJA_LOG_HTTP: stdout VIKUNJA_LOG_LEVEL: DEBUG VIKUNJA_LOG_STANDARD: stdout VIKUNJA_MAILER_ENABLED: "true" VIKUNJA_MAILER_FORCESSL: "false" VIKUNJA_MAILER_FROMEMAIL: private@example.org VIKUNJA_MAILER_HOST: mail.example.org VIKUNJA_MAILER_PASSWORD: <private> VIKUNJA_MAILER_PORT: "465" VIKUNJA_MAILER_QUEUELENGTH: "100" VIKUNJA_MAILER_QUEUETIMEOUT: "30" VIKUNJA_MAILER_SKIPTLSVERIFY: "false" VIKUNJA_MAILER_USERNAME: private@example.org VIKUNJA_METRICS_ENABLED: "True" VIKUNJA_METRICS_PASSWORD: "" VIKUNJA_METRICS_USERNAME: "" VIKUNJA_REDIS_DB: "0" VIKUNJA_REDIS_ENABLED: "true" VIKUNJA_REDIS_HOST: task_example_org_redis:6379 VIKUNJA_SERVICE_ENABLECALDAV: "True" VIKUNJA_SERVICE_ENABLEEMAILREMINDERS: "True" VIKUNJA_SERVICE_ENABLELINKSHARING: "True" VIKUNJA_SERVICE_ENABLEREGISTRATION: "True" VIKUNJA_SERVICE_ENABLETASKATTACHMENTS: "True" VIKUNJA_SERVICE_ENABLETASKCOMMENTS: "True" VIKUNJA_SERVICE_ENABLETOTP: "True" VIKUNJA_SERVICE_ENABLEUSERDELETION: "True" VIKUNJA_SERVICE_FRONTENDURL: task.example.org VIKUNJA_SERVICE_JWTSECRET: <secret> VIKUNJA_SERVICE_JWTTTL: "259200" VIKUNJA_SERVICE_JWTTTLLONG: "2592000" VIKUNJA_SERVICE_MAXITEMSPERPAGE: "50" VIKUNJA_SERVICE_TIMEZONE: Europe/Paris image: vikunja/api:0.18.1 labels: traefik.docker.network: traefik traefik.enable: "true" traefik.http.routers.task_example_org-api.entrypoints: web traefik.http.routers.task_example_org-api.rule: Host(`task.example.org`) && PathPrefix(`/api/v1`, `/dav/`, `/.well-known/`) volumes: - type: volume source: vikunja target: /app/vikunja/files volume: {} vikunja_frontend: container_name: task_example_org_frontend image: vikunja/frontend:0.18.2 labels: traefik.docker.network: traefik traefik.enable: "true" traefik.http.routers.task_example_org-frontend.entrypoints: web traefik.http.routers.task_example_org-frontend.rule: Host(`task.example.org`) postgres: container_name: task_example_org_postgres environment: POSTGRES_DB: task_example_org_database POSTGRES_PASSWORD: <private> POSTGRES_USER: task_example_org_user image: postgres:14.2-alpine volumes: - type: volume source: postgres target: /var/lib/postgresql/data volume: {} redis: container_name: task_example_org_redis image: redis:6.2.6-alpine volumes: - type: volume source: redis target: /data volume: {} networks: default: name: traefik volumes: postgres: name: task_example_org_postgres redis: name: task_example_org_redis vikunja: name: task_example_org ``` ## version - docker version: 20.10.14 - docker compose version: 2.3.0 - api image: vikunja/api:0.18.1 - frontend image: vikunja/frontend:0.18.2
Owner

Are you sure the mailserver port is correct? And whether it uses TLS or not?

Are you sure the mailserver port is correct? And whether it uses TLS or not?
Owner

Can you check if you can send emails with the unstable version?

Can you check if you can send emails with the unstable version?
Author

@konrad thanks, it's my config:

VIKUNJA_MAILER_PORT: "465" -> VIKUNJA_MAILER_PORT: "587"

or

VIKUNJA_MAILER_FORCESSL: false -> VIKUNJA_MAILER_FORCESSL: true

sorry for inconvenience!

@konrad thanks, it's my config: VIKUNJA_MAILER_PORT: "465" -> VIKUNJA_MAILER_PORT: "587" or VIKUNJA_MAILER_FORCESSL: false -> VIKUNJA_MAILER_FORCESSL: true sorry for inconvenience!

Hi,

Could you point out where I can find the config file to change my mailserver settings? Having the same issue, I'm not getting the email when I hit "Reset Password".

Thanks

Hi, Could you point out where I can find the config file to change my mailserver settings? Having the same issue, I'm not getting the email when I hit "Reset Password". Thanks
Owner

@agichim How are you hosting it? With docker, you'll likely need to create additional env variables in your config. If you're not hosting with docker and don't have a config file, you'll need to create one. Check out the docs about supported locations.

@agichim How are you hosting it? With docker, you'll likely need to create additional env variables in your config. If you're not hosting with docker and don't have a config file, you'll need to create one. [Check out the docs](https://vikunja.io/docs/config-options/#config-file-locations) about supported locations.

I'm hosting via YunoHost. I found the config.yml file (which is exactly like the sample one) in etc/vikunja. But I get that I don't have to edit that file? I still need to create one?
I'm reading the docs but can't really understand where exactly I have to create the config file.

I'm not well versed in server configuration. Just learning as I go.

I'm hosting via YunoHost. I found the config.yml file (which is exactly like the [sample one](https://kolaente.dev/vikunja/api/src/branch/main/config.yml.sample)) in `etc/vikunja`. But I get that I don't have to edit that file? I still need to create one? I'm reading the docs but can't really understand where exactly I have to create the config file. I'm not well versed in server configuration. Just learning as I go.

UPDATE:

So I keep forgetting to check the YunoHost repo README for each app. I know where to create the config.yml file. I'm still not sure how the content needs to look like, that will require more knowledge than what I have currently.

But, I got in the API docs of my instance and on the Reset password section I get this error message {"message":"missing or malformed jwt"}. I'll look into the Vikunja docs tomorrow, unsure I know what I'm looking for.

Cheers

UPDATE: So I keep forgetting to check the YunoHost repo README for each app. I know where to create the config.yml file. I'm still not sure how the content needs to look like, that will require more knowledge than what I have currently. But, I got in the API docs of my instance and on the Reset password section I get this error message `{"message":"missing or malformed jwt"}`. I'll look into the Vikunja docs tomorrow, unsure I know what I'm looking for. Cheers
Owner

If you have a config file, you'll need to edit it.

In the config there's a section about the mailer: https://kolaente.dev/vikunja/api/src/branch/main/config.yml.sample#L120-L140

That's where you need to configure your mailserver credentials.

The password reset works best when you use it through the frontend. You shouldn't need to use the api manually.

If you have a config file, you'll need to edit it. In the config there's a section about the mailer: https://kolaente.dev/vikunja/api/src/branch/main/config.yml.sample#L120-L140 That's where you need to configure your mailserver credentials. The password reset works best when you use it through the frontend. You shouldn't need to use the api manually.

Just to understand this correctly, I have a file in etc/vikunja, it looks exactly like the sample file you linked to above and that's the file I have to edit?

Just to understand this correctly, I have a file in `etc/vikunja`, it looks exactly like the sample file you linked to above and that's the file I have to edit?
Owner

Yes.

Yes.

There is something that I'm missing. This is my mailer config and it doesn't work. Again, I'm a newbie with some of these things.

mailer:
  # Whether to enable the mailer or not. If it is disabled, all users are enabled right away and password reset is not possible.
  enabled: true
  # SMTP Host
  host: ""
  # SMTP Host port
  port: 587
  # SMTP username
  username: "user"
  # SMTP password
  password: ""
  # Wether to skip verification of the tls certificate on the server
  skiptlsverify: false
  # The default from address when sending emails
  fromemail: "mail@vikunja"
  # 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
There is something that I'm missing. This is my mailer config and it doesn't work. Again, I'm a newbie with some of these things. ```yml mailer: # Whether to enable the mailer or not. If it is disabled, all users are enabled right away and password reset is not possible. enabled: true # SMTP Host host: "" # SMTP Host port port: 587 # SMTP username username: "user" # SMTP password password: "" # Wether to skip verification of the tls certificate on the server skiptlsverify: false # The default from address when sending emails fromemail: "mail@vikunja" # 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 ```
Owner

You need an SMTP server account to send mails. Then enter these credentials in the host, username, password and port options.

You need an SMTP server account to send mails. Then enter these credentials in the host, username, password and port options.

I'm feeling terrible to be such a bother.
I'm pretty sure it's all configured OK but it's not working.
I have also restarted the server after editing the config file.

mailer:
  # Whether to enable the mailer or not. If it is disabled, all users are enabled right away and password reset is not possible.
  enabled: true
  # SMTP Host
  host: "host.com"
  # SMTP Host port
  port: 587
  # SMTP username
  username: "private@host.com"
  # SMTP password
  password: "password"
  # Wether to skip verification of the tls certificate on the server
  skiptlsverify: true
  # The default from address when sending emails
  fromemail: "private@host.com"
  # 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
I'm feeling terrible to be such a bother. I'm pretty sure it's all configured OK but it's not working. I have also restarted the server after editing the config file. ```yml mailer: # Whether to enable the mailer or not. If it is disabled, all users are enabled right away and password reset is not possible. enabled: true # SMTP Host host: "host.com" # SMTP Host port port: 587 # SMTP username username: "private@host.com" # SMTP password password: "password" # Wether to skip verification of the tls certificate on the server skiptlsverify: true # The default from address when sending emails fromemail: "private@host.com" # 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 ```
Owner

Are you able to send a testmail through the command https://vikunja.io/docs/cli/#testmail?

What error message do you get?

Are you able to send a testmail through the command https://vikunja.io/docs/cli/#testmail? What error message do you get?

Yes! I received the testmail instantly.

When I click "Reset password" it confirms the email was sent. No error message.

I also checked SPAM folder. Emails don't land there.

Yes! I received the testmail instantly. When I click "Reset password" it confirms the email was sent. No error message. I also checked SPAM folder. Emails don't land there.

I also tried to reset password via CLI without parameters and it didn't send the email. But I did just manage to change the password via CLI and it worked. I'll do that for now.

Thanks for the follow-up though.

What's the name of the log file I should check to see why the email doesn't get sent?

I also tried to reset password via CLI without parameters and it didn't send the email. But I did just manage to change the password via CLI and it worked. I'll do that for now. Thanks for the follow-up though. What's the name of the log file I should check to see why the email doesn't get sent?
Owner

What does the log section look like? Like the one that ships with yunohost https://github.com/YunoHost-Apps/vikunja_ynh/blob/master/conf/config.yml#L121-L141

If you have the standard logger set to file, it will put everything in a file in /var/log. If it is set to stdout you'll need to check somewhere else, probably systemd. I don't really know how that works with yunohost so I'd advise you to either set the logger to file and check the file or ask in the GitHub repo https://github.com/YunoHost-Apps/vikunja_ynh/issues

What does the log section look like? Like the one that ships with yunohost https://github.com/YunoHost-Apps/vikunja_ynh/blob/master/conf/config.yml#L121-L141 If you have the standard logger set to file, it will put everything in a file in /var/log. If it is set to stdout you'll need to check somewhere else, probably systemd. I don't really know how that works with yunohost so I'd advise you to either set the logger to file and check the file or ask in the GitHub repo https://github.com/YunoHost-Apps/vikunja_ynh/issues

I've seen your last comment, I just don't have the necessary time to look at it calmly.

I've seen your last comment, I just don't have the necessary time to look at it calmly.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1160
No description provided.