Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 42434
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: Nobody in particular
Requestors: thomas.jarosch [...] intra2net.com
Cc:
AdminCc:

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



Subject: append_file() is broken
Hello Mark, I just upgraded from Mail::IMAPClient 3.10 to 3.12. After that the append_file() function stopped working. Here's the output: IO::Handle: bad open mode: rb at /usr/lib/perl5/vendor_perl/5.10.0/Mail/IMAPClient.pm line 2390 If I change the open mode from "rb" to "r", it can read the message but the mail server will refuse it with "NO message contains bad header". Dowgrading to 3.11 works fine. Any idea what that could be? Cheers, Thomas
Subject: Re: [rt.cpan.org #42434] append_file() is broken
Date: Thu, 15 Jan 2009 12:13:44 +0100
To: Thomas Jarosch via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Thomas Jarosch via RT (bug-Mail-IMAPClient@rt.cpan.org) [090115 10:07]: Show quoted text
> Thu Jan 15 05:07:00 2009: Request 42434 was acted upon. > Transaction: Ticket created by thomasj > Queue: Mail-IMAPClient > Subject: append_file() is broken > Broken in: 3.12 > > Hello Mark, > I just upgraded from Mail::IMAPClient 3.10 to 3.12. After that the > append_file() function stopped working. Here's the output: > > IO::Handle: bad open mode: rb at > /usr/lib/perl5/vendor_perl/5.10.0/Mail/IMAPClient.pm line 2390
This should be a bug in IO::Handle. Anyway, I'll change that. Show quoted text
> If I change the open mode from "rb" to "r", it can read the message but > the mail server will refuse it with "NO message contains bad header". > Dowgrading to 3.11 works fine. > > Any idea what that could be?
It is a bad attempt of me to copy performance changes in append_message into append_file. I have made some changes. Chould you check these? (I have no opportunity to run IMAP myself) -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net

Message body is not shown because sender requested not to inline it.

From: thomas.jarosch [...] intra2net.com
On Do. 15. Jan. 2009, 06:14:43, solutions@overmeer.net wrote: Show quoted text
> It is a bad attempt of me to copy performance changes in
append_message Show quoted text
> into append_file. > > I have made some changes. Chould you check these? (I have no
opportunity Show quoted text
> to run IMAP myself)
Sorry, didn't work out, same error as far as I can tell. Attached is my test message and a tcpdump of the IMAP connection (no secrets in there :-)). Looks like the line endings get doubled?? Thomas
Download email.mbox
application/mbox 1.2k

Message body not shown because it is not plain text.

Download imap_connection.tcpdump
application/octet-stream 4.2k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #42434] append_file() is broken
Date: Fri, 16 Jan 2009 20:21:07 +0100
To: Thomas Jarosch via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Thomas Jarosch via RT (bug-Mail-IMAPClient@rt.cpan.org) [090115 13:48]: Show quoted text
> Queue: Mail-IMAPClient > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=42434 > > > On Do. 15. Jan. 2009, 06:14:43, solutions@overmeer.net wrote:
> > It is a bad attempt of me to copy performance changes in append_message > > into append_file.
> > Sorry, didn't work out, same error as far as I can tell. Attached is my > test message and a tcpdump of the IMAP connection (no secrets in there > :-)). Looks like the line endings get doubled??
O, o double negation on 2457: while($fh->sysread($buffer, APPEND_BUFFER_SIZE)) - { $buffer =~ s/(?<![^\r])\n/\r\n/g; + { $buffer =~ s/(?<!\r)\n/\r\n/g; Does it work at last? -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
On Fr. 16. Jan. 2009, 20:34:58, Mark@Overmeer.net wrote: Show quoted text
> > :-)). Looks like the line endings get doubled??
> > O, o double negation on 2457: > while($fh->sysread($buffer, APPEND_BUFFER_SIZE)) > - { $buffer =~ s/(?<![^\r])\n/\r\n/g; > + { $buffer =~ s/(?<!\r)\n/\r\n/g; > > Does it work at last?
Thanks for the patch! Unfortunately it didn't work out. Here's what I did: - perl-Mail-IMAPClient 3.13 as base version - Downloaded the HEAD version of IMAPClient.pm from this request - Applied the one line patch you provided above Now it hangs after the injection of one mail.
Subject: Re: [rt.cpan.org #42434] append_file() is broken
Date: Mon, 19 Jan 2009 16:38:55 +0100
To: Thomas Jarosch via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Thomas Jarosch via RT (bug-Mail-IMAPClient@rt.cpan.org) [090119 14:44]: Show quoted text
> Queue: Mail-IMAPClient > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=42434 > > > Thanks for the patch! Unfortunately it didn't work out. Here's what I > did:
grrrr... Show quoted text
> - perl-Mail-IMAPClient 3.13 as base version > - Downloaded the HEAD version of IMAPClient.pm from this request
What is the "HEAD" version? Show quoted text
> - Applied the one line patch you provided above > Now it hangs after the injection of one mail.
Please, can you at least attempt to debug it a little bit, for instance by adding a few print statements. As I said: I have no IMAP installation at hand, so it is impossible for me to see what is happening and why. You may include a debug trace. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
On Mo. 19. Jan. 2009, 10:39:14, solutions@overmeer.net wrote: Show quoted text
> > - perl-Mail-IMAPClient 3.13 as base version > > - Downloaded the HEAD version of IMAPClient.pm from this request
> > What is the "HEAD" version?
The version posted here in the bugtracker. It shows '3.14' as version number. Show quoted text
> > - Applied the one line patch you provided above > > Now it hangs after the injection of one mail.
> > Please, can you at least attempt to debug it a little bit, for
instance Show quoted text
> by adding a few print statements. As I said: I have no IMAP
installation Show quoted text
> at hand, so it is impossible for me to see what is happening and why. > You may include a debug trace.
I'll see what I can do, I'm currently distracted by an unplanned race condition in another software. Would it help if I provide you a temporary IMAP account? Cheers, Thomas
Subject: Re: [rt.cpan.org #42434] append_file() is broken
Date: Tue, 20 Jan 2009 13:12:16 +0100
To: Thomas Jarosch via RT <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Thomas Jarosch via RT (bug-Mail-IMAPClient@rt.cpan.org) [090120 09:35]: Show quoted text
> Queue: Mail-IMAPClient > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=42434 > > > On Mo. 19. Jan. 2009, 10:39:14, solutions@overmeer.net wrote:
> > What is the "HEAD" version?
> The version posted here in the bugtracker. It shows '3.14' as version > number.
ah. Show quoted text
> I'll see what I can do, I'm currently distracted by an unplanned race > condition in another software. Would it help if I provide you a > temporary IMAP account?
No, I have no time either. Far too many projects on my hands with close deadlines. -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
This method is still broken in 3.17 but I've got a patch that I'll release with 3.18 that should fix this. I close this once I release 3.18. If you get a chance to try out 3.18 when released and still see problems please let me know!
3.18 is released and append_file() should be working again. If you get a chance, please try things out and let us know if you run into any problems. Sorry for the delay in getting this fixed!
On Do. 04. Jun. 2009, 08:39:13, PLOBBES wrote: Show quoted text
> 3.18 is released and append_file() should be working again. If you
get Show quoted text
> a chance, please try things out and let us know if you run into any > problems. Sorry for the delay in getting this fixed!
Thanks for the update, Phil! Took me a while to find my bitcard login data ;-) Will test it "soonish" (the next two months).
Closing this as I added a new test case and verified it worked with that. If you find things don't work feel free to reopen with details otherwise we will assume all is good!