How To Setup A Free SMTP Server Using Postal

Pinterest LinkedIn Tumblr
6.9k
views

In this article, we’ll discuss the methods to build a free SMTP server using postal. We’ll list some of the free, open-source software or email marketing tools. You’ll also find out how to set up a free SMTP server using postal and fully-featured open-source mail.

Fully featured open-source software 

In this process, we will use postal, a free delivery platform, because it has many outcomes providing all the tools and features to set up a free SMTP server to send unlimited emails

You should use the postal because of the following consequences:

  • Easy to use 
  • Postal is fully featured & 100% free software
  • Just install the source code & then add features as per your requirement 
  • Scale it as you like 
  • You can download it on Ubuntu due to the simple installation process

The SMTP server and its relation with email marketing

SMTP stands for “Simple Mail Transfer Protocol,” is the medium, which specifically triggers the process of email deliverability with full care.

Actually, this article is not about what an SMTP server is but if you really want to know about an SMTP server then go to the link below.

What is SMTP server? complete detail 2021

The SMTP server is a delivery agent responsible for delivering each email through the medium (internet) with full care. But in contrast, it has the authority to pass or deny the delivery of emails over the internet; therefore, first of all, you have to configure the right SMTP setting and addresses. Besides, every marketing email system works with agents:

The sender: which allows you to send an email over the internet.

The management application: its function is to arrange, monitor, and analyze the consequences and manage your mail server later. 

To run the marketing system, we need both to work simultaneously and properly. Meanwhile, for email marketing, you need to send unlimited emails without any restrictions by companies or monthly plans, or others. 

Email marketing system

Setup a free server to boost your marketing campaign

Let’s start the real work

Now, get ready to build a free SMTP server. I’ll show you how to how to set up the server step by step.

Requirements to Setup SMTP Server

To build the Server, you need two things:

1. Domain name

If you are ambitious to send an email then first you have to select an email domain like this one:

mail@servicesground.com

In the above email, you can see the “servicesground.com” is the domain. The same kind of domain you are required to send an email from your SMTP server.

Usually, the website domain name should be used but in case of a cold email campaign, you should avoid using a business domain to keep it safe from the blacklist. If you don’t have any domain then you have to get it first to continue the setup.

How to get a domain? 

There are a lot of DOMAIN REGISTRATION PROVIDERS to get a domain and it cost just 10$ per year. 

You can get a domain from:

  • Godaddy,
  • Name cheap
  • Free nom
  • E nom
  • Google Domain

2. VPS Server with open Port 25.

The second thing you require to setup SMTP is a VPS server.

VPS server

If you don’t have a VPS server then first, you’ve to buy it from the Web hosting or Cloud Services Company, available for public with a public IP. The function of the VPS server is to drive the website efficiently and then run the machine in the cloud to do the desired tasks. After getting the server make sure that its port 25 must be opened because through this port server can communicate over the internet. 

Examples

  • For RPD software port 3389 must be opened to connect with another window machine 
  • MYSQL works over 3306 port for SQL database system  
  • SSH uses port 22 to connect with Linux machine 
  • When you open websites port 80 is used

Firewall

In computing, all servers have a firewall running which then blocks all the ports except the one you need. To use a certain port you need to open that port in the firewall. Basically, a firewall is the network security system that controls the traffic moving over the internet by creating a barrier between the trusted and untrusted network. How the firewall works the following diagram will clear your all doubts.

firewall

After getting the server make sure that port 25 is allowed by the company because some companies block this to protect from spammers used to send emails.

free SMTP server

Here is a list of some companies that allows port 25.

  • Host wind.
  • Contabo.
  • Interserver.
  • OVH.
  • Digital Ocean  (Digital ocean sometimes restrict some accounts & port 25 but mostly they allow all ports)
  • AWS (some accounts are blocked)

Choose the VPS Company You Want

You can also start with (Contabo) which is the cheapest VPS service or sign up on the (DigitalOcean) which offers 100$ in order to test everything.

After selecting the VPS Company, create a VPS server according to the following specification:

  • Ubuntu 18 x64 as your operating system
  • You can start with 1 CPU/2 GB RAM (And resize later).

VPS Server basic configuration

Now get ready to prepare the VPS server step by step. Using an SSH client like putty or bitwise make a connection with your server. 

  • First, check your hostname:
hostname –f
  • If you don’t get a form like Anything.Domain.com then change your hostname by using the following command:
 sudo hostname host.domain.tld
  • Where host can be anything you want so let’s say the domain name for this tutorial is example.com
sudo hostname postal.example.com

Map Your Domain Name

As you set your VPS server & its domain name, subsequently go to the domain provider and map it to the VPS server. Then open the DNS management zone and add a new record to it like this:

how to map your domain

In this article I’ll use server and you can choose whatever you want

Setup Free SMTP Server

If the VPS is ready then you can start the installation process so, for this, you have to install SMTP software. 

Install Postal Free SMTP Software

You can have several SMTP software like PowerMTA, Postal, Exim, Postfix, or other suitable for you. But we’ll use Postal as our SMTP software in this tutorial. As you know, we have selected Contabo so, we’ll need to run the following command before initiating the process:

