Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Tech
  3. Email verifications are not sent (other emails work)

Email verifications are not sent (other emails work)

Scheduled Pinned Locked Moved Tech
15 Posts 2 Posters 18 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C This user is from outside of this forum
    C This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #6

    Yes the checkmark is there. 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
    1 Reply Last reply
    0
    • C This user is from outside of this forum
      C This user is from outside of this forum
      [email protected]
      wrote last edited by [email protected]
      #7

      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.

      1 Reply Last reply
      0
      • C This user is from outside of this forum
        C This user is from outside of this forum
        [email protected]
        wrote last edited by [email protected]
        #8

        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.

        1 Reply Last reply
        0
        • baris@community.nodebb.orgB This user is from outside of this forum
          baris@community.nodebb.orgB This user is from outside of this forum
          [email protected]
          wrote last edited by
          #9

          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.

          1 Reply Last reply
          0
          • C This user is from outside of this forum
            C This user is from outside of this forum
            [email protected]
            wrote last edited by
            #10

            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".

            1 Reply Last reply
            0
            • C This user is from outside of this forum
              C This user is from outside of this forum
              [email protected]
              wrote last edited by
              #11

              In short:

              • email confirmation works via the email testing in /admin/settings/email => "Email testing"
              • email confirmation doesn't trigger when a user subscribes
              1 Reply Last reply
              0
              • C This user is from outside of this forum
                C This user is from outside of this forum
                [email protected]
                wrote last edited by
                #12

                Here are the installed plugins, nothing crazy:

                image.png

                1 Reply Last reply
                0
                • C This user is from outside of this forum
                  C This user is from outside of this forum
                  [email protected]
                  wrote last edited by [email protected]
                  #13

                  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"
                  
                  1 Reply Last reply
                  0
                  • baris@community.nodebb.orgB This user is from outside of this forum
                    baris@community.nodebb.orgB This user is from outside of this forum
                    [email protected]
                    wrote last edited by
                    #14

                    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.

                    1 Reply Last reply
                    0
                    • C This user is from outside of this forum
                      C This user is from outside of this forum
                      [email protected]
                      wrote last edited by
                      #15

                      Thanks, I'll check. Just to be sure: my issue is specific to welcome and verify-email emails. For instance, password reset emails work fine. So the basic email sending logic works.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups