To make it clear, there are two methods. Either you setup a DNS server, as vodoo described above, or you get postfix to use your provider's smtp.
I'll try to expose the other method :
1) create the file /etc/postfix/transport with a content similar to the following:
Code:
samplehost.sampledom.com local:
localhost.sampledom.com local:
sampledom.com :
.sampledom.com :
* smtp[yourprovidersmtp.com]
2) run the following command:
Code:
/usr/sbin/postmap /etc/postfix/transport
3) make a copy a the file /etc/postfix/main.cf
Code:
cp /etc/postfix/main.cf{,.org}
4) apply the following changes to /etc/postfix/main.cf, replacing
192.168.xxx.0 to match your local network.
Code:
--- main.cf.orig 2010-08-20 10:43:38.000000000 -0700
+++ main.cf 2010-08-20 10:43:38.000000000 -0700
@@ -699,11 +699,12 @@
program_directory = /usr/lib/postfix
inet_interfaces = localhost
masquerade_domains =
-mydestination = $myhostname, localhost.$mydomain
+mydestination = $myhostname, localhost.$mydomain, localhost
defer_transports =
-mynetworks_style = subnet
+mynetworks = 192.168.xxx.0/24, 127.0.0.0/8
disable_dns_lookups = no
relayhost =
+transport_maps = hash:/etc/postfix/transport
content_filter =
mailbox_command =
mailbox_transport =
5) start/restart postfix
Code:
/etc/rc.d/postfix restart || /etc/rc.d/postfix reload
6) you should also set SMTPD_LISTEN_REMOTE="yes" in /etc/sysconfig/mail, whether you use this method or the other one.
----------------------------
This method allows you to send mails directly without having to set up a DNS server.
However if you want to receive emails from the outside world, you have to apply the other method (which is more elegant).
Bookmarks