r76213 - in /trunk/libcourriel-perl: ./ debian/ lib/ lib/Courriel/ lib/Courriel/Part/ lib/Courriel/Role/ lib/Courriel/Types/ lib/Email/Abstract/ t/

mxey-guest at users.alioth.debian.org mxey-guest at users.alioth.debian.org
Tue Jun 21 16:00:28 UTC 2011


Author: mxey-guest
Date: Tue Jun 21 16:00:25 2011
New Revision: 76213

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=76213
Log:
New upstream release

Modified:
    trunk/libcourriel-perl/Changes
    trunk/libcourriel-perl/META.json
    trunk/libcourriel-perl/META.yml
    trunk/libcourriel-perl/Makefile.PL
    trunk/libcourriel-perl/README
    trunk/libcourriel-perl/debian/changelog
    trunk/libcourriel-perl/dist.ini
    trunk/libcourriel-perl/lib/Courriel.pm
    trunk/libcourriel-perl/lib/Courriel/Builder.pm
    trunk/libcourriel-perl/lib/Courriel/ContentType.pm
    trunk/libcourriel-perl/lib/Courriel/Disposition.pm
    trunk/libcourriel-perl/lib/Courriel/Headers.pm
    trunk/libcourriel-perl/lib/Courriel/Helpers.pm
    trunk/libcourriel-perl/lib/Courriel/Part/Multipart.pm
    trunk/libcourriel-perl/lib/Courriel/Part/Single.pm
    trunk/libcourriel-perl/lib/Courriel/Role/HasParts.pm
    trunk/libcourriel-perl/lib/Courriel/Role/Headers.pm
    trunk/libcourriel-perl/lib/Courriel/Role/Part.pm
    trunk/libcourriel-perl/lib/Courriel/Types.pm
    trunk/libcourriel-perl/lib/Courriel/Types/Internal.pm
    trunk/libcourriel-perl/lib/Email/Abstract/Courriel.pm
    trunk/libcourriel-perl/t/Builder.t

Modified: trunk/libcourriel-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/Changes?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/Changes (original)
+++ trunk/libcourriel-perl/Changes Tue Jun 21 16:00:25 2011
@@ -1,3 +1,25 @@
+0.13     2011-06-20
+
+- A multipart email build with Courriel::Builder would have a broken
+  Content-Type header, missing the required boundary attribute. Reported by
+  ico. RT #68694.
+
+- If you explicitly passed unencoded content when creating a part (which
+  happens when using Courriel::Builder), that content would be modified so it
+  had CRLF line endings. Now, such content is left untouched. Reported by
+  ico. RT #68695.
+
+- When passing encoded content to the Courriel::Part::Single constructor, the
+  constructor used to modify the content so it had CRLF line endings. Now it
+  is left alone.
+
+- Note that if you're passing raw content to the Single constructor _and_
+  setting the transfer encoding to 7bit, 8bit, or binary, then you'll end up
+  with a noncomformant email. However, by default all raw content is base64
+  encoded. It is strongly recommended that you pass raw content and let
+  Courriel take care of the transfer encoding.
+
+
 0.12     2011-06-07
 
 [BUG FIXES]

Modified: trunk/libcourriel-perl/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/META.json?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/META.json (original)
+++ trunk/libcourriel-perl/META.json Tue Jun 21 16:00:25 2011
@@ -4,7 +4,7 @@
       "Dave Rolsky <autarch at urth.org>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Dist::Zilla version 4.200007, CPAN::Meta::Converter version 2.110440",
+   "generated_by" : "Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.110930",
    "license" : [
       "artistic_2"
    ],
@@ -62,6 +62,6 @@
          "web" : "http://git.urth.org/Courriel.git"
       }
    },
-   "version" : "0.12"
+   "version" : "0.13"
 }
 

Modified: trunk/libcourriel-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/META.yml?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/META.yml (original)
+++ trunk/libcourriel-perl/META.yml Tue Jun 21 16:00:25 2011
@@ -10,7 +10,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.30
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.200007, CPAN::Meta::Converter version 2.110440'
+generated_by: 'Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.110930'
 license: artistic_2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -38,4 +38,4 @@
 resources:
   bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Courriel
   repository: git://git.urth.org/Courriel.git
