Linux How to bind Qmail to specific IP address

qmail is a mail transfer agent that runs on Linux and Unixish oses. It is more secure replacement for the popular Sendmail program. Yes, it is possible to bind Qmail to specific IP. Here is what I did. Please note that I am running light weight QMAIL server from xinetd service.

1) Open your /etc/xinetd.d/smtp file and add bind=IP line:

# vi /etc/xinetd.d/smtp
Append/add following line to it:
bind =


  • bind = Qmail IP address to bind.

2) Save file

3) Reload xinetd with any one of the following command:
# /etc/init.d/xinetd reload
/etc/init.d/xinetd restart

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 6 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
6 comments… add one
  • Anonymous Oct 18, 2006 @ 0:45

    Well this was pretty useless. How many people use qmail with inetd?

  • Ajack Feb 10, 2007 @ 20:29

    Hey that did not work for me. When I insert the bind line, no email goes out after that.

    I am on FC2 using Plesk 7.5, so I am using the xinetd service, but not a lightweight version of Qmail, I guess a regular one.

    My quetion is: is this supposed to work with a specific patch on Qmail?

    Googling the topic showed that plain vanilla qmail only sends to the server’s default IP and most people recommend a patch to change the outgoing IP…


  • huschi Apr 30, 2007 @ 20:07

    Absolute useless. Not because of the fact, that Plesk and Visas (both famous ISP-Software) use Qmail with inetd. 🙂
    No, it useless because (x)inetd is for getting Mails, not for sending. For this you don’t need inetd to bind on a specific IP, because the MX-Record do this for you.
    If you want to bind Qmail for outgoing Mails on an IP, i must tell you: this will not work because Qmail have no possibles to do so.


  • Rick Yang Oct 9, 2007 @ 6:16

    It seems that you can do this, see this link:

  • Arun Oct 31, 2009 @ 5:35

    I am using qmialServer. I do not know how enable SELinux. Pls tell me is there an possible ways to enable SELinux in qmailserver and pls tell me what is the procedure to use IPTables to block unauthorised users from outside

  • Mehmet Korkmaz Apr 6, 2010 @ 7:41

    I use plesk, i had the same problem and i applied the instructions here and than qmail uses the IP address that i want now:

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum