Script for send-only mail

Hi,

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

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct