SMTP not working.

Technical Support
  • Hi, I keep on having issues with emails not being sent on my forum.
    The settings are as follows:
    nodebb.png
    Board is in italian, but as you can see all settings should work just fine.

    I get this error in my log files:

    2020-12-04T17:49:39.391Z [4567/7181] - error: Error: Connection timeout
        at SMTPConnection._formatError (/home/user/NodeBB/node_modules/nodemailer/lib/smtp-connection/index.js:774:19)
        at SMTPConnection._onError (/home/user/NodeBB/node_modules/nodemailer/lib/smtp-connection/index.js:760:20)
        at Timeout.<anonymous> (/home/user/NodeBB/node_modules/nodemailer/lib/smtp-connection/index.js:229:22)
        at listOnTimeout (internal/timers.js:554:17)
        at processTimers (internal/timers.js:497:7)
    2020-12-04T17:49:42.785Z [4567/7181] - error: Error: Connection timeout
        at SMTPConnection._formatError (/home/user/NodeBB/node_modules/nodemailer/lib/smtp-connection/index.js:774:19)
        at SMTPConnection._onError (/home/user/NodeBB/node_modules/nodemailer/lib/smtp-connection/index.js:760:20)
        at Timeout.<anonymous> (/home/user/NodeBB/node_modules/nodemailer/lib/smtp-connection/index.js:229:22)
        at listOnTimeout (internal/timers.js:554:17)
        at processTimers (internal/timers.js:497:7)
    

    I really can't find a way to solve my issue. Since I own an email with my domain provider (OVH) I really want to be able to use it, instead of relying on a local mailer.

  • Have you tried disabling the connection pool? Have you tried different security settings? Are you sure you have the right port and host?

  • @pitaj Thanks for the reply.
    I've tried with every security setting. I've tried with plugins, I've tried with everything almost.
    I checked if the SMTP outgoing server was correct, and it was. I have no idea why this is happening but it's breaking my forum completely.
    I need my users to register.

    I've also had another issue I wasn't able to see in the logs. When I invite them by mail to register (with local mailer), the log in details are not saved correctly. The user exists but the only way to make their account work is to change their password manually from the ACP.

  • @andrewweb has it worked in the past, but doesn't work now? What version did it last work on?

    Report the invite registration bug on GitHub please.

  • @pitaj To be fair, I haven't set up SMTP servers on NodeBB in the past so I can't tell.
    I upgraded from 1.15.2 to 1.15.5 today to see if it would solve the issue, but no luck.
    I've also changed the forum URL a couple of days ago but all I edited was the config.json file and the reverse proxy on apache.

    The problem is, not even my "test mail" button works on my forum. I have to go on the users tab, and from there send a password reset email. It looks like it's trying to make it hard for me to set it up in any way possible.
    I've also had another issue, where when I invite the users on the email, the /register URL doesn't work so they get a page error.
    I'm starting to think my install could be broken..

    I set up the same email service on the default Mail program in Windows 10, and the configuration works perfectly. I just can't tell what could be wrong with the settings I'm using. Maybe something server side that I have to edit?

    Also, I'll open an issue on GitHub for the registration bug.

  • @andrewweb let me try the SMTP emailer in the next day or so and try to reproduce this.

  • @pitaj As un update, I re-installed by board completely, removed mongo, reinstalled it, create a new database. The problem still stands.
    At this point I'm not sure whether it's the OVH email, the configuration, or the board

  • It works OK on NodeBB 1.15.5 by using port 587 (STARTTLS). Check your spam folder.

    {
      "ts": 1607202161268,
      "type": "delivered",
      "direction": "outbound",
      "uuid": "26CEF09E-1658-4E86-BBA9-C00C92540C4E.1.1",
      "mailFrom": "<[email protected]>",
      "rcptTo": [
        "<[email protected]>"
      ],
      "details": {
        "server": {
          "host": "server_domain",
          "ip": "ip_address",
          "port": 25
        },
        "response": "OK id=1klehU-003OtD-MM"
      }
    }
    
  • I was also unable to reproduce a connection failure. Maybe try with a different SMTP service like Outlook-online or Gmail to know whether it's NodeBB causing the issue?

  • Thank you both for the reply.
    @nhl-pl Is your setup for external SMTP servers, or does it use a local mailer? Did you install anything, like a plugin or maybe something on the server, or is it just what you configured just from the NodeBB ACP?

    @PitaJ I'll try to see if a different service works. Thank you.

  • @andrewweb So... I uninstalled sendmail from the server, even though I wasn't using it, and then changed something in UFW and now the board works.

    I'll see if the issue with registration and password persists, and I'll open a issue on GitHub.
    Thank you both for your kind answers.


