Dotlayer
  • News
  • Startups
  • Tutorials
  • SEO
  • Marketing
  • Interviews
No Result
View All Result
Dotlayer
  • News
  • Startups
  • Tutorials
  • SEO
  • Marketing
  • Interviews
No Result
View All Result
Dotlayer
No Result
View All Result

How to Install, Configure and Run a Personal Mail Server using Postal on Ubuntu

September 23, 2017
in Tutorials
0 0
Share on FacebookShare on Twitter

Self-hosting a mail server is often complicated and messy. To begin with, there is an entire elaborate mechanism of sending and receiving emails, securely, that needs to be established. We need some mechanism to accommodate various users. Try and filter out spams. Try and avoid being falsely flagged as spam.

This list goes on and on, and it does require a certain level of manual intervention for smooth functioning. You cannot just install it and forget about it. However, the first installation is what scares most people away. This is where Postal comes into the picture, Postal does depend on quite a few pieces of software. To begin with it has to maintain a MySQL database and a RabbitMQ virtual host.

Fortunately, for us, most of the intricate configuration is automated via a shell script. All we have to do is fetch the shell script and run.

Prerequisites

  1. VPS with at least 4 GB of RAM and at least 20 GB of storage.
  2. Two static public IP address pointing to the server (recommended not necessary).
  3. Newly installed Ubuntu 16.04, on the said VPS.

Shell-Script Installation

Seeing how most of the installation can be automated, Postal’s GitHub repository comes with a quick install script, we can fetch that script by running:

$curl -O https://raw.githubusercontent.com/atech/postal/master/script/install/ubuntu1604.sh

Next, you may want to open up the text file ubuntu1604.sh, created in the directory where you ran the above command. Look for the sections MySQL and RabbitMQ and underneath each of them, there is the default password for MySQL and RabbitMQ which is 'p0stalpassw0rd' replace it with something secure.

Also there’s a mistake in the script, it tries to reload nginx, when it is not running in the first place. To fix that go to the bottom of the screen and look for the line

$service nginx reload

Change this with the following line:

$service nginx start

To make the script an executable, run the following command in the same directory as the installation script.

$chmod +x ubuntu1604.sh
# To run the script give the following command, again in the same directory.
$./ubuntu1604.sh

Once this is done, you are ready to make your initial user account, just run:

$postal make-user

Then enter the email address your name and password. After this you would want to open the files

/etc/nginx/nginx.conf
/etc/nginx/cond.d/default

Here, replace every occurrence of postal.example.com or any other such generic name with your registered domain name by which you want your email server to be known.

Configuring Postal

Open the file /opt/postal/config/postal.yml and change the entries of the DNS section to the domain name of your choice. Feel free to go through other entries of generic domain names and replace them too. In the example below, the domain name used is just ranvirblog.com feel free to use your domain name with any reasonable sub domain like mail.mydomainname.com

dns:
 # Specifies the DNS record that you have configured. Refer to the documentation at
 # https://github.com/atech/postal/wiki/Domains-&-DNS-Configuration for further
 # information about these.
 mx_records:
 - mx.ranvirblog.com
 smtp_server_hostname: ranvirblog.com
 spf_include: spf.ranvirblog.com
 return_path: rp.ranvirblog.com
 dkim_identifier: postal
 domain_verify_prefix: postal-verification
 custom_return_path_prefix: psrp

To access the main interface, add the following DNS records using your DNS provider’s interface.

  • An A record for subdomain.yourdomain.com
  • An A record for track.yourdomain.com

Interface and Getting Started

Now that you are ready to access the interface and start using Postal. Visit, https://yourdomain.com and enter your initial email address and password that you chose after running the postal make-user command. After which the interface asks for Organization Setup. Add in the name of your organization and from there go to the next prompt for Build A New Server.

Enter a reasonable name and let the mode stay on ‘Live’ and click on build server. From here you will be taken to your mail server management interface. Here, click on the top left menu that say “Domains”.

Click on “Add your first domain”. In my case, it is ‘ranvirblog.com’ your case can be very different, like mail.yourdomain.com. In any case, once you have entered your domain name you will be greeted by a screen that will show you step by step how to properly add each record.

Once you are satisfied with your domain name records, you can click on the “Check my records are correct” button on the top of the screen and it will verify whether or not everything is fine. You may want to keep all of the DKIM values private for security reasons. As an example, here is the DNS record list that worked with the server.

The next steps

Now we are ready to send our first email. Click on Messages from the black menu bar on the top of the screen. Then click on Send Message that appears below it.

The message would be queued for a while before being sent. Once you have successfully sent your first email via this server. It is time to set up actual set up the proper encryption key for secure SSL (we were using self-signed certificate all this while!)

$postal register-lets-encrypt [email protected]

Then you can proceed on to adding new users and also explore some of the spam mitigation options. You may also want to look into Click and Open Tracking Installing and running Spam Assassin is highly recommended, as well.

We hope you have enjoyed reading this post and found it useful. Feel free to reach out to our support crew in the case of any issues, we offer 24/7 WordPress support at a ridiculously low price. If you liked this article, then please subscribe to our mailing list for WordPress video tutorials. You can also find us on Twitter and Facebook.

Tags: mail serverpostalsmtpubuntu
ShareTweetPin
Previous Post

How to Install and Configure Jenkins Server on CentOS 7 to Automate Your WordPress Tasks

Next Post

How to Properly Turn Off Google AMP on WordPress Without Losing Traffic and SEO Ranking

Next Post

How to Properly Turn Off Google AMP on WordPress Without Losing Traffic and SEO Ranking

You might also like

Mint Linux vs Ubuntu: Which is Right For You?

Mint Linux vs Ubuntu: Which is Right For You?

March 12, 2022
Net Neutrality: What is it and Why Should You Care?

Net Neutrality: What is it and Why Should You Care?

March 12, 2022
Solid State Drives – Why You Should Buy One Today

Solid State Drives – Why You Should Buy One Today

March 12, 2022

Machine Learning Algorithms Every Beginner Should Know

January 25, 2022
What Is the log4j Vulnerability, log4shell, an Example Step-By-Step Exploit and How to Fixed It

What Is the log4j Vulnerability, log4shell, an Example Step-By-Step Exploit and How to Fixed It

December 11, 2021
Simple Video Call integration into Website with Jitsi

Simple Video Call integration into Website with Jitsi

May 26, 2020
  • Terms of Service
  • Privacy Policy
  • Careers

© 2021 Dotlayer.com

No Result
View All Result
  • About Us
  • Advertise
  • Blog
  • Careers
  • Contact
  • Contact Us
  • Get Featured
  • Home Layout 1
  • Home Layout 2
  • Home Layout 3
  • Privacy Policy
  • Security
  • Services
  • Subscribe To Dotlayer
  • Terms of Service
  • Write For Us

© 2021 Dotlayer.com

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In