UTF7 mailbox codification error

Manel Gimeno Zaragozá magiza83 at hotmail.com
Tue Feb 28 10:33:07 EST 2012


Hello,

any news about this "issue"? The only way it works in my environment is "delete" the lines tan set_unicode_folders in IMAPTalk source code.

Thanks!

Manel Gimeno Zaragoza
magiza83 at hotmail.com


From: magiza83 at hotmail.com
To: robm at fastmail.fm; info-cyrus at lists.andrew.cmu.edu
Subject: RE: UTF7 mailbox codification error
Date: Fri, 24 Feb 2012 09:09:01 +0100
CC: rjlov at fastmail.fm







Hello,

I've made some test trying to check all cases and the results are:

Case 1:
    set unicode folder : 1
    folder name: user.gdatmgim.SPAM (without any strange character)
    tcpflow: 
        ...
        192.168.066.093.46301-192.168.066.092.00143: 2 select "user.gdatmgim.SPAM"

        192.168.066.092.00143-192.168.066.093.46301: * 0 EXISTS
        ...
    Internal exit: OK
    Console Exit: OK
    
Case 2:
    set unicode folder : 0
    folder name: user.gdatmgim.SPAM (without any strange character)
    tcpflow:
        ...
        192.168.066.093.46287-192.168.066.092.00143: 2 select "user.gdatmgim.SPAM"

        192.168.066.092.00143-192.168.066.093.46287: * 0 EXISTS
        ...
    Internal exit: OK
    Console Exit: NOK
        Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3859, <$_[...]> line 1.
        Warning only: IMAPTalk not using unicode_folders at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3860
                Mail::IMAPTalk::_fix_folder_name('Mail::IMAPTalk=HASH(0x238a3b0)', 'user.gdatmgim.SPAM') called at /usr/local/share/perl5/Mail/IMAPTalk.pm line 1168
                Mail::IMAPTalk::select('Mail::IMAPTalk=HASH(0x238a3b0)', 'user.gdatmgim.SPAM') called at ./test.pl line 105
                main::Get_Fetch('user.gdatmgim.SPAM') called at ./test.pl line 86
        Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3861, <$_[...]> line 1.
        Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3859, <$_[...]> line 1.
        Warning only: IMAPTalk not using unicode_folders at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3860
                Mail::IMAPTalk::_fix_folder_name('Mail::IMAPTalk=HASH(0x257eee0)', 'user.gdatmgim.SPAM') called at /usr/local/share/perl5/Mail/IMAPTalk.pm line 1168
                Mail::IMAPTalk::select('Mail::IMAPTalk=HASH(0x257eee0)', 'user.gdatmgim.SPAM') called at ./test.pl line 106
                main::Get_Fetch('user.gdatmgim.SPAM') called at ./test.pl line 86
        Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3861, <$_[...]> line 1.

    
Case 3:
    set unicode folder : 1
    folder name: user.dataaper.Comunicaci&APM-n Interna (with "&" character)
    tcpflow:
        ...
        192.168.066.093.46290-192.168.066.092.00143: 2 select "user.dataaper.Comunicaci&-APM-n Interna"

        192.168.066.092.00143-192.168.066.093.46290: 2 NO Mailbox does not exist
        ...
    exit: NOK
        Uncaught exception from user code:
        IMAP error: Select failed for folder 'user.dataaper.Comunicaci&APM-n Interna' : IMAP Command : 'select' failed. Response was : no - Mailbox does not exist at ./test.pl line 105, <$_[...]> line 1.
                    at ./test.pl line 105
        main::Get_Fetch('user.dataaper.Comunicaci&APM-n Interna') called at ./test.pl line 86

