<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hello,<br><br>As I been explaining in the <span class="clickable"><span class="q">thread</span> "Problem recover replica" </span>that I'm trying to use Mail::IMAPTalk perl module to fetch some data. I've write this new thread because I get an error when I try to execute the following code:<br><i>...<br>...<br>...<br>my $IMAPs1 = Mail::IMAPTalk->new(<br> Server => $master,<br> Port => 143,<br> Username => $username,<br> Password => $password,<br> Uid => 1,<br>);<br><br>my $IMAPs2 = Mail::IMAPTalk->new(<br> Server => $slave,<br> Port => 143,<br> Username => $username,<br> Password => $password,<br> Uid => 1,<br>);<br><br>$IMAPs1->set_unicode_folders(1);<br>$IMAPs2->set_unicode_folders(1);<br><br>sub Get_Fetch(){<br> $IMAPs1->select("$_[0]") || die "IMAP error: $@";<br> $IMAPs2->select("$_[0]") || die "IMAP error: $@";<br><br> my $s1sha1 = $IMAPs1->fetch('1:*', 'digest.sha1') || die "IMAP error: $@";<br> my $s2sha1 = $IMAPs2->fetch('1:*', 'digest.sha1') || die "IMAP error: $@";<br><br> my $exit_sha1 = &compare($s1sha1,$s2sha1,"sha1");<br> if ($exit_sha1 eq 1){<br> &print_result($s1sha1,$s2sha1);<br> print "ERROR: sha1 buzon $_[0]\n";<br> return $exit_sha1;<br> }<br>}<br>...<br>...<br>...</i><br><br>I get the following error:<br><i>Uncaught exception from user code:<br> IMAP error: Select failed for folder '<b>user.dataaper.Comunicaci&APM-n Interna</b>' : IMAP Command : 'select' failed. Response was : no - Mailbox does not exist at ./test.pl line 105, <$_[...]> line 5.<br> at ./test.pl line 105<br> main::Get_Fetch('user.dataaper.Comunicaci&APM-n Interna') called at ./test.pl line 86</i><br><br>The problem is when I try to select the "bold folder" I get that it does not exist, but I it does! I've capture the traffic with tcpflow and I see the following:<br><i>...<br>...<br>192.168.066.093.46078-192.168.066.092.00143: 34 select "<b>user.dataaper.Comunicaci&-APM-n Interna</b>"<br><br>192.168.066.092.00143-192.168.066.093.46078: * OK [CLOSED] Ok<br>34 NO Mailbox does not exist<br>...<br>...</i><br><br>As you can see the method "select" sends a wrong "folder" <i>"<b>user.dataaper.Comunicaci&-APM-n Interna</b>". </i>It puts a "-" after "&" and because of that it fails!<br><br>If I comment the lines "set_unicode_folders", I get the following error:<br><i>Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3859, <$_[...]> line 5.<br>Warning only: IMAPTalk not using unicode_folders at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3860<br> Mail::IMAPTalk::_fix_folder_name('Mail::IMAPTalk=HASH(0x1e1bee0)', 'user.dataaper.Comunicaci&APM-n Interna') called at /usr/local/share/perl5/Mail/IMAPTalk.pm line 1517<br> Mail::IMAPTalk::getquota('Mail::IMAPTalk=HASH(0x1e1bee0)', 'user.dataaper.Comunicaci&APM-n Interna') called at ./test.pl line 127<br> main::Get_Quota('user.dataaper.Comunicaci&APM-n Interna') called at ./test.pl line 87<br>Please report to rjlov at /usr/local/share/perl5/Mail/IMAPTalk.pm line 3861, <$_[...]> line 5.<br></i><br>I've try to comment the part of the code on IMAPTalk.pm that make the codification conversion, and it works ok if "set_unicode_folfer" lines are not present. But I'm not sure If i can get worst problems in the future about that.<br><i>...<br>...<br># if ( $Self->unicode_folders()<br></i><i>#</i><i> && ( $FolderName =~ m{[^\x00-\x25\x27-\x7f]} ) )<br></i><i>#</i><i> {<br></i><i>#</i><i> $FolderName = Encode::encode( 'IMAP-UTF-7', $FolderName );<br></i><i>#</i><i> }<br><br></i><i>#</i><i> if (! $Self->unicode_folders() ) {<br></i><i>#</i><i> warn("Please report to rjlov");<br></i><i>#</i><i> Carp::cluck("Warning only: IMAPTalk not using unicode_folders");<br></i><i>#</i><i> warn("Please report to rjlov");<br></i><i>#</i><i> }<br>...<br>...</i><br># if ( $Self->unicode_folders()<br># && ( $FolderName =~ m{&} ) )<br># {<br># $FolderName = Encode::decode( 'IMAP-UTF-7', $FolderName );<br># }<br><br># if (! $Self->unicode_folders() ) {<br># warn("Please report to rjlov");<br># Carp::cluck("Warning only: IMAPTalk not using unicode_folders");<br># warn("Please report to rjlov");<br># }<br><br><br>How can I avoid this error? Or force that the method do not "convert" the strings.<br><br>Thanks & Regards.<br><br>Manel Gimeno Zaragoza<br>magiza83@hotmail.com<br>                                            </div></body>
</html>