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.

Exim to a different IP

Discussion in 'General Discussion' started by ialex03, Nov 18, 2003.

  1. ialex03

    ialex03 Well-Known Member

    Joined:
    May 15, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Hello.

    Could someone help me to bind Exim to a different IP address?

    Now it sends emails from main server IP but I need it to send from a secondary IP. It is possible?

    Thank you.
     
  2. RaveKnights

    RaveKnights Well-Known Member

    Joined:
    Nov 5, 2003
    Messages:
    81
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Some Where Out There!
    Inside both incoming and outgoing you will need to add an interface like so:

    find
    remote_smtp:
    driver = smtp

    inside:
    /etc/exim_outgoing.conf
    /etc/exim.conf

    and add interface = ip.you.want.to.use

    example as shown below:

    ________________________
    remote_smtp:
    driver = smtp
    interface = 22.22.22.22
    _________________________

    IP needs to be on server in order for this to work

    save and restart exim
     
  3. ialex03

    ialex03 Well-Known Member

    Joined:
    May 15, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Thank you very much, you are rock :)
    You saved my time, I was going to start looking for solution in the Exim docs.
     
  4. RaveKnights

    RaveKnights Well-Known Member

    Joined:
    Nov 5, 2003
    Messages:
    81
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Some Where Out There!
    If there is an exim update when you upgrade your cpanel you will need to re-enter the interface again.

    Just a reminder.
     
  5. mr_hack

    mr_hack Member

    Joined:
    Dec 8, 2001
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1

    If i make it, exim work without SMTP auth. Why?
     
  6. ialex03

    ialex03 Well-Known Member

    Joined:
    May 15, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    You are not quite right.
    The thing is cpanel uses SMTP auth. and POP3 before SMTP.
    If you receieve an email via POP it puts your IP into
    /etc/relayhosts
    and you can send emails without any authentication for 30 minutes.

    To make sure just empty the file /etc/relayhosts and try to send a test email with SMTP auth. turned OFF in your browser. It won't allow you to send.
     
  7. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    This is really great :) - Thanks!!

    I couldn't find the outgoing.conf file so I added all in

    exim.conf
    exim.conf.mailman2.dist
    exim.conf.dist

    Seesm to work just fine but I have only done using SMTP.
    Anyone done this using sendmail - will thsi affect sendmail or
    will it still ahve same IP as before ?
     
  8. grega

    grega Member

    Joined:
    Jan 22, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ljubljana, Slovenia
    You may prevent Cpanel from overwriting your EXIM conf file by chattrib the config itself:
    chattr +e /etc/exim.conf

    To "unprotect" he file use:
    chattr -e /etc/exim.conf

    This way the file is unwritable even with permissions set to 755.
    However this method may be problematic with Cpanel upgrades. If possible use EXIm editor in Service Configuration / Exim Configuration Editor / Switch to advanced mode. But it is true that you can not enter values for remote_smtp.

    Maybe Cpanel team should extend the editor a little bit more to allow more control over Cpanel updating conf file :cool:
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That won't work (using chattr) as the cPanel exim scripts remove the immutable flag from the configuration files before they modify them.
     
  10. grega

    grega Member

    Joined:
    Jan 22, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ljubljana, Slovenia
    Bugger... :mad:
    Ok....
    In that case Cpanel realy needs to make EXIM editor more "edit" friendly...
     
  11. sbd

    sbd Registered

    Joined:
    Oct 5, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Ahmmm. I have a more complecated question in my head.

    First of all let me tell you that I did not find the exim_outgoing file in the system.
    Is this normal ? I saw another guy says he didnt find it.
    I simply create it and add the interface line ???
    Which command inside exim.conf can limit the max send of emails per once ?

    Also exim in its beggining has a command which gives him all local domain names etc.
    But how can you define exims name ? Ex : mail.yourdomain.com
    As I have read and under the rfcs mailservers need even a PTR (reverse) record in order they can function correctly.

    Excuse my lameness in exim. I have never worked with exim before and generally I am a noob in mailservers in general. I ask for your help since I am really tight in time right now and I really need your assistance !

    Thanks you all for your time.

    Regards
    sbd
     
  12. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    exim_outgoing.conf isnt there by default, people running mailscanner will have it though
     
  13. sbd

    sbd Registered

    Joined:
    Oct 5, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Mailscanner is something like spamassasign ?

    If you dont have mailscanner you only need to add the interface line on the exim.conf ?

    On my other queries do you have any solution?

    Thanks for your reply nickp.

    Regards
    sbd
     
  14. grega

    grega Member

    Joined:
    Jan 22, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ljubljana, Slovenia
    What would you like to accomplish ?
    Would you like to enable exim listening or sending on certain IP address ?

    cPanel's exim has all main configuration made in /etc/exim.conf.
    So if you would like to bind listening interface to certain IP address open /etc/exim.conf and add this line at the beginning of conf file:
    local_interfaces = xxx.xxx.xxx.xxx : xxx.xxx.xxx.xxx

    You can add more IP address, delimit them with a ":"

    If you would like to limit from which IP you are sending mail add to conf file, just under:

    begin transports
    remote_smtp:
    driver = smtp
    interface = xxx.xxx.xxx : xxx.xxx.xxx.xxx

    Rule for more IP address apply as mentioned above.

    But be carefull !

    cPanel overwrites custom modiffications so change those custom rules in WHM / Service Configuration / Exim Configuration Editor
    Open "Advanced Editor" and add in first edit field under "#!!# cPanel Exim 4 Config":
    local_interfaces = xxx.xxx.xxx.xxx : xxx.xxx.xxx.xxx

    You cannot add sending smtp interface yo make sure you check conf file after cPanel upgrades.

    Regards,
    Grega
     
  15. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    RE: Mailscanner - http://www.mailscanner.info/
    Chirpy's company do an excellent install service - http://www.configserver.com

    that is correct.

    I am by no means an expert in exim, better off leaving the other queries to somebody more knowledgable
     
  16. sbd

    sbd Registered

    Joined:
    Oct 5, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    First of all many thanks to all of you that have replied !!!
    Yes I wish as well there was no exim and there was a postfix .... But thats cpanel that customers want and customer is always right :)

    Last question. Does anyone know how to setup the mailservers name ?
     
  17. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    I put a wrapper replacement for chattr that seems to work for protecting certain
    items that I don't want updated.

    When the chattr command is called on my servers, it basically checks a list of
    protected files and if the target is on the list then it aborts the real chattr
    command but reports successful completion of the script.

    Pretty basic but works
     
  18. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    576
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Mbelitar
    This is not work anymore on CPanel 11 Stable
     
Loading...

Share This Page