Suggested Topics


  • 0 Votes
    7 Posts
    430 Views

    Your vm may have suffered an unclean shutdown. Note "may". In absence of more info, a couple things to try.

    If you have nodebb set up to be launched via systemd, disable that. And then stop just for good measure and then disable dependencies:

    systemctl disable nodebb systemctl stop nodebb systemctl disable nginx (sub apache if using apache) systemctl disable mongod (or whatever db backend you're using

    Then reboot the vm. When it comes back up we're going to restart all that in reverse order, verifying each is up and running before proceeding to next:

    systemctl status mongod systemctl status nginx systemctl status nodebb

    Those should now all report "disabled". So let's start them up, verifying each launches w/o error before proceeding to next

    systemctl start mongod

    If the startup messages are greek to you or pass by too quickly:

    systemctl status mongod

    Should report something very close to this:

    [root@forums ~]# systemctl status mongod ● mongod.service - MongoDB Database Server Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2021-03-05 06:57:52 UTC; 1 weeks 6 days ago Docs: https://docs.mongodb.org/manual Process: 457777 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS) Process: 457762 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS) Process: 457739 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS) Process: 457725 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS) Main PID: 457824 (mongod) CGroup: /system.slice/mongod.service └─457824 /usr/bin/mongod -f /etc/mongod.conf ‣ 457824 /usr/bin/mongod -f /etc/mongod.conf

    If that all looks good, try starting nodebb:

    systemctl start nodebb

    A status check should look something like this:

    [root@forums ~]# systemctl status nodebb ● nodebb.service - NodeBB Loaded: loaded (/etc/systemd/system/nodebb.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2021-03-05 06:59:17 UTC; 1 weeks 6 days ago Docs: https://docs.nodebb.org Process: 459055 ExecStart=/usr/bin/env node loader.js (code=exited, status=0/SUCCESS) Main PID: 459071 (node) CGroup: /system.slice/nodebb.service ├─459071 /usr/bin/node /opt/nodebb/loader.js ├─459082 /usr/bin/node /opt/nodebb/app.js

    If you are getting anything other than "SUCCESS" then stop just be sure:

    systemctl stop nodebb

    Then sudo to change to your nodebb user and then go try starting nodebb manually using the "log" flag:

    cd /where/ever/your/nodebb/lives ./nodebb start -l

    Then copy/pasta the ensuing spewage so the other gurus in the lurking can deconstruct. Good luck.

    Once you get this sorted, be sure to re-enable those services else they will not automatically restart after a shutdown/reboot.

    systemctl enable mongod systemctl enable nginx systemctl enable nodebb

    I'd even then reboot after that just to be sure all comes back up as expected.

    Yeah, this is not issue specific but when dealing with unknown glitches it is nice to rule out some low hanging fruit to help isolate.

  • 0 Votes
    2 Posts
    330 Views

    Solved.

    Searched around the forum, found this thread.

    Composer plugin was disabled for some reason.

    Activated & rebuilt NodeBB.

    All working.

    😰 😅

  • 0 Votes
    8 Posts
    539 Views

    Cannot upvote this enough!!

  • Nodebb start not work

    Technical Support
    0 Votes
    18 Posts
    1k Views

    @sanatisharif

    Please try to answer all of the questions I ask, or at least address them Including all of your answers in a single reply improves the flow of the topic Quote the actual question you're replying to, not the whole post Include as many details as possible. For instance, what was the output of the git reset command?
  • 1 Votes
    9 Posts
    2k Views

    Are you saying the search only works in English?