/[smeserver]/rpms/smeserver-qpsmtpd/sme7/smeserver-qpsmtpd-1.2.1-keeptnef.patch
ViewVC logotype

Contents of /rpms/smeserver-qpsmtpd/sme7/smeserver-qpsmtpd-1.2.1-keeptnef.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Tue Jun 12 17:33:47 2007 UTC (17 years, 5 months ago) by slords
Branch: MAIN
CVS Tags: smeserver-qpsmtpd-1_2_1-55_el4_sme, smeserver-qpsmtpd-1_2_1-50_el4_sme, smeserver-qpsmtpd-1_2_1-46_el4_sme, smeserver-qpsmtpd-1_2_1-56_el4_sme, smeserver-qpsmtpd-1_2_1-51_el4_sme, smeserver-qpsmtpd-1_2_1-44_el4_sme, smeserver-qpsmtpd-1_2_1-57_el4_sme, smeserver-qpsmtpd-1_2_1-52_el4_sme, smeserver-qpsmtpd-1_2_1-41_el4_sme, smeserver-qpsmtpd-1_2_1-54_el4_sme, smeserver-qpsmtpd-1_2_1-49_el4_sme, smeserver-qpsmtpd-1_2_1-43_el4_sme, smeserver-qpsmtpd-1_2_1-45_el4_sme, smeserver-qpsmtpd-1_2_1-47_el4_sme, smeserver-qpsmtpd-1_2_1-42_el4_sme, smeserver-qpsmtpd-1_2_1-53_el4_sme, smeserver-qpsmtpd-1_2_1-40_el4_sme, smeserver-qpsmtpd-1_2_1-39_el4_sme
Import on branch sme7 of package smeserver-qpsmtpd-1.2.1-39.el4.sme.src.rpm

1 diff -Nur -x '*.orig' -x '*.rej' smeserver-qpsmtpd-1.2.1/root/usr/share/qpsmtpd/plugins/tnef2mime mezzanine_patched_smeserver-qpsmtpd-1.2.1/root/usr/share/qpsmtpd/plugins/tnef2mime
2 --- smeserver-qpsmtpd-1.2.1/root/usr/share/qpsmtpd/plugins/tnef2mime 2007-01-27 16:29:42.000000000 -0700
3 +++ mezzanine_patched_smeserver-qpsmtpd-1.2.1/root/usr/share/qpsmtpd/plugins/tnef2mime 2007-01-27 16:29:26.000000000 -0700
4 @@ -40,6 +40,13 @@
5 $self->register_hook("data_post", "tnef2mime");
6 }
7
8 +sub hasMessageClassProperty {
9 + my $self = shift;
10 + my $data = $self->data("Attachment");
11 + return 0 unless $data;
12 + return index( $data, pack( "H*", "8008" ) ) >= 0;
13 +}
14 +
15 # for future use
16 sub kill_part ($)
17 {
18 @@ -68,19 +75,35 @@
19 # if $tnef is undefined here, the application/octet-stream was not a ms-tnef and we are done.
20 return 1 if( ! defined $tnef );
21
22 + my $keep_tnef=0;
23 for ($tnef->attachments)
24 {
25 next if !defined $_->datahandle;
26 +
27 + if( hasMessageClassProperty($_) ) # Outlook MAPI object
28 + {
29 + $keep_tnef++;
30 + $self->log(LOGWARN, sprintf "Outlook MAPI object #%i: %s", $keep_tnef, $_->longname);
31 + next;
32 + }
33 +
34 my $mimetype = $mm->checktype_filename( $_->datahandle->path );
35 $attachments[$count] = MIME::Entity->build(
36 Path=>$_->datahandle->path,
37 Filename=>$_->longname,
38 Encoding=>"base64",
39 Type=>$mimetype );
40 - $self->log(LOGDEBUG,
41 - sprintf "converted attachment #%i: %s (%s, %ld bytes)", $count+1, $_->longname, $mimetype, $_->size );
42 + $self->log(LOGWARN,
43 + sprintf "File attachment #%i: %s (%s, %ld bytes)", $count+1, $_->longname, $mimetype, $_->size );
44 $count++;
45 }
46 +
47 + if( $keep_tnef )
48 + {
49 + $attachments[$count++] = $part;
50 + $self->log(LOGWARN, "Original TNEF file attached." );
51 + }
52 +
53 push( @tnefs, $tnef ); # remind for cleanup
54 $foundtnef=1;
55 return 0;

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed