Skip to content

Configure SMTP for Nodebb

Solved Configure
  • Hello guys,

    What’s the best way to configure smtp for nodebb, I used all sorts of methods, SSL/TLS, Encrypted, etc… but none of them seems to work. All I am doing, is enabling SMTP transport and pooled connection, I already tried it with only smtp transport but it still does not work. What can I do? By the way, I use port 587

  • @marusaky based on the work completed thus far (in relation to PM exchanges), I’m going to mark this completed. Sending email from the server itself works fine without issue, and DNS appears to be clean (valid SPF, DMARC, and DKIM records).

    It appears that only Gmail marks incoming messages from your domain as spam - perhaps because of the domain age, which there is nothing we can do to prevent this. Mail delivery to all other domains appears to work fine in al of my tests.

  • @marusaky Are you using your own SMTP server, or an external one ?

  • @phenomlab said in Configure SMTP for Nodebb:

    @marusaky Are you using your own SMTP server, or an external one ?

    my own, from the hestia cp

  • @marusaky see this example

    Screenshot_2022-04-14-22-35-27-64_3aea4af51f236e4932235fdada7d1643.jpg

    Screenshot_2022-04-14-22-36-06-61_3aea4af51f236e4932235fdada7d1643.jpg

    Obviously, you’ll be using your own credentials and mail host, but ensure you have the same selections as I do.

  • still doesn’t work… I have tried to put even mail. at smtp host, but still the same, I also tried with all the connection security, nothing… and I don’t think it’s a problem from my e mail, I set it up with SSL encryption, DNS is also set… tried with port 465 also… any ideas? thank you!

  • @marusaky is your server permitted to send outbound email directly? Several hosting companies disable this by default so you might need to contact them and ask them to release or permit.

    Another test would be to see if the server is in fact listening. You can do this with a simple telnet command, for example

    telnet server.com 587 where you obviously replace server.com with the actual mail host name. If you get a response, then it’s working. If nothing, then you’ll need to call the hosting company as I suggested.

  • @phenomlab said in Configure SMTP for Nodebb:

    @marusaky is your server permitted to send outbound email directly? Several hosting companies disable this by default so you might need to contact them and ask them to release or permit.

    Another test would be to see if the server is in fact listening. You can do this with a simple telnet command, for example

    telnet server.com 587 where you obviously replace server.com with the actual mail host name. If you get a response, then it’s working. If nothing, then you’ll need to call the hosting company as I suggested.

    yep, the e mail is working as it should, I even contacted the support, they helped me set up the e mail again and entering it in the nodebb settings fields, but it still doesn’t work, I am going crazy lol

  • @marusaky Happy to take a look if you want to provide me with temporary admin.

  • @phenomlab said in Configure SMTP for Nodebb:

    @marusaky Happy to take a look if you want to provide me with temporary admin.

    of course, I will send you the details

  • @marusaky After checking:

    1. Email appears to work without issues. I am able to send new user registration emails with no issues
    2. Test template email also works fine without issues
    3. Emails sent to GMAIL accounts are sent to Spam. This is due to no DMARC DNS record being configured. You should also check that the A and AAA records (for Ipv6) are present in DNS
    4. Your server IP address appears on one blacklist. You should contact the owner of this list to have the block removed
  • @marusaky it looks like your SMTP connector in NodeBB is set to use StartTLS (which makes sense on port 587), although the message seems to be discarded. I changed this so it looks like the below

    2339b77c-a6f9-437f-b2c9-6068dfcfd791-image.png

    This seems to work in my testing. Let me know. Essentially, we change StartTLS to None

  • @marusaky seems there are some DNS records missing or are there but not configured correctly. I’ve corrected this so hopefully (in the next 48 hours) the spf, dmarc, and dkim should function as required and mail won’t be classed as spam.

    As discussed in PM though, some mail servers will still send messages to spam from new domains less than x days old. This is standard security practice and not much you can do to avoid unfortunately, but what we have is best practice.

  • @marusaky I checked again this morning and it seems that messages are still going to spam when using Gmail, so a little more investigation and configuration is needed. However, it seems to work fine with other domains I tested.

    Will look into this further.

  • @marusaky based on the work completed thus far (in relation to PM exchanges), I’m going to mark this completed. Sending email from the server itself works fine without issue, and DNS appears to be clean (valid SPF, DMARC, and DKIM records).

    It appears that only Gmail marks incoming messages from your domain as spam - perhaps because of the domain age, which there is nothing we can do to prevent this. Mail delivery to all other domains appears to work fine in al of my tests.

  • phenomlabundefined phenomlab has marked this topic as solved on

Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation💗

  • 4 Votes
    8 Posts
    319 Views

    @Panda said in Upgrade to NodeBB v3? 2BB or not 2BB, that is the question!:

    So although thats a plugin it has Widget like element and stopped working on the Theme change

    Which is normal based on the widgets being reset when you change themes.

  • 3 Votes
    17 Posts
    445 Views

    @mventures Ok. No issues

  • 0 Votes
    6 Posts
    213 Views

    @mventures You’d need to connect to the server and execute it directly - not on your local terminal. Review the guide below, which will show you how to gain access via SSH to your server

    https://docs.ovh.com/gb/en/dedicated/ssh-introduction/

    Once you have access, you’ll need to navigate to the actual folder where NodeBB is installed

    You’ll then need to change to the directory as shown below

    /home/unbuntu/nodebb

    fdffe673-bf63-4b6d-a728-5506fddc1aff-image.png

    In most cases, initial access takes you to the root of the file system. You can always issue pwd in a Linux terminal which will show you the Present Working Directory. From there, you can issue the command

    cd /home/ubuntu/nodebb

    Once in the NodeBB directory, you’d use the below commands

    ./nodebb stop git fetch && git checkout develop && git reset --hard origin/develop ./nodebb upgrade ./nodebb start

    Line 1 stops the NodeBB instance
    Line 2 gets the latest files from GIT (repository) and then checks out the development branch. It then resets the version you are using to the development branch ready for v3
    Line 3 Runs the upgrade once the new branch is set, and code pulled
    Line 4 Restarts the NodeBB instance after the upgrade has completed

    Note that when you restart NodeBB and log back in, things will look very different to what you had in v2.

  • 0 Votes
    2 Posts
    126 Views

    @mventures the swatch feature you refer to isn’t a NodeBB plugin, but a utility that I wrote that handles this. It is available for v2 (as you can see here) but I’ve stopped developing and releasing the code because it has been entirely rewritten to work for v3.

    If you’d like the code, this is possible, but you’ll need to upgrade to v3 first.

  • 1 Votes
    2 Posts
    153 Views

    @phenomlab

    In fact I specified the sub rep and not the rep

    DON’T DO THIS:

    nodebb@nodebbpwclonedb:~/nodebb$ sudo mongorestore --username admin --password XXXXXXXXXXXXXX --nsInclude nodebb.objects --drop /home/nodebb/nodebb_DB_20230107/nodebb/

    BUT THIS :

    nodebb@nodebbpwclonedb:~/nodebb$ sudo mongorestore --username admin --password XXXXXXXXXXXXXX --nsInclude nodebb.objects --drop /home/nodebb/nodebb_DB_20230107/

    🙂

  • 5 Votes
    13 Posts
    472 Views
    'use strict'; const winston = require('winston'); const user = require('../user'); const notifications = require('../notifications'); const sockets = require('../socket.io'); const plugins = require('../plugins'); const meta = require('../meta'); module.exports = function (Messaging) { Messaging.notifyQueue = {}; // Only used to notify a user of a new chat message, see Messaging.notifyUser Messaging.notifyUsersInRoom = async (fromUid, roomId, messageObj) => { let uids = await Messaging.getUidsInRoom(roomId, 0, -1); uids = await user.blocks.filterUids(fromUid, uids); let data = { roomId: roomId, fromUid: fromUid, message: messageObj, uids: uids, }; data = await plugins.hooks.fire('filter:messaging.notify', data); if (!data || !data.uids || !data.uids.length) { return; } uids = data.uids; uids.forEach((uid) => { data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0; Messaging.pushUnreadCount(uid); sockets.in(`uid_${uid}`).emit('event:chats.receive', data); }); if (messageObj.system) { return; } // Delayed notifications let queueObj = Messaging.notifyQueue[`${fromUid}:${roomId}`]; if (queueObj) { queueObj.message.content += `\n${messageObj.content}`; clearTimeout(queueObj.timeout); } else { queueObj = { message: messageObj, }; Messaging.notifyQueue[`${fromUid}:${roomId}`] = queueObj; } queueObj.timeout = setTimeout(async () => { try { await sendNotifications(fromUid, uids, roomId, queueObj.message); } catch (err) { winston.error(`[messaging/notifications] Unabled to send notification\n${err.stack}`); } }, meta.config.notificationSendDelay * 1000); }; async function sendNotifications(fromuid, uids, roomId, messageObj) { const isOnline = await user.isOnline(uids); uids = uids.filter((uid, index) => !isOnline[index] && parseInt(fromuid, 10) !== parseInt(uid, 10)); if (!uids.length) { return; } if (roomId != 11) { // 5 Is the ID of the ID of the global chat room. Messaging.getUidsInRoom(roomId, 0, -1); // Proceed as normal. } else { user.getUidsFromSet('users:online', 0, -1); // Only notify online users. } const { displayname } = messageObj.fromUser; const isGroupChat = await Messaging.isGroupChat(roomId); const notification = await notifications.create({ type: isGroupChat ? 'new-group-chat' : 'new-chat', subject: `[[email:notif.chat.subject, ${displayname}]]`, bodyShort: `[[notifications:new_message_from, ${displayname}]]`, bodyLong: messageObj.content, nid: `chat_${fromuid}_${roomId}`, from: fromuid, path: `/chats/${messageObj.roomId}`, }); delete Messaging.notifyQueue[`${fromuid}:${roomId}`]; notifications.push(notification, uids); } };
  • Gettin Erors NodeBB

    Solved Configure
    7
    0 Votes
    7 Posts
    318 Views

    @phenomlab no forum is working goods.
    there is no eror message since yestarday.

  • 6 Votes
    36 Posts
    2k Views

    @justoverclock said in Digitalocean step by step guide to nginx configuration:

    i’m learning

    And that’s the whole point of this site 🙂 If you don’t learn anything, you gain nothing.