How to install Postfix as the SMTP server for applications in Raspbian Stretch Lite to send email
Email is a good medium for the applications that we deploy on our Raspbian Stretch Lite to send us notifications.
By default, a fresh installation of Raspbian Stretch Lite does not include a SMTP server for programs to send email. Thankfully, we can install Postfix as the SMTP server for the applications that we deployed on Raspbian Stretch Lite to send out email when necessary.
This post documents how you can install Postfix as the SMTP server for applications in Raspbian Stretch Lite to send email.
Making sure that your Raspbian Stretch Lite is up to date
We first run the following command for Raspbian Stretch Lite to get the latest updates from the Internet:
sudo apt-get update
Installing Postfix on Raspbian Stretch Lite
Once we are sure that our Raspbian Stretch Lite had gotten the latest updates from the Internet, we can proceed to installing Postfix by running the following command:
sudo apt-get install -y postfix
When the command start, you will need to pass through configuration screens to:
- Select the mail server configuration type that best meets your need
- Indicate a Fully Qualified Domain Name as the "mail" name
Once you had indicated your input to those configuration screens, the applications that you deploy on your Raspbian Stretch Lite will be able to send out email.