Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default Allowing exim to run automatically on ports other than 25 and 26

    Thought of sharing this with you all

    Allowing exim to run automatically on ports other than 25 and 26

    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.

  2. #2
    Member
    Join Date
    Jun 2003
    Location
    Bharat
    Posts
    230

    Default

    Can that method be used to run exim on 25, 26 and 588.

    I mean on all the three ports simultaneously.

    BTW in my /etc/init.d/exim

    These lines already exists
    [ -f /usr/sbin/exim ] || exit 0

    if [ -e "/etc/chkserv.d" ]; then
    for file in `ls /etc/chkserv.d`
    do
    if [ "`echo $file | awk -F- '{ print $1 }'`" = "exim" ]; then
    ALTPORT="`echo $file | awk -F- '{ print $2 }'`"
    fi
    done
    fi
    And

    # See how we were called.
    case "$1" in
    start)
    # Start daemons.

    # EXIM
    if [ ! -e "/etc/eximdisable" ]; then
    if [ -x "/usr/sbin/clamd" ]; then
    echo -n "Starting clamd: "
    rm -f /var/clamd
    $DAEMONIZE /usr/sbin/clamd
    echo
    fi
    if [ "$ALTPORT" != "" -a "`grep \"daemon_smtp_port.* $ALTPORT\" /etc/exim.conf`" = "" ]; then
    echo -n "Starting exim-$ALTPORT: "
    TMPDIR=/tmp $DAEMONIZE /usr/sbin/exim -bd -oX $ALTPORT
    echo $RESULT
    fi
    Now where exactly are those lines you mentioned should be added, as ALTPORT itself is in a line and has corresponding lines below that.
    Vinayak Sharma
    Vinsar.Net - Quality WebHosting Services at Economical Price USA & UK Servers
    Book Your Domain with Confidence Reliable Domain Reseller Account

  3. #3
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,165
    cPanel/Enkompass Access Level

    Root Administrator

    Question

    Quote Originally Posted by InstaCarma_Tech View Post
    Thought of sharing this with you all

    Allowing exim to run automatically on ports other than 25 and 26

    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.
    What's different in doing it this way instead of adding port 588 (per your example) to the Service Manager > Exim on another port, option?

  4. #4
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb

    As Infopro suggested, without manual modification the Service Manager in WHM can handle adding a custom port for Exim to listen on.

    For the addition of multiple non-default ports it is also possible to accomplish simply by using the Advanced Exim Configuration Editor to customize two Exim configuration directives.

    Here is an example entry that includes ports 26 and 587 to an existing set of ports 25 and 465:
    Code:
    daemon_smtp_ports = 25 : 26 : 465 : 587
    tls_on_connect_ports = 465
    As a precaution, before attempting to use the above please ensure no other customization exists that may modify Exim ports.

    Here is the menu path used when entering customized Exim configuration directives:
    WHM: Main >> Service Configuration >> Exim Configuration Editor >> Advanced Editor
    Documentation: The Advanced Exim Editor

    For reference, here is a related configuration file path where entries are stored from the Advanced Exim Configuration Editor; this is also used when WHM builds your updated Exim configuration file ("/etc/exim.conf").
    Code:
    /etc/exim.conf.local
    Exim documentation resource:
    Exim Specification: Chapter 13. Starting the daemon and the use of network interfaces

Similar Threads & Tags
Similar threads

  1. Run vhosts on two ports?
    By jnetsurfer in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-18-2007, 01:13 PM
  2. automatically run server script
    By classywear in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 07-10-2007, 10:25 AM
  3. help allowing specific domain to bypass reverse dns lookup in exim
    By sivadc in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 04-05-2005, 12:17 PM
  4. Exim not allowing processes past 3.0%
    By earthquakie in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-10-2003, 02:15 AM
  5. exim - allowing block
    By AlaskanWolf in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 12-28-2002, 12:24 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube