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: how do i open SMTP service to certain IP addresses

Discussion in 'E-mail Discussions' started by typer, Apr 18, 2003.

  1. typer

    typer Active Member

    Joined:
    Mar 24, 2003
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Dear All;

    I would like to know how I can open SMTP service to
    certain hosts or IPs.

    Let say I am using ABC ISP. I want to have the customers from ABC ISP be able to use my SMTP mail.CDF.com to send out email

    How do i do that in exim?



    Janice.
     
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Look at /etc/exim.conf

    Check out this part

    # If you want to permit relaying through your host from certain hosts or IP
    # networks, you need to set the option appropriately, for example
    #
    host_accept_relay = +allow_address : lsearch;/etc/relayhosts : localhost
    #
    host_auth_accept_relay = *
    #
    # If you are an MX backup or gateway of some kind for some domains, you must
    # set relay_domains to match those domains. This will allow any host to
    # relay through your host to those domains.
    #
    # See the section of the manual entitled "Control of relaying" for more
    # information.
    relay_domains = lsearch;/etc/localdomains : lsearch;/etc/secondarymx
     
  3. typer

    typer Active Member

    Joined:
    Mar 24, 2003
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Dear dgbaker;

    I have checked.
    But everytime I add the IP address into relayhosts and restart exim, the added IP in relayhosts disappeared! It seems liked something is overwrittening the file.

    Janice

     
  4. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    You can add the IP directly on that line like so


    host_accept_relay = +allow_address : lsearch;/etc/relayhosts : localhost : 111.222.33.4

    etc...
     
  5. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Incase you have more ips to add to the relayhosts try this one.

    Create a file /etc/allowedrelayhosts (or anything you want this file to be)

    Then open your exim.conf and put this in host_accept_relay

    host_accept_relay = +allow_address : lsearch;/etc/relayhosts : localhost : lsearch;/etc/allowedrelayhosts

    This way your trouble of getting the relayhost file being overwritten is also sorted.

    cheers
     
  6. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    I must have been tired to not think of that myself. Thanks Anand
     
  7. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    anytime dgbaker
     
  8. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    typer do let us know if this works for you. I had tried this on one of my boxes long back and it worked for me.

    cheers
     
  9. typer

    typer Active Member

    Joined:
    Mar 24, 2003
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Well, i am not sure what is the problem.
    i checked against the exim reject log here:

    2003-04-18 15:54:07 refused relay (host) to <rsx@-----.com> from <janice@-----.com> H=(ava) [209.xxx.xxx.xxx] (failed to find host name from IP address)

    is there any way that to avoid exim to find the host name for the IP address so the customer from the ip can use my SMTP service?
     
  10. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Here you go! In /etc/exim.conf

    # The setting below causes Exim to do a reverse DNS lookup on all incoming
    # IP calls, in order to get the true host name. If you feel this is too
    # expensive, you can specify the networks for which a lookup is done, or
    # remove the setting entirely.

    host_lookup = 0.0.0.0/0
     
  11. typer

    typer Active Member

    Joined:
    Mar 24, 2003
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Dear dgbaker;

    I did erase the line out and restart exim.
    but still the exim is trying to do reserve lookup for the IP which doesn't have a hostname.

    Any ideas why?

    Janice

     
  12. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Hmmm... Not sure, that should have done it.
     
  13. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    I did comment this out and restarted exim, but exim still does a lookup, the server has also been rebooted since I made the change but that didn't make any difference as well.

    2003-05-05 19:54:11 refused relay (host) to <*******@hotmail.com> from <info@domainonmyserver.com> H=(Fhxhvwz) [211.xxx.xxx.xxx] (failed to find host name from IP address)
     
  14. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Make sure domainname is in /etc/localdomains

    That's another one to check :)
     
  15. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    It's in there.

    It seems that exim simply ignores that setting in exim.conf, and does lookups regardless.
     
  16. allwin

    allwin Member

    Joined:
    Jul 25, 2002
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    If you have RBL's set on exim, then the lookups will happen irrespective of that setting.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page