這是本文件的舊版!
將 Mail Server - IMAP 建立的中文目錄編碼轉回作法
透過 imapsync 移轉 Mail Server 過程, 發現一些使用中文所建立的目錄無法成功移轉, 又不好比對出是那些目錄, 所以找了一下可以如何將編碼轉回的方式.
- 在 imapsync 執行後的 LOG_imapsync 目錄內看到記錄檔最後有出現 Err Exp.
: : Homepage: http://imapsync.lamiral.info/ ++++ Listing 2 errors encountered during the sync ( avoid this listing with --noerrorsdump ). Err 1/2: Could not create folder [from ABC/&ZbBbomI2--DATA/INDIA/JonathanTest.] from [from ABC/&ZbBbomI2--DATA/INDIA/JonathanTest.]: 38252 NO [CANNOT] Character not allowed in mailbox name: '.' (0.001 + 0.000 secs). Err 2/2: Could not create folder [from ABC/&ZbBbomI2--DATA/Vietnam/TrysoftTest] from [from ABC/&ZbBbomI2--DATA/Vietnam/TrysoftTest]: 38949 NO [CANNOT] Character not allowed in mailbox name: '.' (0.001 + 0.000 secs). Exiting with return value 111 Log file is LOG_imapsync/2018_08_26_16_21_49_try.txt ( to change it, use --logfile filepath ; or use --nolog to turn off logging )
- 出現了兩個目錄異常
- [from ABC/&ZbBbomI2–DATA/INDIA/JonathanTest.]
- [from ABC/&ZbBbomI2–DATA/Vietnam/TrysoftTest]
CentOS 6 安裝 perl Unicode::IMAPUtf7 套件
yum install https://www.rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/perl-Unicode-IMAPUtf7-2.00-1.el6.rf.noarch.rpm
簡單寫個轉碼 perl 程式
root@ct-centos6 ~]# perl test.pl TrysoftTest [root@ct-centos6 ~]# </xtermrtf>