Skip to content

Email verifications are not sent (other emails work)

Uncategorized
14 2 33
  • nodebb version: 4.1.0.
    installed via YunoHost on dedicated server

    Hello!
    I use Gmail to send the emails, with a personal account. I have just set up the forum, so it's only me creating test users for now.

    When I test the emailing, all tests work except "verify-email". It doesn't even arrive in spams. I have tried sending to my Gmail address, a Google workspace address and an Infomaniak address, the email verification emails are never to be seen, even in spams.. I can reproduce with the test button in Admin and by creating an account with an email address.

    The other emails work: invitations, banned, welcome, etc. The logs don't show errors.

    Any idea? Thanks!

    By the way, I use PosgreSQL.

  • nodebb version: 4.1.0.
    installed via YunoHost on dedicated server

    Hello!
    I use Gmail to send the emails, with a personal account. I have just set up the forum, so it's only me creating test users for now.

    When I test the emailing, all tests work except "verify-email". It doesn't even arrive in spams. I have tried sending to my Gmail address, a Google workspace address and an Infomaniak address, the email verification emails are never to be seen, even in spams.. I can reproduce with the test button in Admin and by creating an account with an email address.

    The other emails work: invitations, banned, welcome, etc. The logs don't show errors.

    Any idea? Thanks!

    Does it have the checkmark next to their email as well? You can also check the db and see if an email is set in the email field.

  • nodebb version: 4.1.0.
    installed via YunoHost on dedicated server

    Hello!
    I use Gmail to send the emails, with a personal account. I have just set up the forum, so it's only me creating test users for now.

    When I test the emailing, all tests work except "verify-email". It doesn't even arrive in spams. I have tried sending to my Gmail address, a Google workspace address and an Infomaniak address, the email verification emails are never to be seen, even in spams.. I can reproduce with the test button in Admin and by creating an account with an email address.

    The other emails work: invitations, banned, welcome, etc. The logs don't show errors.

    Any idea? Thanks!

    Yes the checkmark is there for the user I'm testing with. I have access to the PostgreSQL db, but the model is really twisted, I don't know where to find user data.

    Table list:

    • legacy_hash
    • legacy_list
    • legacy_object
    • legacy_set
    • legacy_string
    • legacy_zset
    • searchchat
    • searchpost
    • searchtopic
    • session
  • nodebb version: 4.1.0.
    installed via YunoHost on dedicated server

    Hello!
    I use Gmail to send the emails, with a personal account. I have just set up the forum, so it's only me creating test users for now.

    When I test the emailing, all tests work except "verify-email". It doesn't even arrive in spams. I have tried sending to my Gmail address, a Google workspace address and an Infomaniak address, the email verification emails are never to be seen, even in spams.. I can reproduce with the test button in Admin and by creating an account with an email address.

    The other emails work: invitations, banned, welcome, etc. The logs don't show errors.

    Any idea? Thanks!

    baris Here is a typical problematic user hash: the user registered, entered an email (because forced to via configuration), but never received a confirmation email:

    {
      "uid": 21,
      "status": "online",
      "joindate": 1748003306464,
      "password": "$2b$12$w...nMKtMZ.",
      "username": "(redacted)",
      "userslug": "(redacted)",
      "lastonline": 1748003306464,
      "profileviews": 1,
      "password:shaWrapped": 1
    }
    

    I see the provided email address in the approval queue, but when I approve the user, the email address is not added to the approved user.

  • support@community.nodebb.orgS support@community.nodebb.org shared this topic
  • I see hashes like that, but they all have "forced" = true, so I think it's email sending tests:

    {
      "eid": 4,
      "uid": 1,
      "type": "email-confirmation-sent",
      "email": "(redacted)",
      "force": true,
      "timestamp": 1739543397355,
      "confirm_code": "fa8efa3e-e3a5-4522-b2bd-5656e6b79795"
    }
    

    Edit: I'm on nodebb 4.2.0.

  • creozote If you see that event in the events page that means the code reached all the way to the email sending logic here https://github.com/NodeBB/NodeBB/blob/master/src/user/email.js#L165-L176.

    You can open up src/emailer.js and add some console.logs to see if the email is being sent. Put a log before this line and see what the data object has.

  • That's the issue: the "email-confirmation-sent" events don't occur unless I force them by using the email testing feature in /admin/settings/email => "Email testing".

  • In short:

    • email confirmation works via the email testing in /admin/settings/email => "Email testing"
    • email confirmation doesn't trigger when a user subscribes
  • Here are the installed plugins, nothing crazy:

    image.png

    Link Preview Image
  • I have edited the JS function this way and rebuilt nodebb:

    Emailer.sendViaFallback = async (data) => {
            // Some minor alterations to the data to conform to nodemailer standard
            data.text = data.plaintext;
            delete data.plaintext;
    
            // use an address object https://nodemailer.com/message/addresses/
            data.from = {
                    name: data.from_name,
                    address: data.from,
            };
            delete data.from_name;
            console.log(data);
            await Emailer.fallbackTransport.sendMail(data);
    };
    

    I subscribed a user, but I don't see any relevant output in /admin/advanced/logs:

    2025-05-23T15:41:36.438Z [43589/1152228] - info: 🎉 NodeBB Ready
    2025-05-23T15:41:36.439Z [43589/1152228] - info: 🤝 Enabling 'trust proxy'
    2025-05-23T15:41:36.441Z [43589/1152228] - info: 📡 NodeBB is now listening on: 127.0.0.1:xxx
    2025-05-23T15:41:36.441Z [43589/1152228] - info: 🔗 Canonical URL: https://forum.xxx.com/
    io: 0 emit [ 'checkSession', 0 ]
    io: 0 emit [ 'setHostname', 'xxx.com' ]
    io: 0 emit [ 'checkSession', 0 ]
    io: 0 emit [ 'setHostname', 'xxx.com' ]
    io: 0 on [ { type: 2, nsp: '/', id: 0, data: [ 'meta.reconnected', null ] } ]
    io: 0 on [ { type: 2, nsp: '/', id: 7, data: [ 'meta.reconnected', null ] } ]
    io: 3 emit [ 'checkSession', 3 ]
    io: 3 emit [ 'setHostname', 'xxx.com' ]
    io: 3 on [ { type: 2, nsp: '/', id: 11, data: [ 'meta.reconnected', null ] } ]
    2.10.184.192 - - [23/May/2025:15:41:39 +0000] "GET /assets/uploads/system/favicon.ico?v=0daa45086ca HTTP/1.1" 404 9 "https://forum.xxx.com/admin/advanced/events" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"
    2.10.184.192 - - [23/May/2025:15:41:39 +0000] "GET /api/v3/chats/unread HTTP/1.1" 304 - "https://forum.xxx.com/admin/advanced/events" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"
    WARNING: The keyword 'none' must be used as a single argument.
        ../../../bootstrap/scss/mixins/_box-shadow.scss 10:9   box-shadow()
        ../../../bootstrap/scss/forms/_form-control.scss 40:7  @import
        bootstrap/scss/_forms.scss 3:9                         @import
        - 19:9                                                 root stylesheet
    
    WARNING: The keyword 'none' must be used as a single argument.
        ../../../bootstrap/scss/mixins/_box-shadow.scss 10:9  box-shadow()
        ../../../bootstrap/scss/forms/_form-select.scss 32:7  @import
        bootstrap/scss/_forms.scss 4:9                        @import
        - 19:9                                                root stylesheet
    
    io: 3 on [
      {
        type: 2,
        nsp: '/',
        id: 12,
        data: [ 'meta.rooms.leaveCurrent', null ]
      }
    ]
    2.10.184.192 - - [23/May/2025:15:42:55 +0000] "GET /api/admin/advanced/logs?_=1748014516470 HTTP/1.1" 200 - "https://forum.xxx.com/admin/advanced/events" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"
    
  • For new users the verification email should be sent during user creation here put some console.logs there to see if the email is in the data object. The difference is the template used. User.create uses the welcome template and manual verification uses the verify-email template but otherwise the email sending logic is the same.