Re: [Exim] Exim and SpamAssassin: Spam tagged, now what?

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Christopher Allen [BigFatPipe.Net]
Dátum:  
Címzett: Exim-users
Tárgy: Re: [Exim] Exim and SpamAssassin: Spam tagged, now what?
On Fri, 6 Jun 2003, Tom Kistner wrote:
> > thought of sending it to a "quarantine" account, but then it would be
> > "delivered". A "false positive" message would then be awkward to "deliver"
> > to the intended recipient (who would almost certainly reply to me, not the
> > original sender).
>
> Don't freeze the junk. As you see, it starts to smell. Mark it with a
> special header or even subject tag and then let the end users do the
> filtering in their MUAs.


I agree with this. With that said, many moons ago someone posted a tool
called "eximclean" to the list which had a sole purpose of going in and
cleaning up frozen messages.

The tool is below my .sig. I _cannot_ take credit for it, but I don't
recall who the original author(s) was(ere).

-CA

-- Christopher R. Allen ---- cra@??? --
-- "Education is a progressive discovery of our --
-- own ignorance." ---------------- Will Durant --

#!/bin/sh

# Clean an exim queue of frozen bounce messages.
# Usage: $0 [address] [nofreeze]

# If an [address] option is given it is used as a regexp to match against the
# sender of the addresses to remove

# If the [nofreeze] option is given (can be any string) then the
# mail doesn't have to be frozen. Use with care.

PATH=/usr/local/sbin:/usr/xpg4/bin:/usr/local/bin:$PATH

if [ -n "$2" ]; then
fr="$2"
else
fr=' \*\*\* frozen \*\*\*'
fi

# if you have a version of exim too old to use the r option, remove it.
/usr/local/exim/bin/exim -bpru | \
  awk 'BEGIN {
         rmfunct="/usr/local/exim/bin/exim -Mrm "
       }


       /^ ?[0-9].*<'"$1"'>'"$fr"'$/ {
         rmlist= rmlist " " $3; ++num
         if (num > 50) {
           if (system(rmfunct rmlist ">/dev/null") !=0) {
             print "Call to " rmfunct " " rmlist " failed."
           } else {
             total+=num; num=0; rmlist=""
           }
         }
       }


       END {
         if (num > 0) {
           if (system(rmfunct rmlist ">/dev/null") !=0) {
             print "Call to " rmfunct " " rmlist " failed."
           } else {
             total+=num
           }
         }
         if (total > 0) {
           print total " message[s] removed."
         }
       }'