2003-09-04(木) (曇ときどき雨)のち晴 [長年日記]
_ mobileimap
mobileimap の ML にインストール後のトラブル(日本語で検索するとエラーが発生)という話題があったので、FreeBSD の ports ではどうなっているか気になり、対処してみました。対処法は Re: インストール後のトラブルのとおりで courier-imap の問題でした。参考サイト
調査
# cd /usr/ports/mail/courier-imap # make extract # cd work/courier-imap-2.1.1
README があるので読んでみました。
# less README
すると
Installing Please read INSTALL before installing or upgrading Courier-IMAP.
とあったので
# less INSTALL
として読み進めると中程に
INSTALLATION
To compile and install the Courier-IMAP server (this is the short
version, a longer version follows):
$ ./configure [ options, see below ]
$ make
$ make check # Note - the --enable-workarounds-for-imap-client-bugs
# option to configure will result in make check FAILING.
$ su root
# make install # Or, make install-strip, to strip the executables.
# make install-configure # Install configuration files.
# Start the authdaemond process
とあったのでさらに下を探しました。すると、
Foreign character set sorting/searching
The Courier-IMAP server can search and sort messages using other than
the default us-ascii/iso-8859-1 character set. You can find the list
of available character sets in the file unicode/charsetlist.txt.
The default is to include only the ISO-8859-1/US-ASCII character set.
Use the --enable-unicode option to include all available character
sets.
It is also possible to include translation tables only for selected
character sets. Example:
--enable-unicode=iso-8859-1,utf-8,iso-8859-10
Technically, IMAP servers must support the UTF-8 character set,
however few IMAP clients (I've yet to see one, actually) care about
UTF-8, so the UTF-8 character set is optional in Courier-IMAP. The
only required character set - which is always included, explicitly or
implicitly - is ISO-8859-1/US-ASCII.
Note that character set translation tables need substantial memory.
This should not be a problem in most cases. Most compilers will place
the read-only character set tables into a shared text segment, that's
shared by all running servers. --enable-unicode should not really be
much of a burden for most modern operating systems.
Attentive individuals will observe that all character set tables are
compiled even without the --enable-unicode option. That is normal --
only the explicitly selected character set tables will actually make
it into the final executable.
ということなので特に修正は要らないようです。もし修正するとすれば、先程の POP3/IMAPサーバ over SSL(Courier-IMAP)の構築を参考にして Makefile を修正すればよいでしょう。結果として
# diff -u Makefile.orig Makefile
--- Makefile.orig Mon Sep 1 23:51:03 2003
+++ Makefile Thu Sep 4 09:35:43 2003
@@ -65,7 +65,7 @@
--datadir=${DATADIR} \
--libexecdir=${LIBEXECDIR} \
--enable-workarounds-for-imap-client-bugs \
- --enable-unicode \
+ --enable-unicode=iso-2022-jp,iso-8859-1,utf-8 \
--disable-root-check \
--with-locking-method=fcntl
となるでしょう。ただ、[SM-USERS-JA:503] Re: courier-imap のコンパイルオプションによると検索速度があがるといった体感は得られないようです。
結論
FreeBSD の ports から courier-imap をインストールしていれば courier-imap がサポートする全ての文字コードで検索ができるはずです。RedHat Linux(おやじさん情報より)と Vine Linux(手元のマシンで確認済み)の rpm では spec file の修正が必要です。問題が起こるのは Linux ですね。
_ インターンシップ 14 日目
プログラムの作成が終わりテストをしてもらいました。あとはヴァージョン管理に登録するだけとなりました。質問の内容も答えを求めているのではなく、自分の不足する知識を補うためにしてくるようになってきたので成長したのではないでしょうか。
[ツッコミを入れる]