Re: [Exim] Exim 3.36 - how are frozen messages deleted

Página Inicial
Delete this message
Reply to this message
Autor: Richard Bible
Data:  
Para: Murray Alexander, Exim Users List
Assunto: Re: [Exim] Exim 3.36 - how are frozen messages deleted
Hey,

I came accross the same problem so our programmer developed this perl script
to clean out mail older than 10 days.

#############################################################
# Mail Queue Cleaner                                        #
# Remove items older than 10days from /var/spool/mail/input #
#############################################################


my $expire_days = "10";

# main loop
sub main {
        # Enter each queue dir
        my $startpoint = "/var/spool/mail/input/";


        opendir(DIR, $startpoint);
        my @dirs = readdir(DIR);
        close(DIR);


        foreach my $in_dir (@dirs) {
                if (grep(/[A-Z0-9]/i, $in_dir)) {
                        # grab all headers from that dir, older than a
particular date.
                        opendir(DIR, $startpoint.$in_dir);
                        my @files = readdir(DIR);
                        close(DIR);


                        foreach my $file (@files) {
                                if (grep(/\-D/, $file)) {
                                my
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) =
 stat($startpoint.$in_dir."/".$file);
                                        my $modify_time_clean =
localtime($mtime);
                                        # if the modified unix time is
smaller than the current - 30 days, mark it.
                                        my $expire_time = time() -
(60*60*24*$expire_days);
                                        if ($mtime < $expire_time) {


                                                my $filenew = $file;
                                                $filenew =~ s/\-D/\-H/;


                                                # Check it's in mailq.dat
                                                if (-r
$startpoint.$in_dir."/".$filenew) {


unlink($startpoint.$in_dir."/".$file);

unlink($startpoint.$in_dir."/".$filenew);
                                                        print "Removed Queue
Item $file (Created: $modify_time_clean)\n";


                                                }
                                        }
                                }
                        }
                }
        }
}



main();

hope that helps

Richard
----- Original Message -----
From: "Murray Alexander" <alexander_labs@???>
To: "Exim Users List" <exim-users@???>
Sent: Wednesday, July 02, 2003 6:32 AM
Subject: [Exim] Exim 3.36 - how are frozen messages deleted


> I'm running Exim 3.36 with SpamAssassin 2.55 on RHLinux 8.0.
>
> I have a system filter to freeze messages that are tagged as spam. It

works
> wonderfully.
>
> My configuration has 'timeout_frozen_after' set to '7d'. Yet, there are
> frozen messages that are 16 days old.
>
> The online doc says that a "queue runner" should delete these, but it

isn't
> happening. Where should I look to find out why and fix it?
>
> P.S. The online doc also says that bounce messages will be cancelled (just
> deleted), whereas other messages will be bounced. I don't want anything
> bounced, because it's spam and there's no point. Is there an option to say
> "just cancel any and all frozen messages older than the timeout"? Perhaps

I
> should set the timeout to '0s' (to turn it off, right?), then knock

together
> a Perl script to periodically check for and delete messages?
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim

details at http://www.exim.org/ ##
>
>