View | Details | Raw Unified | Return to bug 59457
Collapse All | Expand All

(-)/server-root/ports/mail/p5-MIME-Tools/Makefile (-1 / +1 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=	p5-MIME-Tools
8
PORTNAME=	p5-MIME-Tools
9
PORTVERSION=	5.411a
9
PORTVERSION=	5.411a
10
PORTREVISION=	2
10
PORTREVISION=	3
11
PORTEPOCH=	1
11
PORTEPOCH=	1
12
CATEGORIES=	mail perl5
12
CATEGORIES=	mail perl5
13
MASTER_SITES=	${MASTER_SITE_PERL_CPAN}
13
MASTER_SITES=	${MASTER_SITE_PERL_CPAN}
(-)/server-root/ports/mail/p5-MIME-Tools/files/patch-ParamVal.pm (-2 / +96 lines)
Lines 1-5 Link Here
1
--- lib/MIME/Field/ParamVal.pm.orig	Sun Nov  5 04:54:49 2000
1
--- ../MIME-tools-5.411.orig/lib/MIME/Field/ParamVal.pm	Sat Nov  4 20:54:49 2000
2
+++ lib/MIME/Field/ParamVal.pm	Thu Jun  6 10:15:15 2002
2
+++ lib/MIME/Field/ParamVal.pm	Wed Nov 19 09:13:45 2003
3
@@ -9,42 +9,42 @@
4
 =head1 SYNOPSIS
5
 
6
     # Create an object for a content-type field:
7
-    $field = new Mail::Field 'Content-type'; 
8
-     
9
+    $field = new Mail::Field 'Content-type';
10
+
11
     # Set some attributes:
12
     $field->param('_'        => 'text/html');
13
     $field->param('charset'  => 'us-ascii');
14
     $field->param('boundary' => '---ABC---');
15
-     
16
+
17
     # Same:
18
     $field->set('_'        => 'text/html',
19
 		'charset'  => 'us-ascii',
20
 		'boundary' => '---ABC---');
21
-      
22
+
23
     # Get an attribute, or undefined if not present:
24
     print "no id!"  if defined($field->param('id'));
25
-     
26
+
27
     # Same, but use empty string for missing values:
28
     print "no id!"  if ($field->paramstr('id') eq '');
29
-                    
30
+
31
     # Output as string:
32
     print $field->stringify, "\n";
33
 
34
 
35
 =head1 DESCRIPTION
36
 
37
-This is an abstract superclass of most MIME fields.  It handles 
38
+This is an abstract superclass of most MIME fields.  It handles
39
 fields with a general syntax like this:
40
 
41
     Content-Type: Message/Partial;
42
-        number=2; total=3;
43
-        id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
44
+	number=2; total=3;
45
+	id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
46
 
47
 Comments are supported I<between> items, like this:
48
 
49
     Content-Type: Message/Partial; (a comment)
50
-        number=2  (another comment) ; (yet another comment) total=3;
51
-        id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
52
+	number=2  (another comment) ; (yet another comment) total=3;
53
+	id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
54
 
55
 
56
 =head1 PUBLIC INTERFACE
3
@@ -100,6 +100,9 @@
57
@@ -100,6 +100,9 @@
4
 #      token      =  1*<any  (ASCII) CHAR except SPACE, CTLs, or tspecials>
58
 #      token      =  1*<any  (ASCII) CHAR except SPACE, CTLs, or tspecials>
5
 #
59
 #
Lines 20-25 Link Here
20
 
74
 
21
 #------------------------------
75
 #------------------------------
22
 #
76
 #
77
@@ -133,7 +139,7 @@
78
 		  'total'   => 3,
79
 		  'id'      => "ocj=pbe0M2");
80
 
81
-Note that a single argument is taken to be a I<reference> to 
82
+Note that a single argument is taken to be a I<reference> to
83
 a paramhash, while multiple args are taken to be the elements
84
 of the paramhash themselves.
85
 
86
@@ -160,16 +166,16 @@
87
 it as a hash reference.  For example, here is a field with parameters:
88
 
89
     Content-Type: Message/Partial;
90
-        number=2; total=3;
91
-        id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
92
+	number=2; total=3;
93
+	id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
94
 
95
 Here is how you'd extract them:
96
 
97
     $params = $class->parse_params('content-type');
98
     if ($$params{'_'} eq 'message/partial') {
99
-        $number = $$params{'number'};
100
-        $total  = $$params{'total'};
101
-        $id     = $$params{'id'};
102
+	$number = $$params{'number'};
103
+	$total  = $$params{'total'};
104
+	$id     = $$params{'id'};
105
     }
106
 
107
 Like field names, parameter names are coerced to lowercase.
23
@@ -181,10 +187,40 @@
108
@@ -181,10 +187,40 @@
24
 
109
 
25
 =cut
110
 =cut
