Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-MIME CPAN distribution.

Report information
The Basics
Id: 80538
Status: resolved
Priority: 0/
Queue: Email-MIME

People
Owner: Nobody in particular
Requestors: tokuhirom+cpan [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Needless CRLF following multipart text
This test case fails. It means Email::MIME adds needless \r\n after the text part. use strict; use warnings; use utf8; use Test::More; use Email::MIME; use Devel::Peek; subtest 'multi part' => sub { my $src = Email::MIME->create( 'header' => [ 'From' => 'bar@example.jp', 'To' => 'foo@example.com', 'Subject' => "Test mail", ], parts => [ Email::MIME->create( 'attributes' => { 'content_type' => 'text/plain', 'charset' => 'US-ASCII', 'encoding' => '7bit', }, 'body' => "test", ), Email::MIME->create( 'attributes' => { 'fimename' => 'hoge.jpg', 'content_type' => 'image/jpeg', 'encoding' => 'base64', 'name' => 'sample.jpg', }, 'body' => 'JFIF(ry', ), ], ); # note $src->as_string; my $BODY = "NOT SET"; my $mail = Email::MIME->new($src->as_string); $mail->walk_parts(sub { my $part = shift; return if $part->parts > 1; # multipart if ($part->content_type =~ /plain/) { $BODY = $part->body_str; } }); is($BODY, 'test') or Dump($BODY); }; done_testing; __END__ not ok 1 # Failed test at t/99_get_text_newline.t line 47. # got: 'test # ' # expected: 'test' SV = PV(0x2176c10) at 0x20f03e0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK,UTF8) PV = 0x22e4730 "test\r\n"\0 [UTF8 "test\r\n"] CUR = 6 LEN = 16 1..1 # Looks like you failed 1 test of 1. not ok 1 - multi part # Failed test 'multi part' # at t/99_get_text_newline.t line 48. 1..1 # Looks like you failed 1 test of 1.
Sorry, I'm a bit confused. The message stringifies like this (in part): # --1376009518.A78A0.32925 # Date: Thu, 8 Aug 2013 20:51:58 -0400 # MIME-Version: 1.0 # Content-Type: text/plain; charset="US-ASCII" # Content-Transfer-Encoding: 7bit # # test # --1376009518.A78A0.32925 What would you have that contain, instead, since I believe there must be a line break before the part boundary? I think I am missing something obvious. :-( -- rjbs
Nevermind. It has been made clear by https://github.com/rjbs/Email-MIME/pull/4 This will be fixed in git very soon. -- rjbs