Hey guys, In this blog post, we are going to discuss a beginner guide for understanding SMTP and mail servers. So keep reading.
Have you ever wondered where all the emails in your inbox come from? Or what happens when you send an email? Today’s post is about diving into all the nooks and crannies of SMTP and mail servers.
If you are thinking about starting your business, you might need to set up a mail server; we’ll cover that too. Plus, we will introduce you to a powerful security tool that can protect your mail server against cyber intruders.
So let’s start our topic: understanding SMTP and mail servers:
What Is a Simple Mail Transfer Protocol?
SMTP is short for Simple Mail Transfer Protocol, the technical data exchange protocol between two email accounts.
All the emails in your inbox have passed through two SMTP servers; one receives your email from the client’s server, and the other relays that email to your mailbox.
When an SMTP server receives an email, the email is in raw code, which is not understandable by the recipient. An SMTP server’s job is to put the codes of the emails in the right order before sending them to the recipient. So, in addition to being an email connecting bridge, SMTP servers are code deciphers as well.
Gmail, Yahoo, iCloud, Outlook, and AT&T are examples of SMTP providers.
What Is a Mail Server?
A mail server is basically like a mailman, only faster and more efficient. When you send an email, say from your Gmail account, the recipient receives it in seconds, but there is so much more going on in the process.
Mail servers are in charge of these complex processes, ensuring each email reaches its destination on time. The most important thing a mail server does is the layers of security it puts on each email.
Oracle Beehive, Amazon SES, and Microsoft Exchange Server are examples of mail servers.
Each of your email accounts is linked to several mail servers. Each email you send is first sent to a mail server, which forwards your email to another mail server to send to the recipient. All this happens in a blink of an eye.
I always wondered how a Gmail account holder could send an email to a Yahoo account; mail servers make this possible. If there weren’t several mail servers in play, you could only send emails to accounts that matched your email address domains.
Technology saves the day again!
Can I Set Up a Mail Server on Ubuntu?
You can install many mail servers on Ubuntu, including Postfix, Dovecot, and MySQL. Let’s cover the installation process of the most popular one, Postfix.
Follow the below commands to install Postfix on Ubuntu 20.04. Once the installation is complete, you need to implement a powerful yet budget-friendly security tool on your mail server; a cheap Linux VPS server will do.
sudo apt update
sudo DEBIAN_PRIORITY=low apt install postfix
Postfix configuration (General type of configuration):
Select Internet Site
The system mail name
Use FDQN (Fully Qualified Domain Name) or the primary domain.
Root and postmaster mail recipient:
Use your primary account name (Example: Jane)
Mailbox size limit:
Set it to 0 to disable any size restriction.
Internet protocols to use:
The next command:
sudo dpkg-reconfigure postfix
Set the “home_mailbox” variable to Maildir/
Type: sudo postconf -e ‘home_mailbox= Maildir/’
sudo postconf -e ‘virtual_alias_maps= hash:/etc/postfix/virtual’
Create the virtual maps file in your main.cf (Preferred text editor: nano):
sudo nano /etc/postfix/virtual
List email addresses you will be using to receive emails, for example:
Save and close the virtual maps file:
CTRL + X, Y, then ENTER.
Apply the Mapping & Restart
sudo postmap /etc/postfix/virtual
sudo systemctl restart postfix
Enable external connections:
sudo ufw allow Postfix
Install the Mail Client
echo ‘export MAIL=~/Maildir’ | sudo tee -a /etc/bash.bashrc | sudo tee -a /etc/profile.d/mail.sh
sudo apt install s-nail
sudo nano /etc/s-nail.rc
Postfix installation and configuration are complete.
Is It Possible to Set Up a Mail Server on Windows 10?
hMailServer is the most popular mail server you can install on Windows 10. But we don’t want to limit you, so here is a great reference to find the best free mail server for windows.
Run the hMailServer.
Check both boxes (Server/ Administrative tools)
Select database type:
Check the built-in database.
Select destination location:
Browse through your computer and choose a folder for the program’s shortcuts.
Launch hMailServer and click on Connect.
Put in the password you used during the installation.
hMailServer installation is complete.
Configure Your SMTP Server
Open hMailServer administrator
Click Add domain.
General tab> type in your domain name> Save.
Select Domains> Accounts> Add >fill in the address field and password> Save.
Settings>Protocols> SMTP (uncheck the POP and IMAP boxes).
Advanced> type “localhost” under Default domain> Save.
Open Advanced> Auto ban> Uncheck the Enabled box> Save.
IP ranges >click TCP/IP ports
You can enable forwarding, auto-reply, and DNS blacklists in hMailServer.
Open Utilities> Diagnostics> Select the domain you entered earlier> Start.
hMailServer configuration is complete.
Who Uses an SMTP Server?
Every major business that wants to reach its target audience through email marketing needs an SMTP server. Having an SMTP server enables you to send unlimited emails to your customers or clients without landing in their SPAM folders.
Also, almost all SMTP servers block IP addresses that are not associated with a known domain. So an SMTP server doesn’t just send or receive emails; it enacts anti-spam measures crucial to your business’s safety.
How Does SMTP Server Work?
After you set up an SMTP server, you need to link it to email clients like Gmail or Outlook. Imagine that your email client is Gmail. Once you send an email, Gmail creates an SMTP connection with your server.
DNS (Domain Name Server) and SMTP collect the sender’s and recipient’s email addresses and the email’s content. DNS steps in when the sender’s and recipient’s email addresses are from different domains, like Gmail and Yahoo. Once DNS authenticates the recipient’s domain, the email will be on its way.
Do I Need a Mail Server for My Business?
Honestly, it depends. Investing in a mail server might not be a good idea if you own a small business with limited funds and staff. But, big corporations absolutely need mail servers, not only to communicate with their clients but also with their internal staff.
The biggest pain point for business owners is security issues. Having a mail server that’s hosted by an outside organization exposes every email you, your organization, and your employees send or receive. This means intruders can hijack your critical data or implement your brilliant business strategies before you, which turns them into your most dangerous competitors.
Security issues aside, owning an on-site mail server guarantees reliability and fast access.
If you don’t handle sensitive data, have less than 15 employees, and are in your business’s first/second year, you don’t need to buy a mail server.
SMTP and mail servers are the glue that keeps your emails from floating into space. Both enable users to send and receive emails without them being scrambled, hijacked, spammed, or lost. I hope you like this guide for understanding SMTP and mail servers.