Mail configuration

Hello,

I've been trying to configure the mailer of the Joplin server I've followed the link bellow.

Problem is that I'm getting always the sames error

joplin_app  | 2023-10-17 08:50:30: EmailService: Email was queued - scheduling maintenance
joplin_app  | 2023-10-17 08:50:30: App: POST /admin/users/XJ7l4HiJkqfltLQblxIOdh (302) (175ms)
joplin_app  | 2023-10-17 08:50:31: App: GET /admin/users//XJ7l4HiJkqfltLQblxIOdh (200) (14ms)
joplin_app  | 2023-10-17 08:50:31: App: GET /css/bulma.min.css (200) (1ms)
joplin_app  | 2023-10-17 08:50:32: App: GET /css/main.css (200) (2ms)
joplin_app  | 2023-10-17 08:50:32: App: GET /css/fontawesome/css/all.min.css (200) (1ms)
joplin_app  | 2023-10-17 08:50:32: App: GET /js/zxcvbn.js (200) (1ms)
joplin_app  | 2023-10-17 08:50:32: App: GET /js/jquery.min.js (200) (1ms)
joplin_app  | 2023-10-17 08:50:32: App: GET /css/index/user.css (200) (1ms)
joplin_app  | 2023-10-17 08:50:32: App: GET /js/main.js (200) (1ms)
joplin_app  | 2023-10-17 08:50:32: App: GET /images/Logo.png (200) (1ms)
joplin_app  | 2023-10-17 08:50:32: App: GET /css/fontawesome/webfonts/fa-solid-900.woff2 (200) (1ms)
joplin_app  | 2023-10-17 08:50:40: [warn] BaseService: Untitled: Skipping maintenance because it is already in progress
joplin_app  | 2023-10-17 08:51:01: [error] EmailService: Could not run maintenance: Error: Could not initialize transporter. Service will be disabled: Connection timeout
joplin_app  |     at SMTPConnection._formatError (/home/joplin/packages/server/node_modules/nodemailer/lib/smtp-connection/index.js:790:19)
joplin_app  |     at SMTPConnection._onError (/home/joplin/packages/server/node_modules/nodemailer/lib/smtp-connection/index.js:776:20)
joplin_app  |     at Timeout.<anonymous> (/home/joplin/packages/server/node_modules/nodemailer/lib/smtp-connection/index.js:235:22)
joplin_app  |     at listOnTimeout (node:internal/timers:569:17)
joplin_app  |     at processTimers (node:internal/timers:512:7) {
joplin_app  |   code: 'ETIMEDOUT',
joplin_app  |   command: 'CONN'
joplin_app  | }
joplin_app  | 2023-10-17 08:51:01: EmailService: Maintenance completed in 120214ms

Compose config:

      #Mail configuration for joplinserver
      - MAILER_ENABLED=1
      - MAILER_HOST=mail.domain.online
      - MAILER_PORT=465
      - MAILER_SECURITY=starttls
      - MAILER_AUTH_USER=XXXXXXXX@domain.online
      - MAILER_AUTH_PASSWORD=XXXXXXXXXXXXXXXX
      - MAILER_NOREPLY_NAME=joplinapp
      - MAILER_NOREPLY_EMAIL=XXXXXXXX@domain.online

I do believe that I have everything right, I have no idea why is the error occurring.

Thank you.

I have just had a look at my docker-compose.yml file for my Joplin Server which has email activated. I cannot remember doing it (!) but in this post I mentioned that I added a port mapping for port 465 from the container to the host to get the mail to work.

        ports:
            - "22300:22300"
            - "465:465"

Worth a try???

@dpoulton, my mail server is in container in the same host as Joplin Server, I do believe that it would most likely be a conflict between the ports.

OK. I am using a third-party external mail server rather than run one myself.

I've found the solution and it is a dumb one.

So there is no reason for Joplin Server to outside if the email server is in the same server or docker container.
So I changed the /etc/hosts files in order to have the IP pointing to the hostname of the mail server and is working.

Long story short.

If you have you mail server running in the same network as the Joplin Server go to:

$ sudo /etc/hosts

and add the IP address and the mail server, although in my case is the same Joplin or my firewall doesn't seem to like it, example:

192.168.1.2 mail.domain.example

I've tested with the localhost and 127.0.0.1 and it didn't work.

In hopes this helps.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.