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💗

  • Getting Eror When Started NodeBB

    Solved Configure
    7
    2 Votes
    7 Posts
    251 Views

    @phenomlab yes i did.

    i deleted one of plugin then it started to work normally.

  • Fixed background to nodebb forum

    Solved Configure
    25
    4 Votes
    25 Posts
    1k Views

    @Panda said in Fixed background to nodebb forum:

    Chatgpt told me the ::before method.

    Go figure 😛

  • 4 Votes
    8 Posts
    321 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.

  • NodeBB: Consent page

    Solved Configure
    16
    4 Votes
    16 Posts
    553 Views

    @DownPW I still do not see any issues.

  • 0 Votes
    5 Posts
    191 Views

    @mventures Yes, exactly. The other icon will restart NodeBB whilst the first icon I referenced will rebuild (recompile) it.

    The huge strength of NodeBB over Flarum (for example) is that the code is precompiled, and called once at boot. PHP’s code has to repeatedly reload code from source making it much slower.

  • 5 Votes
    13 Posts
    474 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); } };
  • Podcast Share NodeBB

    Solved Configure
    15
    4 Votes
    15 Posts
    465 Views

    @cagatay You could experiment with nodebb-plugin-ns-embed but I expect the x-origin tag on the remote site to prevent playback.

  • nodebb dropdown menu

    Solved Configure
    5
    0 Votes
    5 Posts
    418 Views

    @phenomlab said in nodebb dropdown menu:

    @kurulumu-net You set it like the below example taken from this site

    aae36790-3257-4bb2-ad5a-0d744309876a-image.png

    Which presents this

    77f47260-2941-4afe-9614-8e17dcfc8c19-image.png

    Very interesting…

    I actually thought this wasn’t possible, as I remember it being asked in the NodeBB forum.

    Is this something new that’s been implemented? I’ll 100% be doing that when I’m on the laptop over the weekend.