How to disable relay – postfix

  linux
# view all queued up mail
sudo postqueue -p


# delete all queued up mail
sudo postsuper -d ALL


# add this to /etc/postfix/main.cf
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_helo_restrictions = reject_unknown_helo_hostname


# optionally, run this so that it doesn't complain about old files
sudo postmap /etc/postfix/virtual


# restart mail
sudo /etc/init.d/postfix restart


# watch log
sudo tail -f /var/log/mail.log