You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/11/17 03:33:12 UTC
svn commit: r345170 - in /spamassassin/trunk/build/automc: automc-by-mail
run_preflight
Author: jm
Date: Wed Nov 16 18:33:09 2005
New Revision: 345170
URL: http://svn.apache.org/viewcvs?rev=345170&view=rev
Log:
minor cleanups
Modified:
spamassassin/trunk/build/automc/automc-by-mail
spamassassin/trunk/build/automc/run_preflight
Modified: spamassassin/trunk/build/automc/automc-by-mail
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/build/automc/automc-by-mail?rev=345170&r1=345169&r2=345170&view=diff
==============================================================================
--- spamassassin/trunk/build/automc/automc-by-mail (original)
+++ spamassassin/trunk/build/automc/automc-by-mail Wed Nov 16 18:33:09 2005
@@ -45,10 +45,10 @@
my $ent = $parser->parse(\*STDIN) or die "parse failed\n";
-warn "Parsed message:
+print "Parsed message:
---------------------------------------------------------------------------\n";
$ent->print(\*STDOUT);
-warn "[EOM]
+print "[EOM]
---------------------------------------------------------------------------\n";
my $from = $ent->head()->get("From");
@@ -69,13 +69,13 @@
}
foreach my $part ($ent->parts) {
- my $ctype = $part->head->get("Content-Type") || '';
- my $disp = $part->head->get("Content-Disposition") || '';
- my $desc = $part->head->get("Content-Description") || '';
+ my $ctype = $part->head->get("Content-Type") || ''; chomp $ctype;
+ my $disp = $part->head->get("Content-Disposition") || ''; chomp $disp;
+ my $desc = $part->head->get("Content-Description") || ''; chomp $desc;
my $fname;
if ($desc && $desc =~ /\S/) {
- chomp $desc; $fname = $desc;
+ $fname = $desc;
} elsif ($disp && $disp =~ /filename=\"([^\"]+)\"/) {
$fname = $1;
} elsif ($disp && $disp =~ /filename=\'([^\']+)\'/) {
@@ -83,16 +83,17 @@
} elsif ($disp && $disp =~ /filename=([^\;\s]+)/) {
$fname = $1;
}
+ $fname =~ s/^\s*//; $fname =~ s/\s*$//;
- warn "part: (type=$ctype / disp=$disp)\n";
+ print "part: fname=$fname, type=$ctype, disp=$disp\n";
if ($ctype !~ /^text.plain\b/) {
- warn "skipping part: not text/plain";
+ print "skipping part: not text/plain\n";
next;
}
if (!$fname || $fname !~ /\.cf$/) {
- warn "skipping part: filename doesn't end in '.cf'";
+ print "skipping part: filename doesn't end in '.cf'\n";
next;
}
Modified: spamassassin/trunk/build/automc/run_preflight
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/build/automc/run_preflight?rev=345170&r1=345169&r2=345170&view=diff
==============================================================================
--- spamassassin/trunk/build/automc/run_preflight (original)
+++ spamassassin/trunk/build/automc/run_preflight Wed Nov 16 18:33:09 2005
@@ -49,11 +49,11 @@
#
if (run ("../spamassassin --lint -x -C tstrules", 1) != 0) {
warn "*** lint failed; exiting without mass-check! ***\n\n";
-
warn "Deleting 'mailed.cf', if it exists.\n"; unlink $BYMAILCF;
-warn "Rule files:\n"; system ("cat tstrules/*.cf");
-
+ warn "Rule files:\n"; system ("cat tstrules/*.cf");
die "lint failure";
+} else {
+ print "lint passed.\n";
}
# notes on this mass-check command: