Move non-spam mail with corrupt headers into data/bad/ so that it can be inspected later.

Bug #358454 r=justdave
This commit is contained in:
cls%seawood.org 2006-11-03 20:53:14 +00:00
Родитель e9db756bd9
Коммит 120f05733d
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -146,11 +146,12 @@ install:
cp $$I $(TINDERBOX_DIR) && \
chmod 644 $(TINDERBOX_DIR)/$$I; \
done
mkdir -p $(TINDERBOX_DIR)/data
mkdir -p $(TINDERBOX_DIR)/data/bad
chown -R $(TINDERBOX_USER) $(TINDERBOX_DIR)
chgrp -R $(TINDERBOX_GROUP) $(TINDERBOX_DIR)
chmod 755 $(TINDERBOX_DIR)
chmod 770 $(TINDERBOX_DIR)/data
chmod 770 $(TINDERBOX_DIR)/data/bad
chmod 770 $(TINDERBOX_DIR)/examples
define READPASS

Просмотреть файл

@ -24,6 +24,8 @@ use Compress::Zlib;
use Compress::Bzip2;
use Getopt::Long;
use Time::Local;
use File::Copy;
use File::Basename;
use lib "@TINDERBOX_DIR@";
require 'tbglobals.pl'; # for $gzip
#use strict;
@ -39,6 +41,7 @@ my ($only_check_mail);
my @changed_trees=();
my %scraped_trees;
my $debug = 0;
my $rejected_mail_dir = "$data_dir/bad";
chdir $tinderboxdir or die "Couldn't chdir to $tinderboxdir";
@ -109,7 +112,12 @@ sub process_mailfile($) {
# Make sure variables are defined correctly
#
return if (&check_required_variables(\%tinderbox, \%MAIL_HEADER));
if (&check_required_variables(\%tinderbox, \%MAIL_HEADER)) {
my $rejected_mail = $rejected_mail_dir . "/" . basename($mail_file);
print "Moving corrupt logfile, $mail_file , to $rejected_mail .\n";
move($mail_file, $rejected_mail_dir);
return;
}
if ($only_check_mail) {
warn "Mail variables passed the test\n";