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.

Anybody know why /etc/relayhosts is not being written to?

Discussion in 'General Discussion' started by Jeff75, Nov 29, 2004.

  1. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    Nobody on my server is able to send email to non-local domains. For some reason /etc/relayhosts is empty which I believe is why emails cannot be sent out. Here's the error that is coming up in Outlook:

    Code:
    Task 'mail.domain.com - Sending' reported error (0x800CCC65) : 'Your outgoing (SMTP) e-mail server has reported an internal error. If you continue to receive this message, contact your server administrator or Internet service provider (ISP).  The server responded: 503 valid RCPT command must precede DATA'
    Does anybody know how to fix this so the IP addresses will be logged in /etc/relayhosts?

    EDIT: I just manually entered my IP address in this file and the mail was sent out, so the problem is definately because the IPs of mail senders are not being recorded in this file.
     
    #1 Jeff75, Nov 29, 2004
    Last edited: Nov 29, 2004
  2. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    16
    is antirelayd running?

    Might want to just restart cpanel... or exim at least.
     
  3. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    I am having this problem again and am not sure how I fixed it last time. I'm pretty sure it was resolved by restarting the server which I just did and it's still not working. Can someone please help?

    Code:
    # ps -aux | grep antirelayd
    root        2100  0.0  0.1  2072 1708  ??  S     1:08PM   0:00.04 antirelayd (perl)
    root        6554  0.0  0.0   304  156  p0  R+    1:16PM   0:00.00 grep antirelayd
     
  4. cPanelBilly

    cPanelBilly Guest

    /scripts/restartsrv_exim
    will restart antirelayd... I would have to see an strace to see why it isnt working right now though
     
  5. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for your response. Can you tell me what you mean by strace?

    I've been searching the forums the past hour and this issue appears to mainly affect FreeBSD users. I tried upgrading to the latest CURRENT release and also tried /scripts/exim4 and restarting exim but it didn't help. I really need to get this fixed ASAP!

    Here is what bounces back when trying to send emails:

    Code:
    Your message did not reach some or all of the intended recipients.
    
          Subject:	abcdef
          Sent:	4/22/2005 1:50 PM
    
    The following recipient(s) could not be reached:
    
          'email@domain.net' on 4/22/2005 1:50 PM
                503 valid RCPT command must precede DATA
    I just tried running /scripts/restartsrv_exim but the /etc/relayhosts file is still empty.
     
    #5 Jeff75, Apr 22, 2005
    Last edited: Apr 22, 2005
  6. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Make sure /etc/syslog.conf has a line like:

    # Log all the mail messages in one place.
    local0.notice;local0.debug;mail.*;mail.none;mail.info;local0.info /var/log/maillog


    Then restart syslogd and antirelayd

    /scripts/restartsrv_syslogd
    /scripts/restartsrv_exim


    and see if that fixes the problem.
     
  7. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    Unfortunately, that didn't fix the problem. I did however notice there are many instances of the line you mentioned. Should I delete all the additional lines?

    Code:
    # $FreeBSD: src/etc/syslog.conf,v 1.13.2.3 2002/04/15 00:44:13 dougb Exp $
    # 
    #       Spaces ARE valid field separators in this file. However,
    #       other *nix-like systems still insist on using tabs as field 
    #       separators. If you are sharing this file between systems, you
    #       may want to use only tabs as field separators here.
    #       Consult the syslog.conf(5) manpage.
    *.err;kern.debug;auth.notice;mail.crit          /dev/console
    *.notice;kern.debug;lpr.info;mail.crit;news.err /var/log/messages
    security.*                                      /var/log/security
    auth.info;authpriv.info                         /var/log/auth.log
    local0.notice;local0.debug;mail.*;mail.none;mail.info;local0.info /var/log/maillog
    lpr.info                                        /var/log/lpd-errs
    cron.*                                          /var/log/cron
    *.emerg                                         *
    # uncomment this to log all writes to /dev/console to /var/log/console.log
    #console.info                                   /var/log/console.log
    # uncomment this to enable logging of all log messages to /var/log/all.log
    # touch /var/log/all.log and chmod it to mode 600 before it will work
    #*.*                                            /var/log/all.log
    # uncomment this to enable logging to a remote loghost named loghost
    #*.*                                            @loghost
    # uncomment these if you're running inn
    # news.crit                                     /var/log/news/news.crit
    # news.err                                      /var/log/news/news.err
    # news.notice                                   /var/log/news/news.notice
    !startslip
    *.*                                             /var/log/slip.log
    !ppp
    *.*                                             /var/log/ppp.log
    local0.notice;local0.debug;mail.*;mail.none;mail.info;local0.info /var/log/maillog
    local0.notice;local0.debug;mail.*;mail.none;mail.info;local0.info /var/log/maillog
    local0.notice;local0.debug;mail.*;mail.none;mail.info;local0.info /var/log/maillog
    local0.notice;local0.debug;mail.*;mail.none;mail.info;local0.info /var/log/maillog
    local0.notice;local0.debug;mail.*;mail.none;mail.info;local0.info /var/log/maillog
    local0.notice;local0.debug;mail.*;mail.none;mail.info;local0.info /var/log/maillog
    local0.notice;local0.debug;mail.*;mail.none;mail.info;local0.info /var/log/maillog
    For some reason vBulletin is adding a space in i nfo but it's really just info in the file.
     
  8. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The /var/log/maillog file is where logging for POP3 access is logged. I see 8 entries (correct me if I'm wrong, my math's a bit sketchy here lately). So this means each time someone logs into your POP3 server to check for mail, then the log will log 8 duplicate entries. You only need 1 entry, so you can delete the other 7.

    Try restarting cppop. I don't know if that would have any affect on the relayhosts file or not

    /scripts/restartsrv_cppop
     
  9. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    Those entries are located in /etc/syslog.conf. I thought /etc/relayhosts was where IPs were stored from users who access their account via POP? Then it enables them to send mail through SMTP if their IP is listed in relayhosts.
     
  10. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    There isn't a file on my server at /var/log/maillog. Could this be the problem? If so, what kind of permissions should I give it?
     
  11. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    Problem solved! Thanks guys, it was because maillog was missing.
     
Loading...

Share This Page