The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'E-mail Discussions' started by InstaCarma_Tech, Nov 10, 2009.

  1. InstaCarma_Tech

    InstaCarma_Tech Well-Known Member

    Joined:
    Apr 22, 2009
    Messages:
    228
    Likes Received:
    1
    Trophy Points:
    18
    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. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Bharat
    cPanel Access Level:
    Root Administrator
    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
    And

    Now where exactly are those lines you mentioned should be added, as ALTPORT itself is in a line and has corresponding lines below that.
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    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. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    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
     
Loading...

Share This Page