sudo apt-get install apt-transport-https

To Install Postal, simply run this command on your server:

curl https://raw.githubusercontent.com/atech/postal/master/script/install/ubuntu1604.sh | sh

Note (this is one command line, so copy all and paste in putty and press enter)

Install Postal Free SMTP Software

Postal SMTP install command

In the installation process, you don’t need to do anything because the setup is fully automated. Just wait a couple of minutes for the process to complete. 

Once it is done, you’ll receive the notification “installation complete”.

Now create a user to login and manage your postal server through the web interface. Simply run the following command

postal make-user

After this, you’re required to enter your name, email, and password. Then press enter after putting the required data in the input.

Now you’ve installed the postal.

Configure Postal SMTP

Configure Postal SMTP

After the installation, open the internet browser and navigate to your server IP URL or Subdomain like this:

https://Sg-educate.com

After this, you will get an SSL warning. It’s ok! Just click on “proceed” as you can see in the image given below:

 configure smtp

Welcome to Postal

And then you’ll see the postal login screen where you’ve to enter your email & password that you created during the setup.

free smtp server using postal

Postal Login

After getting inside the postal click “Add Organization” to add one. Then you will see the “Build Server” on the lower-left corner click on it and set it to live mode.

free smtp server using postal

Postal Domain Configuration

Now you will see the “Add your first domain” so click on it and add your domain name into postal.

postal domain configuration

Add Domain in Postal

Simply, enter your domain name to send emails and click “Create Domain”. Then you’ll see the Domain page with the records that you need to fill.

add domain in postal

Postal DNS Records

Simply, copy these records from SPF & DKIM and then paste them in the DNS Zone. Now your server is ready to send emails! 

But what are SPF and DKIM? 

DKIM (Domain Keys Identified Mail):

As you can see in the above image there is a DKIM record mentioned so whatm. is this? This a text record in your DNS and its function is to hold a public authentication key. Later it will protect your email originality and this is very important for your server. 

Setup DKIM For Postal

The good thing about Postal is that DKIM is already configured and its keys are also generated. You just have to copy the DKIM record in your DNS Zone. 

Setup DKIM For Postal

SPF (Sender Policy Framework):

An SPF is also a text record added to the DNS zone, and it specifies the mail servers authorized to send an email for your domain. The message or email will be marked as spam if the server isn’t authorized or allowed by the SPF record.

For example: if you try to send an email from a Google domain like mail@google.com then your email will be marked as spam because you can’t use the google domain. 

You can also configure SPF and prevent from others try to send an email from your domain. So, SPF configuring is very important to make your domain trustable for other mailing service providers.

Set up SPF

  • Open your DNS zone and add the following record:
v=spf1 a mx ip4:XXX.XXX.XXX.XXX -all
  • Replace the given IP with your VPS server IP.

Now, only your server is allowed to send an emails from your domain.

If you noticed, there is an SPF example given by the postal and that looks like:

v=spf1 a mx include:spf.postal.example.com ~all

You have to change the example domain and configure file in the postal to match your domain.

How to Edit Postal Configuration File

First, you’ve to connect the server to edit the postal configuration file, use a file manager to connect with your server. There is a WinSCP a free remote file manager used to connect or edit configuration files. 

It is simple and easy to use:

  • Just go to WinSCP, and use the root credentials to connect with your server.
  • Then open the /opt/postal/config Directory
Edit Postal configuration file
  • Postal.yml configuration
  • Then, right-click and edit the file.
free smtp server using postal

Postal Domain Change

After replacing the example domain with your domain name you need to restart postal so that the configuration comes in action.

So run this command on your server:      

Postal restart

So, when you refresh your web page the example.com will change into your domain name.

free smtp server

Now You Can Send A Test Email

Now postal is ready to send testing emails so, click on the messages and then click on the send messages to test the free SMTP server.

free smtp server

Send a test message

If you’ve worries regarding the use of SMTP to send emails then don’t be panic, all you just have to create credentials inside the postal to connect with the free SMTP server. 

Create Postal Credentials to Relay Emails

Simply, click on Credentials, then Add your first Credentials

Add your first Credentials

In type (input): select SMTP. But if you don’t want to connect postal through SMTP then you can select API to develop your own application.

  • Enter a User name
  • In key (input): you can keep it as “automatically generated
smtp credentials

And the process is done here, now you can use these credentials in any email marketing.

Relay a Test Email

Simply, Go to SMTPER.NET and enter your server details as follows:

relay a test email

Test your SMTP here:

  • SMTP Host: Your Server IP or Domain
  • Port: 25 or 2525
  • Login: The User You entered in credentials.
  • Password: The User Password.

You can use these credentials in Email Sender application. 

Before Sending An Email

Before sending an email, you’ve to keep some crucial concepts in your mind. So, follow these guidelines to get the best delivery rates. 

Warming Up your SMTP server

Before starting your email marketing campaign, warm-up your IP Address. Because it’ll build your reputation on the internet and increase your volume of mail sent according to schedule. 

Why it is so important

