The following procedure will install and set up postfix and use another mail server to relay emails. Tested on Ubuntu 10.04 (Lucid Lynx).
sudo su
apt-get install postfix
Choose “satellite/smarthost” type, all emails will be relayed to another mail server
cd /etc/postfix
vim main.cf
Add:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
vim sasl_passwd
Add:
relay.server.com user@name:password
chmod 600 sasl_passwd
postmap /etc/postfix/sasl_passwd
service postfix restart
sendmail email@domain.com
Type:
Hello!
.
Read postfix documentation in order to make your installation more secure.