4 |
# Author : Ulrich Pfeifer |
# Author : Ulrich Pfeifer |
5 |
# Created On : Thu Sep 5 16:17:38 1996 |
# Created On : Thu Sep 5 16:17:38 1996 |
6 |
# Last Modified By: Ulrich Pfeifer |
# Last Modified By: Ulrich Pfeifer |
7 |
# Last Modified On: Fri Dec 29 16:26:17 2000 |
# Last Modified On: Fri Dec 29 17:01:42 2000 |
8 |
# Language : CPerl |
# Language : CPerl |
9 |
# Update Count : 66 |
# Update Count : 75 |
10 |
# Status : Unknown, Use with caution! |
# Status : Unknown, Use with caution! |
11 |
# |
# |
12 |
# Copyright (c) 1996-1997, Ulrich Pfeifer |
# Copyright (c) 1996-1997, Ulrich Pfeifer |
23 |
my %result; |
my %result; |
24 |
my $fld; |
my $fld; |
25 |
|
|
26 |
@result{qw(subject from to)} = (split /\t/, $_[1])[1,2,9]; |
@result{qw(article subject from to)} = (split /\t/, $_[1])[0,1,2,9]; |
27 |
|
$result{subject} = WAIT::Filter::unmime($result{subject}); |
28 |
return \%result; # we go for speed |
return \%result; # we go for speed |
29 |
} |
} |
30 |
|
|
35 |
|
|
36 |
local $_ = $_[1]; |
local $_ = $_[1]; |
37 |
|
|
38 |
s/^([^\t]*\t)//; push @result, {}, $1; |
s/^([^\t]*\t)//; push @result, { article => 1}, $1; |
39 |
s/^([^\t]*\t)//; push @result, { subject => 1}, $1; |
s/^([^\t]*\t)//; push @result, { subject => 1}, WAIT::Filter::unmime($1); |
40 |
s/^([^\t]*\t)//; push @result, { from => 1}, $1; |
s/^([^\t]*\t)//; push @result, { from => 1}, $1; |
41 |
s/^([^\t]*\t){7,7}//; push @result, {}, $1; |
s/^([^\t]*\t){7,7}//; push @result, {}, $1; |
42 |
s/^([^\t]*\t)//; push @result, { to => 1}, $1; |
s/^([^\t]*\t)//; push @result, { to => 1}, $1; |
46 |
return @result; # we don't go for speed |
return @result; # we don't go for speed |
47 |
} |
} |
48 |
|
|
49 |
|
package WAIT::Filter; |
50 |
|
|
51 |
|
sub unmime { |
52 |
|
local($_) = @_; |
53 |
|
|
54 |
|
return '' unless defined $_; |
55 |
|
|
56 |
|
if (s/\Q=?iso-8859-1?Q?\E(.*)\?=/$1/) { |
57 |
|
s/_/ /g; |
58 |
|
s/=([0-9AF]{2,2})/pack 'C', hex($1)/eg; |
59 |
|
} |
60 |
|
$_; |
61 |
|
} |
62 |
|
|
63 |
1; |
1; |
64 |
|
|