-version: 0.12
+version: 0.13

Modified: trunk/libcourriel-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/Makefile.PL?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/Makefile.PL (original)
+++ trunk/libcourriel-perl/Makefile.PL Tue Jun 21 16:00:25 2011
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use 5.010000;
+BEGIN { require 5.10.0; }
 
 use ExtUtils::MakeMaker 6.30;
 
@@ -43,7 +43,7 @@
     'Sub::Exporter' => '0',
     'namespace::autoclean' => '0'
   },
-  'VERSION' => '0.12',
+  'VERSION' => '0.13',
   'test' => {
     'TESTS' => 't/*.t'
   }

Modified: trunk/libcourriel-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/README?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/README (original)
+++ trunk/libcourriel-perl/README Tue Jun 21 16:00:25 2011
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution Courriel,
-version 0.12:
+version 0.13:
 
   High level email parsing and manipulation
 

Modified: trunk/libcourriel-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/debian/changelog?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/debian/changelog (original)
+++ trunk/libcourriel-perl/debian/changelog Tue Jun 21 16:00:25 2011
@@ -1,3 +1,9 @@
+libcourriel-perl (0.13-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Maximilian Gass <mxey at cloudconnected.org>  Tue, 21 Jun 2011 18:00:09 +0200
+
 libcourriel-perl (0.12-1) unstable; urgency=low
 
   * Initial release (closes: #629981).

Modified: trunk/libcourriel-perl/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/dist.ini?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/dist.ini (original)
+++ trunk/libcourriel-perl/dist.ini Tue Jun 21 16:00:25 2011
@@ -3,7 +3,7 @@
 license = Artistic_2_0
 copyright_holder = Dave Rolsky
 
-version = 0.12
+version = 0.13
 
 [NextRelease]
 format = %-8v %{yyyy-MM-dd}d

Modified: trunk/libcourriel-perl/lib/Courriel.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel;
 BEGIN {
-  $Courriel::VERSION = '0.12';
+  $Courriel::VERSION = '0.13';
 }
 
 use 5.10.0;
@@ -433,7 +433,7 @@
 
 =head1 VERSION
 
-version 0.12
+version 0.13
 
 =head1 SYNOPSIS
 

Modified: trunk/libcourriel-perl/lib/Courriel/Builder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Builder.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Builder.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Builder.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Builder;
 BEGIN {
-  $Courriel::Builder::VERSION = '0.12';
+  $Courriel::Builder::VERSION = '0.13';
 }
 
 use strict;
@@ -116,7 +116,7 @@
             );
         }
 
-        _add_needed_headers( \@headers );
+        _add_required_headers( \@headers );
 
         # XXX - a little incestuous but I don't really want to make this method
         # public, and delaying building the body part would make all the code more
@@ -133,7 +133,7 @@
         . Devel::PartialDump->new()->dump( $_[0] );
 }
 
