[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] persistent pop lock problems.



> Date: Thu, 21 Mar 2002 23:57:43 -0500
> From: Roy A. Urick <rurick@xxxxxxxxxxxxxxxx>

> removing the pop locks are all well and good, except we are
> talking AT LEAST once a week, if not once a day (sometimes
> more) for this individual account.

See below .sig and spam trapping for shell script which works
well.  I agree, though, that a better-behaved pop3d is the real
answer.


Eddy

Brotsman & Dreger, Inc. - EverQuick Internet Division
Phone: +1 (316) 794-8922 Wichita/(Inter)national
Phone: +1 (785) 865-5885 Lawrence
--

Date: Mon, 21 May 2001 11:23:58 +0000 (GMT)
From: A Trap <blacklist@xxxxxxxxx>
To: blacklist@xxxxxxxxx
Subject: Please ignore this portion of my mail signature.

These last few lines are a trap for address-harvesting spambots.  Do NOT
send mail to <blacklist@xxxxxxxxx>, or you are likely to be blocked.



#!/bin/sh
##
## 8-1-97 Ian Kinner (ian@xxxxxxx)
##
## Simple sh script to remove stale files left in the in.pop3d tmp 
## directory, which cause DoS for POP3 users. Should be run by a crontab
## every 15 minutes or so.
##
## Modified 2-10-1999 Patrick J. Volkerding (volkerdi@xxxxxxxxxxxxx)
##

# in.pop3d spool directory:
TMPDIR=/var/spool/pop
if [ ! -d $TMPDIR ]; then
  exit
fi

# Secure (non user-writable) location for temporary files:
STMP=/var/log/setup/tmp

# Make secure TMP directory if it doesn't already exist:
if [ ! -d $STMP ]; then
  mkdir -p $STMP
  chmod 700 $STMP
fi

# Generate a list of users with POP files in $TMPDIR.  If these
# users are not currently using POP, then they're locked out.
ls -l $TMPDIR | awk '{print $9}' > $STMP/USERLIST
NUMBER=`wc -l $STMP/USERLIST | awk '{print $1}'`

while [ $NUMBER -gt 1 ]; do
  USER=`head -$NUMBER $STMP/USERLIST | tail -1`
  if ps aux | grep in.pop3d | grep "^$USER " 1> /dev/null ; then # logged in
    DONOTHING=true
  else # stale lock file found
    rm -f $TMPDIR/$USER
    echo "flushpop.sh: stale POP file for $USER deleted" | logger
  fi
  NUMBER="`expr $NUMBER - 1`"
done

rm -f $STMP/USERLIST