In order to enable your website to send e-mails, you will need to install additional components to facilitate this service. On your Linux VPS, many system administrators choose Postfix.
Getting Started with Postfix on your VPS
The first step consists of connecting to your server using SSH. If you’re on Linux or Mac, you’ll do this by typing this at your terminal:
ssh username@X.X.X.X
Where username is the user and X.X.X.X is the IP address of your Ubuntu server. You will then be asked for your password and you’ll notice that the connection is successful.
If you are using a Windows, it’s best to establish a virtual terminal session over SSH using a program called PuTTy.
Once you are logged into the server, it’s best to obtain the root rights using the following command:
sudo bash
Please enter the password in order to enable root mode. We are now ready to install postfix using the following command:
apt-get install postfix
You will need to press “Y” and press Enter in order to start the download and installation of all the necessary dependencies. Once started, the installer script will display some information. Read on and then press “OK”.
Select Configuration Options for Postfix
You will be now asked to choose a configuration for your new Postfix server. In this case we will select “Internet Site“ using the Up and Down arrow to navigate, Tab to move to OK and then press Enter.
In the next step, you will be asked for the Fully Qualified Domain Name (FQDN) of your VPS. It is a best practice to use the correct FQDN since this will be provided by the server when it will connect to other servers in order to send mails.
Advanced Configurations for Postfix
Once each of those steps are complete, all you will need to do is wait for the process to finish up. It should take less than a minute. The mail server should also start automatically, but to be sure, you can run the following command:
netstat –na | grep :25
This should provide one of more lines depending if you have IPv6 enabled on your server. To make sure all configurations have been loaded properly after a change in the configuration file, it will always be necessary restarting Postfix service using the following command:
/etc/init.d/postfix restart
Don’t forget to enable the Postfix servers to start automatically at the startup of the server. Do this using the following command:
update-rc.d postfix enable
Once you have completed these steps your server will be ready and enabled to send emails.
Important: The Postfix Log Files
In case you encounter issues when attempting to send email from the websites hosted on your VPS, you can rapidly check the log file using the following command:
tail -f /var/log/mail.log
(Tutorial written by third party, not by Jarland Donnell)
Related Posts:
- Q3 Top Provider Poll Results - November 13, 2016
- BudgetNode – DDoS Protected OpenVZ VPS Starting @ $12/year – Ashburn, Virginia - June 29, 2016
- BuyVM – $7/m KVM 2GB RAM / 40GB SSD / 2TB BW – in Las Vegas - June 17, 2016
I’m glad I saw this line “(Tutorial written by third party, not by Jarland Donnell)”. Tutorial is horrible.
Suggestion for Jarland, create another user to post 3rd party tutorial. So that your name will not be associated with such posts
It’s not meant to shock anyone with it’s incredible content really, this is merely to build up useful, situational tutorial content. I thought it did a fine job of getting to the point and getting the job done :)
Also, please make sure that you add/update your DNS(spf) TXT record to reflect that your particular VPS ip address is “allowed” to send e-mail for your domain, and also make sure that you have a valid Reverse DNS record for your VPS ip address. These last two steps should allow your mail to avoid the SPAM folder.
ssmtp is a nice lowend solution to get mail from your vps.
Send-only for Debian :)
apt-get install exim4-daemon-light
dpkg-reconfigure exim4-config
DONE!
I will practice this in my server but If I cannot do it I will ask here
Nice Bro
Blogwalking dont forget
also make sure that you have a valid Reverse DNS record for your VPS ip address
for me who does not understand the ubuntu is very useful for me
ssmtp is a nice lowend solution to get mail from your vps.
also make sure that you have a valid Reverse DNS record for your VPS ip address
I’m Not Understand But I’m not understand with this article and very help me.
thanks. very helpful for beginners like me
Saying “thank you” is a great way to make your email more polite. … makes the reader feel appreciated, which is very important if you want them …