This is the start of a small series of mail related posts. I will start with nullmailer which is the perfect fit for a small vps that just has to send some emails from time to time. No need for a whole mail server but the need for a sendmail like mail service.
apt-get install nullmailer
Sender email address used by nullmailer
Default domain for email service
Login information for sending emails
The login information is requested during installation. If you want to change it afterwards you can edit the remotes config file.
The configuration itself does have following parameters:
[domain name of your smtp server] smtp --auth-login --user=[USER] --pass=[PASSWORD]
As you can see this is a local service. It is not listeing to any ports. It just catches local calls of sendmail.
To test the whole setup install the mailtutils:
apt-get install mailutils
And run following command:
echo "This is a text." | mail -s "Testing nullmailerl" [mail address for test]
This is a basic tutorial. Nothing worth but save you some time. For me it is just a “hey look at that” post.
Message of this tutorial: If you do have a mail account and you just need to send a few email with your vps - you should use nullmailer for that.