• What's the normal or simple way to support mail for NodeBB? Am I supposed to install Postscript?

  • Global Moderator

    NodeBB had several ways to do email.

    1. Emailer plugins

    There are a few plugins like the MailChimp plugin which operate directly with various email providers.

    1. SMTP transport

    NodeBB has built-in support for SMTP, so you can use a Gmail account for instance to email your users.

    1. Sendmail

    NodeBB supports using sendmail on Linux to send emails. To do this you just turn off the SMTP transport and make sure no email plugins are enabled.


  • @PitaJ, thanks for the response. Does NodeBB process incoming mail? If I have 'sendmail', how does each NodeBB instance become aware that there is mail for it?


  • @PitaJ, if I use the SMTP support that is included in NodeBB, can I configure it to send the mail directly to the destination rather than via gmail or another intermediary?

    Is there no manual section about mail? I couldn't find it.

    Why isn't this a frequently posed question? Doesn't everyone who installs NodeBB have to connect it to outgoing and incoming mail?

  • Global Moderator

    Does NodeBB process incoming mail?

    Some emailer plugins do. The built-in transports for sendmail or SMTP do not.

    If I have 'sendmail', how does each NodeBB instance become aware that there is mail for it?

    AFAIK, sendmail is a very simple utility that sends mail directly to the destination. It doesn't have the capability to receive mail like a proper email server such as postfix.

    Note: NodeBB multi-instance setups only send mail from a single instance.

    Is there no manual section about mail? I couldn't find it.

    I'm not sure if there is, but the admin control panel makes it pretty easy to set up SMTP (and sendmail is the default transport when email is enabled). And emailer plugins are pretty much plug and play.

    if I use the SMTP support that is included in NodeBB, can I configure it to send the mail directly to the destination rather than via gmail or another intermediary?

    I don't think SMTP works that way, it requires an intermediary mail server. What you're talking about is exactly what sendmail does my default.

    Why isn't this a frequently posed question? Doesn't everyone who installs NodeBB have to connect it to outgoing and incoming mail?

    Most just do outgoing, I assume through built-in SMTP + a free email service like Gmail, or with sendmail.


  • I have installed and tested Postfix. How do I tell NodeBB to send the mail out via Postfix, the same way the mail command does?

  • Global Moderator

    @waugh by default NodeBB will use the sendmail command to send email when the SMTP transport isn't enabled, no emailer plugin is installed, and emails are enabled generally.

    Have you tried setting up sendmail to use postfix?


  • @pitaj If I have Postfix, why do I need Sendmail?


  • @pitaj said in Hooking Up to Mail:

    ... when the SMTP transport isn't enabled ...

    When I navigate to admin/settings/email, I see this.
    screenshot
    How do I disable SMTP transport?

  • Community Rep

    @waugh Reading thru this thread I suggest not opting for Postfix. Running a fully fledged smtp server on the big bad Internet requires certain expertise, care and feeding. Hence, for most folks, opting for a free relay service is the lowest hanging fruit.

    Mind you, running your own SMTP server does have advantages for some use cases. Postfix sports fairly sane defaults ootb. That does not obviate the need for you to grok just what every line in those config files means. So be ready to do some reading. Good news is that Postfix has good docs and the example config files are well commented.

    Edit: Ah, yeah.... I have a suspicion you will disregard the above so.... What the heck...

    Geronimo! Here ya' go!! Big medicine!!

    Postfix Null Client Example Configuration

    What is a Null Client, ya' says? RTFM:

    A null client is a machine that can only send mail. It receives no mail from the network, and it does not deliver any mail locally.

    Hence, you must have some OTHER, supplementary MX that will receive mail for your domain. Else opt for a slightly more complex config. I'll leave the reading to you.

    Enjoy! πŸ˜€

  • GNU/Linux Admin

    @waugh if that toggle is off, then it should automatically fall back to postfix automatically. Is postfix not receiving messages for outgoing mail?

    I will admit that our domain knowledge for these sorts of providers like sendmail or postfix are limited.

    We usually recommend using a third party emailer like sendgrid because they have better deliverability.

  • Community Rep

    @waugh The sendmail executable may well actually be Postfix, depending on distribution, as, unlike Qmail and others, Postfix's design criteria included being a drop in replacement for Sendmail, the ancient MTA/MX app.

    Falling back to Postfix may or may not work, depending on config. For e.g., user may need to tell the "Custom" pull down to listen on localhost, a.k.a. 127.0.0.1 loopback address. Likely port 25. Depending... 😜

    Postfix has a bazillion knobs. And I am glad for them but the moment you break away from the default configs you better make sure you know what you are doing. Managing a fleshed out mail server is not everybody's cup of tea and should not be undertaken lightly. If you do not already possess foundational subject domain knowledge and/or not ready to do quite a bit of background reading about stuff like MX records, DKIM, open relays, header/content inspection for filtering out the cruft, etc. then I suggest configuring a null client and relaying thru a third party service. The local "mail spool" will still provide some buffering for slow, bogged down, or offline upstream relays.

    If one is targeting running NodeBB on a minimally provisioned VM and concerned about the overhead of running even a null client daemon, then consider opting for the builtin or plugin-in stuff. Not as efficient at delivery though so a larger site sending lots of mail may struggle with delays, unnecessary load on NodeBB, DOS, etc.? I don't know because I never tested that option.

    Does this add any clarity?


  • It seems broken to me that when I turn off the switch for "Use an external email server to send emails", the rest of the form is still prompting for the identity of the external email server via which to send emails.

  • Community Rep

    @julian said in Hooking Up to Mail:

    @waugh if that toggle is off, then it should automatically fall back to postfix automatically. Is postfix not receiving messages for outgoing mail?

    Do not have a test box handy at moment. When it falls back, does NodeBB submit mail via a pipe or tcp/ip? Pipes can be more efficient if everything is local, but for whatever reason I set mine up to use tcp/ip.

    @waugh

    I run a Postfix null client on my forums. Incoming mail is routed via my main MX's. Here's a screenshot of my config NodeBB side. I am not updated to current stable release but the knobs should be similar.

    Screenshot_2020-10-18 Settings Email NodeBB Admin Control Panel.png

    The above presumes a local mail server listening on port 25. Might want to confirm that on your set up.


  • @gotwf said in Hooking Up to Mail:

    @julian said in Hooking Up to Mail:

    @waugh if that toggle is off, then it should automatically fall back to postfix automatically. Is postfix not receiving messages for outgoing mail?

    .... When it falls back, does NodeBB submit mail via a pipe or tcp/ip?

    It tries to open a TCP port. The port number it tries by default is generally associated with talking to an MSA.


  • @julian said in Hooking Up to Mail:

    @waugh if that toggle is off, then it should ... fall back to postfix automatically. Is postfix not receiving messages for outgoing mail?

    When I first installed NodeBB and had not even become aware of the settings, and so obviously had not changed them, and I posted a reply that should have generated e-mail, NodeBB complained that it couldn't open a certain port. I have learned that the port number in question is generally used for SMTP to an MSA, message submission agent.

    After I installed Postfix, the same thing happened. But I believe I understand why. Postfix out of the box accepts mail from "mail" via a "sendmail" program that Postfix includes for backward compatibility with Sendmail. I believe that "mail" invokes this "sendmail" and pipes the message to it. This succeeds on my system -- I can send and receive e-mail across the Internet, including to gmail and including to the (paid) disposable-email-address provider that I use. But Postfix out of the box does not have its MSA turned on. This is called "submission" in the "master.cf" configuration file. I have since tried turning that on. I think I need to study and change some of the arguments I am not passing to it, but that I see mentioned in an example someone posted. So what is currently happening, with my MSA turned on but not properly configured, is that NodeBB is showing an error message evidently returned by Postfix, to the effect that "localhost." (note the period at the end) is not one of the domains mentioned in my TLS cert (which it isn't, shouldn't be, and can't be). Since NodeBB knows nothing about TLS (does not prompt for any configuration for it), I take this error message as evidence that NodeBB is now talking to Postfix and Postfix is taking the basic syntax but reporting back on a problem that is happening internally to Postfix between its modules on account of my not having configured them correctly yet.

  • Community Rep

    @waugh Your atypical config may be confusing the issue. Mail submission port is 587. Hence why you get "depending" in some of my replies. Or maybe you are doing wrong NodeBB config side. Hard saying since we're not psychic.

    Try this NodeBB side:

    Replicate the config parameters in my screenshot above excepting changing the port to 587 and see if it works. Note that Connection security should be None. Else if you invoke STARTTLS NodeBB side then of course Postfix will endeavor to oblige (depending on config). Username and Password should not be necessary for local submission. Note that Submission ports typically are configured to require authentication and authorization. But maybe not from locally submitted mail. Depending.... 😜

    Be the above as it may. Presuming you do get things "working", I suggest you implement a Null Client configuration Postfix side. I've linked the docs for you somewhere up thread. Arrange to receive incoming mail for your nodebb domain elsewhere.

    If you must receive email for that domain on boxes managed by you then I suggest spinning up some additional VM's dedicated to that task:

    1. Primary MX
    2. Secondary MX

    Which you can config to handle initial filtering, blacklist handling and such before forwarding to:

    1. Local spool for local delivery - Bit of a pain MUA side unless you're accustomed to kickin' it old skool.
    2. Yet another VM hosting an IMAP Server such as Dovecot.
      a. And maybe yet another VM, or two dedicated to SPAM and Antivirus duties.
    3. Forward to third party mailbox such as GMail

    There is some configuration DNS side required for the various options mentioned above. I shall not delve into those at this time, but please do be aware that there are additional moving pieces involved. πŸ˜‰

    Have fun!

Suggested Topics

| |