Script for send-only mail
I am attempting to write a script which will allow for my vps to send mail (receiving mail is not required).
So far I have the following:
# Install postfix
echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections
echo "postfix postfix/mailname string $setting_hostname" | debconf-set-selections
echo "postfix postfix/destinations string localhost.localdomain, localhost" | debconf-set-selections
aptitude -y install postfix
/usr/sbin/postconf -e "inet_interfaces = loopback-only"
/usr/sbin/postconf -e "local_transport = error:local delivery is disabled"
# Ensure postfix will start at boot
/usr/sbin/update-rc.d postfix defaults
# Install mailutils to be able to send using the mail command
aptitude -y install mailutils
# Restart to apply changes
/etc/init.d/postfix start
This works and allows me to send mail using the mail command. However, I wanted to be sure that I hadn't missed anything out.
Any pointers would be appreciated