AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

[Bug]:

Open autonomoustrading opened this issue 2 months ago • 4 comments

What happened?

I configured email on self host working fine but when i try to add members inviting by email or share link none of them gets anything

Distribution version

Web (https://app.affine.pro)

App Version

sel-hosted

What browsers are you seeing the problem on if you're using web version?

Chrome

Are you self-hosting?

  • [x] Yes

Self-hosting Version

0.25.1

Relevant log output

[Nest] 1  - 10/27/2025, 12:24:40 AM   DEBUG [job] <selfhosted:event:6380c8c7-dc50-4905-a6d2-1361ce8efa20> Added job [notification.sendMail] to queue, signal=retry
[Nest] 1  - 10/27/2025, 12:24:40 AM     LOG [job] <selfhosted:graphql:0339d60a-92d7-454e-952a-ff81d4f57aa5> Job started: [notification.sendMail] (MailJob.sendMail, id=21)
[Nest] 1  - 10/27/2025, 12:24:41 AM   ERROR [MailSender] <selfhosted:graphql:0339d60a-92d7-454e-952a-ff81d4f57aa5> Failed to send mail [MemberInvitation].
Error: Connection closed unexpectedly
    at SMTPConnection._onClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:863:34)
    at SMTPConnection._onSocketClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:197:42)
    at Object.onceWrapper (node:events:634:26)
    at Socket.emit (node:events:519:28)
    at TCP.<anonymous> (node:net:346:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

Anything else?

No response

autonomoustrading avatar Oct 27 '25 00:10 autonomoustrading

Issue Status: 🆕 *Untriaged

*🆕 Untriaged

The team has not yet reviewed the issue. We usually do it within one business day. Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.

affine-issue-bot[bot] avatar Oct 27 '25 00:10 affine-issue-bot[bot]

I used the same email address to sign up for the cloud versionm then tried to invite members but I get the same problem, no emails are sent. - never seen this before, too much complication to get started, wasted hours with something expected to be simple.

autonomoustrading avatar Oct 27 '25 05:10 autonomoustrading

which email provider are you using? what's the email domain of the users you're inviting?

darkskygit avatar Oct 29 '25 13:10 darkskygit

Same problem is happening to our deployment, and only since we upgraded to 0.25.1. It had been working fine with all previous versions, but somehow it has become broken now, without having modified any of the MAILER_* env vars.

tranchis avatar Nov 03 '25 13:11 tranchis

Still the same problem with 0.25.4.

Interestingly enough, the e-mail is correctly send using the "Sent test email" feature from Settings -> Notifications, but all other mails fail with the same stack trace:

[Nest] 1  - 11/14/2025, 2:51:46 PM   ERROR [MailSender] <selfhosted:graphql:a6e393dd-3792-4291-bbd9-c7b410b1855b> Failed to send mail [Mention].
Error: Connection closed unexpectedly
    at SMTPConnection._onClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:863:34)
    at SMTPConnection._onSocketClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:197:42)
    at Object.onceWrapper (node:events:634:26)
    at Socket.emit (node:events:519:28)
    at TCP.<anonymous> (node:net:346:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

tranchis avatar Nov 14 '25 15:11 tranchis

Still the same problem with 0.25.4.

Interestingly enough, the e-mail is correctly send using the "Sent test email" feature from Settings -> Notifications, but all other mails fail with the same stack trace:

[Nest] 1  - 11/14/2025, 2:51:46 PM   ERROR [MailSender] <selfhosted:graphql:a6e393dd-3792-4291-bbd9-c7b410b1855b> Failed to send mail [Mention].
Error: Connection closed unexpectedly
    at SMTPConnection._onClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:863:34)
    at SMTPConnection._onSocketClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:197:42)
    at Object.onceWrapper (node:events:634:26)
    at Socket.emit (node:events:519:28)
    at TCP.<anonymous> (node:net:346:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

set 'Name of the email server' in notifications

darkskygit avatar Nov 14 '25 15:11 darkskygit

This worked! Thanks a lot!!!

Still the same problem with 0.25.4. Interestingly enough, the e-mail is correctly send using the "Sent test email" feature from Settings -> Notifications, but all other mails fail with the same stack trace:

[Nest] 1  - 11/14/2025, 2:51:46 PM   ERROR [MailSender] <selfhosted:graphql:a6e393dd-3792-4291-bbd9-c7b410b1855b> Failed to send mail [Mention].
Error: Connection closed unexpectedly
    at SMTPConnection._onClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:863:34)
    at SMTPConnection._onSocketClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:197:42)
    at Object.onceWrapper (node:events:634:26)
    at Socket.emit (node:events:519:28)
    at TCP.<anonymous> (node:net:346:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

set 'Name of the email server' in notifications

tranchis avatar Nov 14 '25 16:11 tranchis

This worked! Thanks a lot!!!

Still the same problem with 0.25.4. Interestingly enough, the e-mail is correctly send using the "Sent test email" feature from Settings -> Notifications, but all other mails fail with the same stack trace:

[Nest] 1  - 11/14/2025, 2:51:46 PM   ERROR [MailSender] <selfhosted:graphql:a6e393dd-3792-4291-bbd9-c7b410b1855b> Failed to send mail [Mention].
Error: Connection closed unexpectedly
    at SMTPConnection._onClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:863:34)
    at SMTPConnection._onSocketClose (/app/node_modules/nodemailer/lib/smtp-connection/index.js:197:42)
    at Object.onceWrapper (node:events:634:26)
    at Socket.emit (node:events:519:28)
    at TCP.<anonymous> (node:net:346:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

set 'Name of the email server' in notifications

thanks feedback, i will close this issue if you still encounter this problem, you can reopen this issue

darkskygit avatar Nov 14 '25 17:11 darkskygit