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.

How to *enable* mail relaying for a specific IP?

Discussion in 'E-mail Discussions' started by isnoop, Aug 6, 2003.

Thread Status:
Not open for further replies.
  1. isnoop

    isnoop Active Member

    Joined:
    Jun 13, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    I've modified my exim.conf:
    Code:
                         
    domainlist local_domains = lsearch;/etc/localdomains
                         
    domainlist relay_domains = lsearch;/etc/localdomains : \
        lsearch;/etc/secondarymx
    
    hostlist relay_hosts = lsearch;/etc/relayhosts : \
        localhost  : \
        [COLOR=red]lsearch;/etc/relayhosts.custom[/color]
    
    hostlist auth_relay_hosts = *
    The IP of the server originating the emails is stored in the file /etc/relayhosts.custom

    And I've restarted exim, but whenever I try to send email from that remote server, I get the following error:

    550-[xx.xx.xx.xx] is currently not permitted to relay through this server.
    550-Perhaps you have not logged into the pop/imap server in the last 30 minutes
    550 or do not have SMTP Authentication turned on in your email client.

    Anyone have any idea how to fix this?
     
  2. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    You could put it in /etc/alwaysrelay


    (you may need to create the file)

    cPanel.net Support Ticket Number:
     
  3. isnoop

    isnoop Active Member

    Joined:
    Jun 13, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Works like a charm.

    cPanel.net Support Ticket Number:
     
  4. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    That's a great tip. But ....

    How do you DISABLE mail relay for a certain domain or IP?

    Would another custom file such as /etc/neverrelay do it? ;)
     
  5. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    Not if you want to disable mail relay entirely for a certain domain... ;)

    Assume you want to allow a domain POP3 retrieval but not SMTP relay. How do you disable SMTP just for that domain?
     
  6. niyogi

    niyogi Member

    Joined:
    Aug 13, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    How does /etc/alwaysrelay get pointed to by exim so that it directs a particular IP to be relayed from?

    -niyogi

    cPanel.net Support Ticket Number:
     
  7. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    antirelayd will copy it into /etc/relayhosts

    cPanel.net Support Ticket Number:
     
  8. niyogi

    niyogi Member

    Joined:
    Aug 13, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    excellent - that worked. :)

    -niyogi

    cPanel.net Support Ticket Number:
     
  9. ehsan

    ehsan Well-Known Member

    Joined:
    Dec 11, 2001
    Messages:
    185
    Likes Received:
    0
    Trophy Points:
    16
    Nick,

    That's a cool tip,
    How ever
    When ever I run antirelayd it works great, (adds the ip from /etc/alwaysrelay to /etc/relayhosts.)
    but few seconds after /etc/relayhosts gets over written by some other service, probably cpanel for that 30 minute relay time on recenet smtp requests.
    and IP is not getting copy from /etc/alwaysrelay to /etc/relayhosts.

    Any Idea why? maybe thats only me...


    Thanks
    ~ Ehsan

    cPanel.net Support Ticket Number:
     
  10. comforthost

    comforthost Member

    Joined:
    May 24, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    online
    Tip: if you add the ip to relayhosts and to /etc/alwaysrelay there is no need to restart exim
     
  11. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This thread is over seven (7) years old, so it is unlikely that the original poster is still experiencing the same problem. I am closing this thread.
     
Loading...
Thread Status:
Not open for further replies.

Share This Page