[interchange-cvs] interchange - heins modified lib/Vend/Interpolate.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu Oct 13 12:31:34 EDT 2005


User:      heins
Date:      2005-10-13 16:31:33 GMT
Modified:  lib/Vend Interpolate.pm
Log:
* Add transfer-encoding parameter as suggested by Lars Tode.

Revision  Changes    Path
2.254     +16 -8     interchange/lib/Vend/Interpolate.pm


rev 2.254, prev_rev 2.253
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.253
retrieving revision 2.254
diff -u -r2.253 -r2.254
--- Interpolate.pm	4 Oct 2005 19:34:29 -0000	2.253
+++ Interpolate.pm	13 Oct 2005 16:31:33 -0000	2.254
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.253 2005/10/04 19:34:29 jon Exp $
+# $Id: Interpolate.pm,v 2.254 2005/10/13 16:31:33 mheins Exp $
 #
 # Copyright (C) 2002-2005 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.253 $, 10);
+$VERSION = substr(q$Revision: 2.254 $, 10);
 
 @EXPORT = qw (
 
@@ -1865,7 +1865,7 @@
 							':=' . $$
 		unless defined $::Instance->{MIME_BOUNDARY};
 
-	my $msg_type = "multipart/mixed";
+	my $msg_type = $opt->{type} || "multipart/mixed";
 	if($option eq 'reset') {
 		undef $::Instance->{MIME_TIMESTAMP};
 		undef $::Instance->{MIME_BOUNDARY};
@@ -1894,13 +1894,21 @@
 		$::Instance->{MIME} = 1;
 		my $desc = $opt->{description} || $option;
 		my $type = $opt->{type} || 'text/plain; charset=US-ASCII';
-		my $disposition = $opt->{attach_only} ? qq{attachment; filename="$desc"} : "inline";
+		my $disposition = $opt->{attach_only}
+						? qq{attachment; filename="$desc"}
+						: "inline";
+		my $encoding = $opt->{transfer_encoding};
+		my @headers;
+		push @headers, "Content-Type: $type";
+		push @headers, "Content-ID: $id";
+		push @headers, "Content-Disposition: $disposition";
+		push @headers, "Content-Description: $desc";
+		push @headers, "Content-Transfer-Encoding: $opt->{transfer_encoding}"
+			if $opt->{transfer_encoding};
+		my $head = join "\n", @headers;
 		$out = <<EndOFmiMe;
 --$::Instance->{MIME_BOUNDARY}
-Content-Type: $type
-Content-ID: $id
-Content-Disposition: $disposition
-Content-Description: $desc
+$head
 
 $text
 EndOFmiMe








More information about the interchange-cvs mailing list