-sub _add_needed_headers {
+sub _add_required_headers {
     my $headers = shift;
 
     my %keys = map { lc } @{$headers};
@@ -473,7 +473,7 @@
 
 =head1 VERSION
 
-version 0.12
+version 0.13
 
 =head1 SYNOPSIS
 
@@ -571,6 +571,9 @@
 
 The encoding for the body. This defaults to base64. Other valid values are
 quoted-printable, 7bit, and 8bit.
+
+It is strongly recommended that you let Courriel handle the transfer encoding
+for you.
 
 =back
 

Modified: trunk/libcourriel-perl/lib/Courriel/ContentType.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/ContentType.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/ContentType.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/ContentType.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::ContentType;
 BEGIN {
-  $Courriel::ContentType::VERSION = '0.12';
+  $Courriel::ContentType::VERSION = '0.13';
 }
 
 use strict;
@@ -76,7 +76,7 @@
 
 =head1 VERSION
 
-version 0.12
+version 0.13
 
 =head1 SYNOPSIS
 

Modified: trunk/libcourriel-perl/lib/Courriel/Disposition.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Disposition.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Disposition.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Disposition.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Disposition;
 BEGIN {
-  $Courriel::Disposition::VERSION = '0.12';
+  $Courriel::Disposition::VERSION = '0.13';
 }
 
 use strict;
@@ -111,7 +111,7 @@
 
 =head1 VERSION
 
-version 0.12
+version 0.13
 
 =head1 SYNOPSIS
 

Modified: trunk/libcourriel-perl/lib/Courriel/Headers.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Headers.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Headers.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Headers.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Headers;
 BEGIN {
-  $Courriel::Headers::VERSION = '0.12';
+  $Courriel::Headers::VERSION = '0.13';
 }
 
 use strict;
@@ -413,7 +413,7 @@
 
 =head1 VERSION
 
-version 0.12
+version 0.13
 
 =head1 SYNOPSIS
 

Modified: trunk/libcourriel-perl/lib/Courriel/Helpers.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Helpers.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Helpers.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Helpers.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Helpers;
 BEGIN {
-  $Courriel::Helpers::VERSION = '0.12';
+  $Courriel::Helpers::VERSION = '0.13';
 }
 
 use strict;

Modified: trunk/libcourriel-perl/lib/Courriel/Part/Multipart.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Part/Multipart.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Part/Multipart.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Part/Multipart.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Part::Multipart;
 BEGIN {
-  $Courriel::Part::Multipart::VERSION = '0.12';
+  $Courriel::Part::Multipart::VERSION = '0.13';
 }
 
 use strict;
@@ -40,10 +40,13 @@
     my $self = shift;
 
     # XXX - this is a nasty hack but I'm not sure if it can better. We want
-    # the boundary in the ContentType object to match the one in this
-    # part. There are more such hacks to come.
-    if ( $self->_has_boundary() && $self->_has_content_type() ) {
+    # the boundary in the ContentType object to match the one in this part.
+    if ( $self->_has_boundary() ) {
         $self->content_type()->_attributes()->{boundary} = $self->boundary();
+    }
+    else {
+        # This is being called to force the builder to run.
+        $self->boundary();
     }
 
     return;
@@ -119,7 +122,7 @@
 
 =head1 VERSION
 
-version 0.12
+version 0.13
 
 =head1 SYNOPSIS
 

Modified: trunk/libcourriel-perl/lib/Courriel/Part/Single.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Part/Single.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Part/Single.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Part/Single.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Part::Single;
 BEGIN {
-  $Courriel::Part::Single::VERSION = '0.12';
+  $Courriel::Part::Single::VERSION = '0.13';
 }
 
 use strict;
@@ -66,14 +66,6 @@
             'You must provide a content or encoded_content parameter when constructing a Courriel::Part::Single object.';
     }
 
-    ${ $self->content_ref() }
-        =~ s/$Courriel::Helpers::LINE_SEP_RE/$Courriel::Helpers::CRLF/g
-        if $self->_has_content_ref();
-
-    ${ $self->encoded_content_ref() }
-        =~ s/$Courriel::Helpers::LINE_SEP_RE/$Courriel::Helpers::CRLF/g
-        if $self->_has_encoded_content_ref();
-
     if ( !$self->_has_encoding() ) {
         my @enc = $self->headers()->get('Content-Transfer-Encoding');
 
@@ -215,7 +207,7 @@
 
 =head1 VERSION
 
-version 0.12
+version 0.13
 
 =head1 SYNOPSIS
 
@@ -279,6 +271,9 @@
 You must pass a C<content> or C<encoded_content> value when creating a new part,
 but there's really no point in passing both.
 
+It is strongly recommended that you pass a C<content> parameter and letting
+this module do the encoding for you internally.
+
 =head2 $part->content()
 
 This returns returns the decoded content for the part. It will be in Perl's

Modified: trunk/libcourriel-perl/lib/Courriel/Role/HasParts.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Role/HasParts.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Role/HasParts.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Role/HasParts.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Role::HasParts;
 BEGIN {
-  $Courriel::Role::HasParts::VERSION = '0.12';
+  $Courriel::Role::HasParts::VERSION = '0.13';
 }
 
 use strict;

Modified: trunk/libcourriel-perl/lib/Courriel/Role/Headers.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Role/Headers.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Role/Headers.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Role/Headers.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Role::Headers;
 BEGIN {
-  $Courriel::Role::Headers::VERSION = '0.12';
+  $Courriel::Role::Headers::VERSION = '0.13';
 }
 
 use strict;

Modified: trunk/libcourriel-perl/lib/Courriel/Role/Part.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Role/Part.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Role/Part.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Role/Part.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Role::Part;
 BEGIN {
-  $Courriel::Role::Part::VERSION = '0.12';
+  $Courriel::Role::Part::VERSION = '0.13';
 }
 
 use strict;

Modified: trunk/libcourriel-perl/lib/Courriel/Types.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Types.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Types.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Types.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Types;
 BEGIN {
-  $Courriel::Types::VERSION = '0.12';
+  $Courriel::Types::VERSION = '0.13';
 }
 
 use strict;

Modified: trunk/libcourriel-perl/lib/Courriel/Types/Internal.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Courriel/Types/Internal.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Courriel/Types/Internal.pm (original)
+++ trunk/libcourriel-perl/lib/Courriel/Types/Internal.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Courriel::Types::Internal;
 BEGIN {
-  $Courriel::Types::Internal::VERSION = '0.12';
+  $Courriel::Types::Internal::VERSION = '0.13';
 }
 
 use strict;

Modified: trunk/libcourriel-perl/lib/Email/Abstract/Courriel.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/lib/Email/Abstract/Courriel.pm?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/lib/Email/Abstract/Courriel.pm (original)
+++ trunk/libcourriel-perl/lib/Email/Abstract/Courriel.pm Tue Jun 21 16:00:25 2011
@@ -1,6 +1,6 @@
 package Email::Abstract::Courriel;
 BEGIN {
-  $Email::Abstract::Courriel::VERSION = '0.12';
+  $Email::Abstract::Courriel::VERSION = '0.13';
 }
 
 use strict;
@@ -58,7 +58,7 @@
 
 =head1 VERSION
 
-version 0.12
+version 0.13
 
 =head1 DESCRIPTION
 

Modified: trunk/libcourriel-perl/t/Builder.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcourriel-perl/t/Builder.t?rev=76213&op=diff
==============================================================================
--- trunk/libcourriel-perl/t/Builder.t (original)
+++ trunk/libcourriel-perl/t/Builder.t Tue Jun 21 16:00:25 2011
@@ -185,6 +185,28 @@
        'us-ascii',
         'correct charset detected for attachment'
     );
+
+    is(
+        $attachment->content(),
+        $pl_script,
+        'attachment content matches the original code'
+    );
+
+    like(
+        $email->as_string(),
+        qr{Content-Type:\s+multipart/mixed;\s+boundary=.+},
+        'Content-Type header for multipart email includes boundary'
+    );
+
+    my $parsed = Courriel->parse( text => $email->as_string() );
+    my $parsed_attachment
+        = $parsed->first_part_matching( sub { $_[0]->is_attachment() } );
+
+    is(
+        $parsed_attachment->content(),
+        $pl_script,
+        'attachment content survives round trip from string to object'
+    );
 }
 
 {
@@ -293,7 +315,10 @@
     my $email = build_email(
         subject('Test Subject'),
         plain_body('Foo'),
-        attach( file => 't/data/office.jpg', content_id => 'abc123' ),
+        attach(
+            file       => 't/data/office.jpg',
+            content_id => 'abc123',
+        ),
     );
 
     my $attachment
@@ -309,7 +334,10 @@
     my $email = build_email(
         subject('Test Subject'),
         plain_body('Foo'),
-        attach( file => 't/data/office.jpg', mime_type => 'w/tf' ),
+        attach(
+            file      => 't/data/office.jpg',
+            mime_type => 'w/tf',
+        ),
     );
 
     my $attachment
@@ -326,7 +354,8 @@
         subject('Test Subject'),
         plain_body('Foo'),
         attach(
-            file => 't/data/office.jpg', filename => 'something-else.jpg'
+            file     => 't/data/office.jpg',
+            filename => 'something-else.jpg',
         ),
     );
 




More information about the Pkg-perl-cvs-commits mailing list