Bind Postfix Mail Server To Localhost or Specific IP Address Only
Q. How do I bind Postfix MTA to specific IP address such as 127.0.0.1 or 202.5.1.2?
A. Postfix allows you to listen on a particular IP address. By default MTA will list on all network interfaces and loopback. You need to setup inet_interfaces parameter. You need Postfix version 2.2 and later to use this feature. The parameter also controls delivery of mail to user@[ip.address].
Postfix IP address bind configuration
Open /etc/postfix/main.cf file:
# vi /etc/postfix/main.cf
Append / modify line as follows to bind to localhost (127.0.0.1) only:
inet_interfaces = 127.0.0.1
If you need to bind to 127.0.0.1 and 202.5.1.2, enter:
inet_interfaces = 202.5.1.2,127.0.0.1
Save and close the file. You need to stop and start Postfix when this parameter changes. So type the following to restart Postfix:
# /etc/init.d/postfix restart
Verify that everything is working fine:
# netstat -tulpn | grep 25
# tail -f /var/log/maillog
E-mail this to a friend
Printable version
Related Other Helpful FAQs:
- Postfix setup catch-all email accounts using /etc/postfix/virtual
- Linux: Find out which network card or NIC server is bind or running on
- Postfix block PDF or ZIP files attachments
- Linux Mail Delivery Failed With DNS Service Unavailable Error and Solution
- Postfix blacklist or reject an email address
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: /etc/postfix/main.cf, /var/log/maillog, bind configuration, inet_interfaces, mail server, netstat command, network interfaces, parameter changes, tail command




Recent Comments
Yesterday ~ 7 Comments
Yesterday ~ 2 Comments
Yesterday ~ 3 Comments
Yesterday ~ 3 Comments
09/05/2008 12:28 pm (2 days ago) ~ 70 Comments