logo       

[SACVS] CVS: spamassassin/lib/Mail/SpamAssassin MIME.pm,1.3,1.4: msg#00122

mail.spam.spamassassin.cvs

Subject: [SACVS] CVS: spamassassin/lib/Mail/SpamAssassin MIME.pm,1.3,1.4

Update of /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin
In directory sc8-pr-cvs1:/tmp/cvs-serv7293/lib/Mail/SpamAssassin

Modified Files:
MIME.pm
Log Message:
more mime work


Index: MIME.pm
===================================================================
RCS file: /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin/MIME.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -w -u -d -r1.3 -r1.4
--- MIME.pm 24 Sep 2003 21:33:32 -0000 1.3
+++ MIME.pm 25 Sep 2003 03:38:03 -0000 1.4
@@ -14,7 +14,6 @@
raw_headers => {},

body_parts => [],
- attachments => [],
};

bless($self,$class);
@@ -77,39 +76,23 @@
}

sub add_body_part {
- my($self, $raw_type, $decoded, $raw, $boundary) = @_;
- $boundary ||= '';
+ my($self, $raw_type, $opts) = @_;
+
my $type = $raw_type;
$type ||= 'text/plain';
$type =~ s/;.*$//; # strip everything after first semi-colon
$type =~ s/[^a-zA-Z\/]//g; # strip inappropriate chars
- my $part =
- {
+
+ my $part = {
type => $type,
- raw_type => $raw_type,
- decoded => $decoded,
- raw => $raw,
- boundary => $boundary,
};
- $part->{parsed} = [] if ( $type eq "text/html" );
- push @{ $self->{body_parts} }, $part;
+
+ while( my($k,$v) = each %{$opts} ) {
+ $part->{$k} = $v;
}

-sub add_attachment {
- my($self, $raw_type, $decoded, $name, $raw, $boundary) = @_;
- my $type = $raw_type;
- $type ||= 'text/plain';
- $type =~ s/;.*$//; # strip everything after first semi-colon
- $type =~ s/[^a-zA-Z\/]//g; # strip inappropriate chars
- push @{ $self->{attachments} },
- {
- filename => $name,
- type => $type,
- raw_type => $raw_type,
- decoded => $decoded,
- raw => $raw,
- boundary => $boundary,
- };
+ $part->{parsed} = [] if ( $type eq "text/html" );
+ push @{ $self->{body_parts} }, $part;
}

sub body {
@@ -137,21 +120,6 @@
sub bodies {
my $self = shift;
return @{ $self->{body_parts} };
-}
-
-sub attachment {
- my $self = shift;
- return $self->{attachments}[shift];
-}
-
-sub attachments {
- my $self = shift;
- return @{ $self->{attachments} };
-}
-
-sub num_attachments {
- my $self = shift;
- return scalar @{ $self->{attachments} };
}

sub dbg { Mail::SpamAssassin::dbg (@_); }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise