We can achieve this by starting exim on the particular port (say 588) using the following command:

/usr/sbin/exim -oX 588 -bd

But to get this done automatically whenever exim starts, do the following:

1) In /etc/chkserv.d, add a file called exim_588 (to run it on port 588).

Note the underscore there. Do not replace it with hyphen as there is another file exim-26 that uses that. The content of the file would be:

service[exim-588]=588,QUIT,220,/etc/rc.d/init.d/exim stop;/etc/rc.d/init.d/exim stop;/etc/rc.d/init.d/exim stop;/etc/rc.d/init.d/exim start;/usr/sbin/exim -oX 588 -bd

2) Enable it in /etc/chkserv.d/chkservd.conf

exim_588:1

3) Now make the following changes in /etc/init.d/exim. Search for ALTPORT and add the following lines below that:

if [ “`echo $file | awk -F_ ‘{ print $1 }’`” = “exim” ]; then
ALTPORT2=”`echo $file | awk -F_ ‘{ print $2 }’`”
fi

Again search for it and add these lines:

if [ “$ALTPORT2” != “” -a “`grep “daemon_smtp_port.* $ALTPORT2″ /etc/exim.conf`” = “” ]; then
echo -n “Starting exim-$ALTPORT2: ”
TMPDIR=/tmp $DAEMONIZE /usr/sbin/exim -bd -oX $ALTPORT2
echo $RESULT
fi

This will ensure that exim runs on port 588 on start. You can also see it enabled in Whm >> Service Manager.


Shares
Contact Us On WhatsApp