First we will configure your /etc/inetd.conf file. If you installed using RPMs, this may already be done for you. The cyrus imap server is called by inetd rather than running as a separate daemon. There should already be two lines that start with pop-3 and imap in your file. Edit the lines to match the following:
Example 4-1. inetd.conf
pop-3 stream tcp nowait cyrus /usr/sbin/tcpd /usr/cyrus/bin/pop3d imap stream tcp nowait cyrus /usr/sbin/tcpd /usr/cyrus/bin/imapd |
The entry /usr/sbin/tcpd tells inetd to use Tcp Wrappers with these servers. You can configure the files /etc/hosts.allow and /etc/hosts.deny to control which ip addresses and host names are allowed. For more information read the man files for hosts.allow and hosts.deny.