It is important because when your IP Address is brand new in the competitive environment, it has no reputation on the internet and no one knows about this IP Address. So, the IP warmup is basically the practice to build a reputation on the internet. 

Example of warming up your server shown in the table below:

Warmup DayEmails To Send
120
250
3100
4300
5500
6700
7900
81000

This Table shows a scenario, if your target is 1K emails per day with the good reputation.

RDNS (Reverse DNS):

The reverse DNS is also known as a pointer record. It is used to point your IP to your Domain and it works contrary to regular DNS. 

RDNS is the essential element in your mail server and increasing your sending score. It will also improve your reputation on the internet. So, when you’ll search the IP you will get the name.

DMARC (Domain-based Message Authentication, Reporting & Conformance):

It is basically the protocol used to monitor the authenticity of email messages using SPF & DKIM. DMARC has made it easier for ISPs (internet service providers) to prevent malicious emails. It allows the email senders to handle unauthenticated emails by using SPF or DKIM records. The sender can whether move the unauthenticated emails to the junk folder or can block them all.

MX Record

MX (Mail Exchange) records are DNS records responsible for delivering email to your address. In simple words, Max record tells the world about the mail servers which allows incoming traffic to your domain and the route of the sent email. 

Avoid Spam Factors

Four factors can determine the spam scores, given below:

  • IP Reputation
  • SPF, DKIM, rDNS, and DMARC.
  • Message Body
  • Email List health.

We have already discussed the first two factors above but there is still Message Body and Email List Health. 

Message body

In this factor, the health of the email matter the most. The subject line and the content of the email should be attractive and professional. If the email looks spammy, then the recipient will not get your email and your email will directly move to the spam folder. So, avoid using spammy words & triggers.

Email List Health

The health of the email list is determined by the following two things:

  • Bounce Rate: The number of valid emails in your list
  • Spam Traps: Are there any spam traps on your list?

Secure with a Free SSL.

SSL certificates encrypt the traffic between the server and client to provide extra security for users to access your application. It provides an easy way to install trusted certificates for free. Connect it to your server using putty SSH client. Get ready to install!

Step 1 — Install Encrypt Client

Let’s Encrypt client certificate are installed through client software running on your server. 

The official client is called Cerbot which is installed by running this command:

apt -y install certbot

Step 2 — Get the SSL Certificate

The second step is you need to stop Nginx service because it is using port 80 which will be used by Cerbot. So, stop this service temporarily by running the following command:

sudo systemctl stop nginx

Now install the certificate by running the following command:

certbot certonly --standalone -d postal.example.com

Replace the following domain with your domain. And then follow the Wizard. The Cerbot will issue you the certificate for your domain.

Step 3 — Configure the SSL Certificate

Now you’ve got a free SMTP server but you need to configure it in your server. So, start the Nginx service again by running the following command:

sudo systemctl start nginx
  • Open the WinSCP again and edit some files on your server.
  • Connect to your server and go to /etc/Nginx/conf.d directory.
  • Create a new file and name in it: “postal.example.com.conf
  • Then replace “postal.example.com.conf“ with your domain
  • And copy the code and paste it inside the file given below:
server {
    listen [::]:80;
    listen 0.0.0.0:80;
    server_name postal.example.com;
    return 301 https://$host$request_uri;
}

server {
    listen [::]:443 ssl;
    listen 0.0.0.0:443 ssl;
    root /opt/postal/public;
    server_name postal.example.com;
    ssl_certificate      /etc/letsencrypt/live/postal.example.com/fullchain.pem;
    ssl_certificate_key  /etc/letsencrypt/live/postal.example.com/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
    ssl_prefer_server_ciphers on;
    ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA512:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:ECDH+AESGCM:ECDH+AES256:DH+AESGCM:DH+AES256:RSA+AESGCM:!aNULL:!eNULL:!LOW:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;

    location / {
       client_max_body_size 50M;
       try_files $uri $uri/index.html $uri.html @puma;
    }

    location /app/assets {
       add_header Cache-Control max-age=3600;
    }

    location @puma {
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_pass http://127.0.0.1:5000;
    }
}
  • After pasting the code simply, save the file.
  • The last step is to restart and enable nginx service again by running the following command:
systemctl restart nginx
  • Then this command:
systemctl enable nginx
  • Now you can test your secure Postal website! Best of luck!

Thanks for reading

Got a question? Comment here or open a thread. We will help!

Subscribe to SG-Educate

Subscribe to our daily newsletter to get the latest industry news.

newsletter
author-image

John is a senior web developer and instructor for SG-educate. He also writes and edits a variety of web-related articles. He has unique specialities in Search Engine Optimization (SEO), Off-Page SEO, Keyword Research, HTML, CSS, JavaScript, Php, Digital Marketing, and Search Engine Marketing (SEM).

Write A Comment

Logo-ebooks

An Essential Guide for
Higher Ranking.

seo-book
logo-ebooks

FREE AMAZON MILLIONAIRE GUIDE.

amazon-book
popup-image

Subscribe To SG-Educate

Subscribe to our daily newsletter to get the latest industry news.