Problem with mail delivery on ISPConfig CentOS

The standard config of the mail components of ISPConfig seems to have some problems to get mail delivered to the configured mailboxes (at least on the CentOS system I tested).

First of all you need to allow sendmail to accept remote connections. Do this by uncommenting a line (add dnl in front) in /etc/mail/
dnl DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl

Then recompile the sendmail config;
yum install sendmail-cf
make -C /etc/mail

In the ISPConfig web interface (ISPConfig > Management > Settings > Email), change the following;
Virtuser File: /etc/mail/virtusertable
Sendmail CW: /etc/mail/local-host-names

Restart sendmail;
service sendmail restart

You will probably encounter problems when sending mail to email accounts that forward to an external mailbox;

smrsh: “procmail” not available for sendmail programs (stat failed)
554 5.0.0 Service unavailable

Fix this like this;
cd /etc/smrsh
ln -s /usr/bin/procmail procmail