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.

/etc/relayhosts is vanishing

Discussion in 'E-mail Discussions' started by borki, Jun 26, 2007.

  1. borki

    borki Member

    Joined:
    Jan 9, 2006
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    We use WHM 10.8.0 cPanel 10.9.0-R10737 on FreeBSD on several machines. One of them is losing its /etc/relayhosts file regularly. So the users have problems relaying mail. The logfile means:

    tail -f /var/log/exim/paniclog
    2007-06-23 10:52:02 failed to open /etc/relayhosts for linear search: No such file or directory

    When I "touch" the file regulary, exim will use it, but there are still erros and users can not send mail.

    This behaviour is relatively new (4 weeks)..

    Any hints?
     
  2. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    yup, same here. It happens occasionally, but i haven't found out why or what causes the problem.


    2007-06-26 22:17:04 failed to open /etc/relayhosts for linear search: No such file or directory
    2007-06-26 23:12:39 failed to open /etc/relayhosts for linear search: No such file or directory
     
  3. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    i may be wrong but isn't that the file that pop-before-smtp daemon keeps poped IPs in for 15 minutes? on my servers that is a rotating file when you have the pop before smtp daemon running. your users should have smtp auth turned on anyway ..but poping mail first should put their IP in that file. Mine constantly rotates IPs ..unless I am reading your question wrong it should do that.


    EDIT:: you mean the file gets lost completely??
     
  4. borki

    borki Member

    Joined:
    Jan 9, 2006
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    yes that's possibly true. but the file should not disappear, because that makes exim go mad :-(

    i have a lot of users complaining about this since they always got a "relaying denied" the first time. the problem is, that if the file is disappeared, it will not automatically created by this pop-before-smtp daemon..

    where is the problem? hello cpanel support?
     
  5. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    Is antirelayd running ?
     
  6. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    starting to wonder if this had something to do with the chkservd issue where it was trying to start antirelayed while already running?
     
  7. borki

    borki Member

    Joined:
    Jan 9, 2006
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    The problem was, that antirelayd was running twice - don't know why.. just killed both of them and restarted via script. Anything fine now :)

    Regards
     
  8. keywaystab

    keywaystab Registered

    Joined:
    May 26, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Same issue, our solution.

    We recently had a rash of clients with Microsoft Outlook reporting the below error on a seemingly random basis.

    "421 Unexpected failure, please try later"

    Since there were seemingly no corresponding entries in /var/log/exim/mainlog or /var/log/exim/rejectlog, it took some time to pinpoint. We noticed that we were getting 1-3 "failed to open /etc/relayhosts for linear search: No such file or directory" errors per minute. I checked, and saw that the file existed. After reviewing this thread, I noticed that /etc/relayhosts was in fact vanishing. We "fixed" the problem by turning off antirelayd, and doing a "touch /etc/relayhosts". Customers stopped complaining (so far). This of course caused any customer who was set up for POP before SMTP to call in, but switching them to SMTP Authentication was simple enough in the few cases.

    This problem is caused by antirelayd unlinking the file before rebuilding it. It is only prominent in Microsoft Outlook because of the way that Microsoft Outlook handles SMTP error codes (it generates a new email to put in the clients email box, rather then putting the message in the Outbox and retrying).

    The file does in fact disappear. This became apparent when doing an "ls /etc/relayhosts*", and sh matched /etc/relayhosts with the *, however ls was unable to find the file (not every time) because it disappeared before ls was called. Here is an example:

    Code:
    # ls -alg /etc/relayhosts*
    ls: /etc/relayhosts: No such file or directory
    -rw-r--r--  1 root  wheel  13830 Aug  8 12:27 /etc/relayhostsusers
    
    Below is a quick code snippet of where I believe the problem lies (in /usr/sbin/antirelayd).

    Code:
       unlink($relayhosts);
       link($relayhoststmp,$relayhosts);
            unlink($relayhoststmp);
    
       unlink($relayhostsusers);
       link($relayhostsuserstmp,$relayhostsusers);
       unlink($relayhostsuserstmp);
    
    I am a novice with Perl, however it seems that instead of deleted and recreating the file (especially given the fact that Exim gives a 421 when it is missing a file), it would be best to overwrite (not append) the file with the new data.
     
  9. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    wow, great investigative work!
     
  10. nyjimbo

    nyjimbo Well-Known Member

    Joined:
    Jan 25, 2003
    Messages:
    1,125
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New York
    We just started getting these complaints too. Seems that TWO copies of antirelayd were running and I just killed one and restarted exim and ran the "service manager" in WHM to be sure its ok. Now there is only one copy.

    I also TWO entropyd programs running, not sure what would cause this but I think they keep happening after we do reboots.

    :confused:
     
Loading...

Share This Page