Because I have a dynamic IP address, what I wanted to do was two things:
- set up Postfix to relay email to recipients via my ISP
- send mail using my ISP domain, instead of localhost.localdomain.
Set Up Postfix For Relaying Emails Through Another Mailserver
But as I'm using Korora 17, the Postfix service is governed by systemd (not init.d).So to restart the Postfix service, I had to do the following:
# systemctl restart postfix.service The second issue is solved by editing the Postfix config file and the Hosts file:
1.Edit the Hosts file:
# vim /etc/hosts
127.0.0.1 exampleisp.com localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
2. Send an email from your mail server and check the log:
# tail -f /var/log/maillog
3.
Edit Postfix config file: # vim /etc/postfix/main.cf
Insert your ISP's domain (in this example, I'm using: exampleisp.com) as follows:
mydomain = exampleisp.com
myhostname = mail.exampleisp.com
myorigin = user@exampleisp.com
relayhost = [mail.exampleisp.com]
inet_interfaces = all
alias_maps = hash:/etc/aliases
Make sure you restart the Postfix service:
# systemctl restart postfix.service Note: the alias_maps entry gets rid of the following warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
4. Test by sending an email to an external email address:
$ mail someone@gmail.com
Subject:
[body text]
.
EOT
For some good background information, see: http://www.postfix.org/BASIC_CONFIGURATION_README.html




