Scope: Set up a general-purpose internetwork routing facility that supports Simple Mail Transfer Protocol (SMTP).
Install these packages first, per your operating system (OS):
CentOS, Fedora | Debian, Ubuntu |
---|---|
dnf install |
apt-get install |
sendmail-cf | sendmail-cf |
mailutils | mailutils |
sendmail | sendmail |
Improve Sendmail security by turning it off.
systemctl stop sendmail
systemctl disable sendmail
You'll need these.
- Check for required files:
ls /etc/mail/submit.*
should yield:
/etc/mail/submit.cf
/etc/mail/submit.mc
- Check for
m4
processor:
which m4
should yield:
/usr/bin/m4
The secret sauce.
- Backup
submit.cf
:
cp -pv /etc/mail/submit.cf /etc/mail/submit.cf.bak
- Create
mysubmit.mc
macro configuration file by copying default macro configuration file:
cp -pv /etc/mail/submit.mc /etc/mail/mysubmit.mc
- Modify
mysubmit.mc
,
replacing:
[127.0.0.1]
with:
mailhost
on the msp
line so that is looks like this:
FEATURE(`msp', `mailhost')dnl
- Commit your change (from
/etc/mail
):
m4 mysubmit.mc > submit.cf
More goodness.
- List the host's IP & hostname (IPaddress hostname alias), e.g.:
127.0.1.1 foobar.psych.nyu.edu foobar foo
- List an SMTP client (choose 1):
128.122.112.26 calaf.cns.nyu.edu calaf mailhost
128.122.108.240 smtp.nyu.edu mailhost
216.165.47.33 smtp.nyu.edu nyu mailhost
216.165.85.201 smtp.nyu.edu mailhost
❤️