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.

pop before smtp stopped working suddenly

Discussion in 'E-mail Discussions' started by pphillips, Jul 3, 2006.

  1. pphillips

    pphillips Well-Known Member

    Joined:
    Nov 14, 2003
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Pop before SMTP stopped working last night and we made no changes, my guess is maybe a cpanel update caused it.

    If I add our IP to /etc/relayhosts I am able to send. /etc/relayhosts is rw-r-r root:root. I tried restarting antirelayd and all it does is clear out my IP, it still doesn't add the IP when I try to receive.

    What could prevent the server from adding the IP of a user to relayhosts? If the server would add the IP's of POP users, it would work ok.

    Thanks for your help!

    Paul
     
  2. nxds

    nxds Well-Known Member

    Joined:
    Jan 6, 2006
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    antirelayd reads /var/log/maillog and adds IP addresses to /etc/relayhosts. I've seen pop before smtp break because of log rotation problems in CentOS.

    The easiest way to check for this is to look at the timestamps in /var/log using ls -ltr. If maillog.1 is newer than maillog then you have the log rotation bug where syslogd hasn't re-opened the log files after renaming them. The effect is that new pop connections are writting into maillog.1 but antirelayd is still reading from maillog.

    pkill -HUP syslogd should force syslogd to close and re-open the log files, but search the forums for a more permanent fix.
     
  3. pphillips

    pphillips Well-Known Member

    Joined:
    Nov 14, 2003
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Wow, you are a genius, that is exactly what happened.

    I found the following fix, but want to confirm if its correct:

    vi /etc/cron.daily/logrotate
    add
    export TMPDIR=/var/tmp

    My logrotate file currently contains:

    #!/bin/sh

    /usr/sbin/logrotate /etc/logrotate.conf
    EXITVALUE=$?
    if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
    fi
    exit 0

    Where in logrotate would I put "export TMPDIR=/var/tmp", the end after exit 0? and will this even permanently fix the issue?

    Thanks!
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You put it in after the first line. Yes, it's a permanent fix.
     
  5. pphillips

    pphillips Well-Known Member

    Joined:
    Nov 14, 2003
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    My /etc/cron.daily/logrotate file looks like this, and the system reverted back to writing to maillog.1 instead of maillog:

    #!/bin/sh
    export TMPDIR=/var/tmp
    /usr/sbin/logrotate /etc/logrotate.conf
    EXITVALUE=$?
    if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
    fi
    exit 0


    Does this look correct? Is there any other reason the system would revert back to writing to maillog.1 instead of maillog?
     
  6. nxds

    nxds Well-Known Member

    Joined:
    Jan 6, 2006
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    If /var/tmp is a symlink to /tmp I don't see how adding export TMPDIR=/var/tmp would make any difference.

    My understanding is that the problem occurs when the tmp dir is mounted noexec so the replacement TMPDIR must point to a directory in an non-noexec mounted filesystem.

    I fixed the problem on my systems in an entirely different way: I added a call to pkill -HUP syslogd in the line after the logger command. It may not be the best fix but I haven't had any problems in months.
     
Loading...

Share This Page