Cope with old-style application/pgp clearsigned messages.
# -*- perl -*-
-# $Id: errorlib.in,v 1.8 2002/10/15 23:33:37 cjwatson Exp $
+# $Id: errorlib.in,v 1.9 2002/10/20 13:21:15 cjwatson Exp $
sub F_SETLK { 6; } sub F_WRLCK{ 1; }
$flockstruct= 'sslll'; # And there ought to be something for this too.
my $entity = shift;
my $type = $entity->effective_type;
if ($type eq 'text/plain' or
- ($type =~ m#text/# and $type ne 'text/html')) {
+ ($type =~ m#text/# and $type ne 'text/html') or
+ $type eq 'application/pgp') {
return $entity->bodyhandle;
} elsif ($type eq 'multipart/alternative') {
# RFC 2046 says we should use the last part we recognize.
#!/usr/bin/perl
-# $Id: process.in,v 1.51 2002/10/15 23:33:37 cjwatson Exp $
+# $Id: process.in,v 1.52 2002/10/20 13:21:15 cjwatson Exp $
#
# Usage: process nn
# Temps: incoming/Pnn
# remove blank lines
shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;
+# Strip off RFC2440-style PGP clearsigning.
+if (@bodylines and $bodylines[0] =~ /^-----BEGIN PGP SIGNED/) {
+ shift @bodylines while @bodylines and length $bodylines[0];
+ shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;
+ for my $findsig (0 .. $#bodylines) {
+ if ($bodylines[$findsig] =~ /^-----BEGIN PGP SIGNATURE/) {
+ $#bodylines = $findsig - 1;
+ last;
+ }
+ }
+ map { s/^- // } @bodylines;
+}
+
# extract pseudo-headers
for my $phline (@bodylines)
{
#!/usr/bin/perl
-# $Id: service.in,v 1.56 2002/10/15 23:33:37 cjwatson Exp $
+# $Id: service.in,v 1.57 2002/10/20 13:21:15 cjwatson Exp $
# ^ more or less ^
#
# Usage: service <code>.nn
}
}
+# Strip off RFC2440-style PGP clearsigning.
+if (@bodylines and $bodylines[0] =~ /^-----BEGIN PGP SIGNED/) {
+ shift @bodylines while @bodylines and length $bodylines[0];
+ shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;
+ for my $findsig (0 .. $#bodylines) {
+ if ($bodylines[$findsig] =~ /^-----BEGIN PGP SIGNATURE/) {
+ $#bodylines = $findsig - 1;
+ last;
+ }
+ }
+ map { s/^- // } @bodylines;
+}
+
grep(s/\s+$//,@bodylines);
print "***\n",join("\n",@bodylines),"\n***\n" if $debug;