Index

Table of contents

Postfix

help

config settings as postfix sees them
postconf -n
higher priority overrides
postconf -P

setup

setup domain name in linux
sudo vi /etc/hostname
example.com
install postfix MTA (Mail Transfer Agent)
sudo apt-get install postfix
sudo dpkg-reconfigure postfix
modify postfix configuration
sudo nano /etc/postfix/main.cf
myhostname = example.com
virtual_alias_maps = hash:/etc/postfix/virtual
unattended install
echo "postfix postfix/mailname string example.com" | debconf-set-selections
echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
apt install -y postfix

configuring

only allow localhost to send emails
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
add email address aliases (tie extra email address to account)
sudo vi /etc/postfix/virtual
root@example.com root
forward an email adress to another email adress
forward@example.com example@gmail.com
load aliases
sudo postmap /etc/postfix/virtual
start mail server
sudo service postfix restart
remove email size restrictions
postconf -e mailbox_size_limit=0
postconf -e message_size_limit=0
/etc/init.d/postfix restart

testing

sending a test mail
/usr/sbin/sendmail [email-address]
Subject: Test Mail
Hello World
<ctrl-d>