How to configure an email server for a VPS Hosting package
Email is and will continue to remain one of the most widely used social interaction platforms. This probably explains why Facebook, Twitter and other popular social media platforms still send emails on latest trends, friend requests or other important notifications – it is that most internet users treat emails with more importance than a notification on a website.
In this tutorial, I will show you how you can quickly configure an email server for your VPS package to send out emails.
Step1: Log into your VPS server and Install postfix
Postfix is an opensource email server which is freely available and easy to install.
sudo yum install postfix
Step2: Configure your postfix email server
sudo vim /etc/postfix/main.cf
#Uncomment the following lines
myhostname = yourhostname.com
myorigin = $myhostname
inet_interfaces = localhost
inet_protocols = ipv4
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks_style = host
Step3: Start your server
service postfix start
Test email sending from your server
echo “test” | mail -s “Test mail “ email@example.com
You can also have your server connect to your email service to send emails.
Step1 Open postfix configuration files.
#uncomment/add the following lines with your details
relayhost = [smtp.youremailserver.com]
smtp_sasl_auth_enable = yes
Install the “SASL” Authentication plugin
sudo yum install cyrus-sasl-plain
Step2 Restart your server
service postfix restart
And you are done! Isn’t it really simple? If this article helped you, or if you’d like us to cover other how-to’s in the coming weeks, feel free to share your thoughts in the comments below.