Case 4:
    set unicode folder : 0
    folder name: user.dataaper.Comunicaci&APM-n Interna (with "&" character)
    tcpflow:
        ...
        192.168.066.093.46292-192.168.066.092.00143: 2 select "user.dataaper.Comunicaci&APM-n Interna"

        192.168.066.092.00143-192.168.066.093.46292: * 0 EXISTS
        ...
    exit: NOK
        Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3859, <$_[...]> line 1.
        Warning only: IMAPTalk not using unicode_folders at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3860
                Mail::IMAPTalk::_fix_folder_name('Mail::IMAPTalk=HASH(0x16713b0)', 'user.dataaper.Comunicaci&APM-n Interna') called at /usr/local/share/perl5/Mail/IMAPTalk.pm line 1168
                Mail::IMAPTalk::select('Mail::IMAPTalk=HASH(0x16713b0)', 'user.dataaper.Comunicaci&APM-n Interna') called at ./test.pl line 105
                main::Get_Fetch('user.dataaper.Comunicaci&APM-n Interna') called at ./test.pl line 86
        Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3861, <$_[...]> line 1.
        Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3859, <$_[...]> line 1.
        Warning only: IMAPTalk not using unicode_folders at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3860
                Mail::IMAPTalk::_fix_folder_name('Mail::IMAPTalk=HASH(0x1865ee0)', 'user.dataaper.Comunicaci&APM-n Interna') called at /usr/local/share/perl5/Mail/IMAPTalk.pm line 1168
                Mail::IMAPTalk::select('Mail::IMAPTalk=HASH(0x1865ee0)', 'user.dataaper.Comunicaci&APM-n Interna') called at ./test.pl line 106
                main::Get_Fetch('user.dataaper.Comunicaci&APM-n Interna') called at ./test.pl line 86
        Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3861, <$_[...]> line 1.

Case 1 OK

Case 2, it fails because set unicode folder is turned off.
        
Case 3, we can see that once the folder name is passed to the method it change the name and add a "-" after the "&". Thats why the folder does not exist.
        
Case 4, looks like is the correct way to do it, as when I turn off "unicode_folders" folder name is not modified and internally It works OK, but I get the exception or error that you can see (the same that in case 2)

It looks like set unicode folder has be turned on.

On the other hand, I've installed IMAPTalk from "cpan" and I have 2.01 version.
#perldoc perllocal
PERLLOCAL(1)          User Contributed Perl Documentation         PERLLOCAL(1)

   Thu Feb 23 19:38:12 2012: "Module" Mail::IMAPTalk
       ·   "installed into: /usr/local/share/perl5"

       ·   "LINKTYPE: dynamic"

       ·   "VERSION: 2.01"

       ·   "EXE_FILES: "

I guess is the same version that you named on the mail, am I right? or I should install other version.

Sorry if my english is not quite correct.

Thanks & Regards.

Manel Gimeno Zaragoza
magiza83 at hotmail.com


> From: robm at fastmail.fm
> To: magiza83 at hotmail.com; info-cyrus at lists.andrew.cmu.edu
> CC: rjlov at fastmail.fm
> Subject: Re: UTF7 mailbox codification error
> Date: Fri, 24 Feb 2012 09:48:02 +1100
> 
> 
> > $IMAPs1->set_unicode_folders(1);
> > $IMAPs2->set_unicode_folders(1);
> ...
> > How can I avoid this error? Or force that the method do not "convert" the
> > strings.
> 
> You explicitly said you want unicode folder support, but then explicitly
> pass IMAP UTF-7 folder names rather than a perl unicode string.
> 
> So just don't turn on unicode folders. eg
> 
>  $IMAPs1->set_unicode_folders(0);
>  $IMAPs2->set_unicode_folders(0);
> 
> And I think you should be fine. I can't guarantee that, because we don't
> use that mode any more. If it's still broken, let me know, I'll fix the
> code and put it on https://github.com/robmueller/mail-imaptalk/
> 
> Rob
 		 	   		  

----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/ 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20120228/3613efd4/attachment-0001.html 


More information about the Info-cyrus mailing list