Comments (1)
Dear Pavel,
You're definitively right. This 10 years old bug is also mentioned at:
https://rt.cpan.org/Public/Bug/Display.html?id=11172
which seem to have led to writing a new one
http://search.cpan.org/~pmakholm/Encode-IMAPUTF7-1.05/lib/Encode/IMAPUTF7.pm
The fix is easy, remove the two lines containing PLUSPLACEHOLDER
Copied from http://cpansearch.perl.org/src/FABPOT/Unicode-IMAPUtf7-2.01/lib/Unicode/IMAPUtf7.pm
and then fixed with
https://rt.cpan.org/Public/Bug/Display.html?id=11172
sub imap_utf7_decode {
my ( $s ) = shift( @_ ) ;
# Algorithm
# On remplace , par / dans les BASE 64 (, entre & et -)
# On remplace les &, non suivi d'un - par +
# On remplace les &- par &
$s =~ s/&([^,&\-]*),([^,\-&]*)\-/&$1\/$2\-/g ;
$s =~ s/&(?!\-)/\+/g ;
$s =~ s/&\-/&/g ;
return( Unicode::String::utf7( $s )->utf8 ) ;
}
This bugfix will be applied in next public release.
Le 17/01/2015 12:13, Pavel Alexeev aka Pahan-Hubbitus a écrit :
Firstly there bug and you by some reason exclude + sign from utf7 string which leads to its mangle. For example in Russian language word project is "проект" what in UTF7-IMAP encoding represent as "&BB8EQAQ+BDUEOgRC-" but imapsync decode it as "ПроBDUEOgRC-"
I have breaffy look at code and by some reason you are especially leave + sign in imap_utf7_decode routine:
sub imap_utf7_decode {
$s =~s/+/PLUSPLACEHOLDER/g ;
$s =~s/&([^,&-]),([^,-&])-/&$1/$2-/g ;
$s =~s/&(?!-)/+/g ;
$s =~s/&-/&/g ;
$s =~s/PLUSPLACEHOLDER/+-/g ;return( Unicode::String::utf7($s )->utf8 ) ;
}
Additionally I want mention, despite /some/ folder names decoded, in many place except folders list it present as is, for example:
|Excluding folders matching pattern 'BAK_test/Ant/INBOX': [BAK_test/Ant/INBOX/&BB8EQAQ+BDEEOwQ1BDwESw- &BD8EPg- &BD4EQgRHBFEEQgQwBDw- &BEEEQAQwBDIEPQQ1BD0EOARP-] [BAK_test/Ant/INBOX/TODO] [BAK_test/
Ant/INBOX/TODO-ANSWER] [BAK_test/Ant/INBOX/TODO/Answer - &BCEEPgQxBD4EOwQ1BDI-]
…
|—
Reply to this email directly or view it on GitHub #23.
Au revoir, 09 51 84 42 42
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06
from imapsync.
Related Issues (20)
- Error with Google Tokens HOT 14
- sync to many subfolder HOT 9
- NO [CANNOT] APPEND Contains Deleted flag HOT 4
- Question: Deleting what was not synced only from host1 HOT 2
- parsing headers of folder It can take time for huge folders. Be patient. HOT 12
- Changelog version 2.269 HOT 8
- identify the message HOT 1
- delete2folders does not delete folders that are excluded, because they are present on host1 HOT 4
- Zimbra and "NO LIST failed" was:Folder at the same level than INBOX HOT 11
- Mac version after 2.200 not working with error "Attempt to reload DynaLoader.pm aborted." HOT 6
- Docker: Internal server error HOT 6
- Question: Is there a better way to do unit test HOT 10
- Imapsync webserver and Debian 12 HOT 1
- could not be fetched: socket closed while reading data from server (4x) The most frequent error is ERR_Host1_FETCH. HOT 3
- After losing network connection, imapsync appears to not be able to sync ~2000 missed emails. HOT 3
- imapsync parallel command HOT 5
- mapsync Ended by a signal TERM HOT 1
- Handling slashes "/" in folder names HOT 6
- Install on M1 via brew HOT 1
- Syncing Imap Sync from Imap account to Mail Plus ? HOT 24
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imapsync.