How to Setup a Mail Server

How to setup a mail server?

If you've never set up an smtp server, and you're not willing to dig in and learn a lot, you might want to check out some of the services that offer this kind of ability. I have never used any of these, not sure about quality or pricing aspects.

  • cloudmailin
  • mailgun
  • dispatch
  • postmark

How to setup minimal smtp server on localhost to send messages to other smtp servers

So, I actually figured out what was missing here.

I need to run an SMTP server, yes, but I also needed to write code to parse the "to" domain (the recipient domain), perform a DNS request for the MX server(s) of the recipient domain, and then use the smtplib client to then send mail over to the recipient domain. Authentication is not needed to relay that message to the recipient server, authentication is only required for reading from a given inbox or authenticating a sender to send on behalf of a domain (I trust myself and myself only to send mail). I can do all this while also only listening for mail on localhost so that only my local server can use the local SMTP server for relaying messages/emails off to recipient domains.

Additionally, I don't need to have my external IP listed as an MX server since it's not accepting mail for the domain, only sending. I do need an SPF record for it though so that it is an authorized relay/sender for email from my domain.

How to build local node.js mail server

There are many checks an email must pass before it's accepted by most mail providers. These checks attempt to validate the server sending the message is authorized to send on behalf of the sender.

IE: My server can send an email saying it's from "someone-special@somewhere-important.com"... That doesn't mean I'm "anywhere important" by any means.

While you may have had success sending mail from an SMTP server in the past using another technology such as PHP or an Exchange Server, the rules have changed significantly. Gmail has just began full enforcement this year.

I would assume your current issue has nothing to do with node as much as recent changes by the big providers.

Some of the checks that are needed include:

  • DKIM Keys (DNS Record)
  • SPF Record (DNS Record)
  • DMARK has been setup.
  • Dedicated IP Address for the server is required.
  • Your servers IP not being blacklisted.
  • The content of your email passes their filters.
  • Attempt to have an email sent from your server appear to be from a visitor or customer.
  • Among many others.

Any domain you want to "Act as Sender" must have these in place for most of the major providers to accept you message.



Google has a great set of tools and walkthroughs on getting an IP/Domain setup.

Visit the Google MX Record Checker and enter in the domain/subdomain you want to use as sender and it will tell you everything that is failing as well as passing.



Alternative Solutions

  • I use sendgrid.com. They have A node library that makes sending mail very easy. They also provide me the ability to proxy messages via SMTP. This means you can utilize the standard methods to deliver messages. You will just change out "localhost" with an hostname they provide. However, if this is for a new setup, go for the API.
  • Whomever is hosting your email should offer the ability for you send messages via SMTP or an API
  • An endless supply of other providers are out their, most of which allow low volume senders to send for FREE.


Word of warning

I tried for a few years keeping up with all the changes and inevitably, I continued to hit barriers of blocked messages with no ability to know until someone did not get an email. If your sending low volume, you should be able to use third parties without paying paying for it. If you are sending high volume, the cost of their service is cheap compared to the endless issues you will encounter even once you get it initially rolling.

PS. I have no affiliation with any email provider or sender. I pay them too.

In CrafterCMS, how to setup the mail server properly?

To configure Studio Email capabilities use this file
TOMCAT/shared/classes/crafter/cstudio/extension/server-config.properties

outgoing mail server on odoo

Google made updates to the security measures related to app access, so you will not be able to use password. You need to use App Passwords.

In your Google account: Go to Manage your Google Account and select Security:

  1. Turn on 2-Step Verification.
  2. Once the 2-Step Verification turned on, the app passwords option will be enabled and it will be shown under 2-step verification.
  3. Click on App passwords and create an App password and copy the 16 digits password which you got.
  4. Use that 16 digits instead of the password in the Odoo email configuration settings

You can refer to google help for more details about how to create app passwords.



Related Topics



Leave a reply



Submit