Lines 112-114 Link Here
112
 	debug "   field param <$param> = <$params{$param}>";
197
 	debug "   field param <$param> = <$params{$param}>";
113
     }
198
     }
114
 
199
 
200
@@ -227,7 +301,7 @@
201
 
202
     # Allow use as constructor, for MIME::Head:
203
     ref($self) or $self = bless({}, $self);
204
-    
205
+
206
     # Get params, and stuff them into the self object:
207
     $self->set($self->parse_params($string));
208
 }
(-)/server-root/ports/mail/p5-MIME-Tools/files/patch-Parser.pm (+75 lines)
Line 0 Link Here
1
--- ../MIME-tools-5.411.orig/lib/MIME/Parser.pm	Sun Nov 12 06:55:11 2000
2
+++ lib/MIME/Parser.pm	Wed Nov 19 09:13:57 2003
3
@@ -378,16 +378,17 @@
4
 =item extract_nested_messages OPTION
5
 
6
 I<Instance method.>
7
-Some MIME messages will contain a part of type C<message/rfc822>:
8
+Some MIME messages will contain a part of type C<message/rfc822>
9
+or C<message/partial> or C<message/external-body>:
10
 literally, the text of an embedded mail/news/whatever message.  
11
 This option controls whether (and how) we parse that embedded message.
12
 
13
 If the OPTION is false, we treat such a message just as if it were a 
14
 C<text/plain> document, without attempting to decode its contents.  
15
 
16
-If the OPTION is true (the default), the body of the C<message/rfc822> 
17
-part is parsed by this parser, creating an entity object.  
18
-What happens then is determined by the actual OPTION:
19
+If the OPTION is true (the default), the body of the C<message/rfc822>
20
+or C<message/partial> part is parsed by this parser, creating an
21
+entity object.  What happens then is determined by the actual OPTION:
22
 
23
 =over 4
24
 
25
@@ -592,6 +593,7 @@
26
 #
27
 # I<Instance method.>
28
 # Process and return the next header.
29
+# Return undef if, instead of a header, the encapsulation boundary is found.
30
 # Fatal exception on failure.
31
 #
32
 sub process_header {
33
@@ -612,6 +614,10 @@
34
     foreach (@headlines) { s/[\r\n]+\Z/\n/ }  ### fold
35
 
36
     ### How did we do?
37
+    if ($hdr_rdr->eos_type eq 'DELIM') {
38
+       $self->whine("bogus part, without CRLF before body");
39
+       return;
40
+    }
41
     ($hdr_rdr->eos_type eq 'DONE') or
42
 	$self->error("unexpected end of header\n");
43
 
44
@@ -983,7 +989,17 @@
45
 
46
     ### Parse and add the header:
47
     my $head = $self->process_header($in, $rdr);
48
-    $ent->head($head);   
49
+    if (not defined $head) {
50
+       $self->debug("bogus empty part");
51
+       $head = $self->interface('HEAD_CLASS')->new;
52
+       $head->mime_type('text/plain; charset=US-ASCII');
53
+       $ent->head($head);
54
+       $ent->bodyhandle($self->new_body_for($head));
55
+       $ent->bodyhandle->open("w")->close;
56
+       $self->results->level(-1);
57
+       return $ent;
58
+    }
59
+    $ent->head($head);
60
 
61
     ### Tweak the content-type based on context from our parent...
62
     ### For example, multipart/digest messages default to type message/rfc822:
63
@@ -997,8 +1013,10 @@
64
     if ($type eq 'multipart') {
65
 	$self->process_multipart($in, $rdr, $ent);
66
     }
67
-    elsif (("$type/$subtype" eq "message/rfc822") && 
68
-	   $self->extract_nested_messages) {
69
+    elsif (("$type/$subtype" eq "message/rfc822" ||
70
+            "$type/$subtype" eq "message/external-body" ||
71
+	    ("$type/$subtype" eq "message/partial" && $head->mime_attr("content-type.number") == 1)) && 
72
+	    $self->extract_nested_messages) {
73
 	$self->debug("attempting to process a nested message");
74
 	$self->process_message($in, $rdr, $ent);
75
     }
(-)/server-root/ports/mail/p5-MIME-Tools/files/patch-Words.pm (-2 / +2 lines)
Lines 1-5 Link Here
1
--- lib/MIME/Words.pm.orig	Sat Nov 11 01:45:12 2000
1
--- ../MIME-tools-5.411.orig/lib/MIME/Words.pm	Fri Nov 10 17:45:12 2000
2
+++ lib/MIME/Words.pm	Thu Jun  6 10:15:15 2002
2
+++ lib/MIME/Words.pm	Wed Nov 19 09:13:45 2003
3
@@ -186,7 +186,7 @@
3
@@ -186,7 +186,7 @@
4
     $@ = '';           ### error-return
4
     $@ = '';           ### error-return

Return to bug 59457