Squirrelmail 1.4.8 からupdateする。
portsを使っているので portupgrade squirrelmail でOK。
その後、日本語向けのパッチを当てる。
Squirrelmail 1.4.8 からupdateする。
portsを使っているので portupgrade squirrelmail でOK。
その後、日本語向けのパッチを当てる。
# cd /usr/local/www/squirrelmail/class/deliver # diff Deliver.class.php.org Deliver.class.php 400,405c400,406 < if (isset($encode_header_key) && trim($encode_header_key)!='') { < // use encrypted form of remote address < $message_id.= OneTimePadEncrypt($this->ip2hex($REMOTE_ADDR),base64_encode($encode_header_key)); < } else { < $message_id.= $REMOTE_ADDR; < } --- > // if (isset($encode_header_key) && trim($encode_header_key)!='') { > // // use encrypted form of remote address > // $message_id.= OneTimePadEncrypt($this->ip2hex($REMOTE_ADDR),base64_encode($encode_header_key)); > // } else { > // $message_id.= $REMOTE_ADDR; > // } > $message_id.= 'ほげほげ(IPアドレス)'; 418a420 > $received_from = "ほげほげ(IPアドレス)";
これで発信したメールヘッダはこんな感じになります。
Received: from www.ほげほげドメイン (localhost.ほげほげドメイン [127.0.0.1]) by ほげほげドメイン (Postfix) with ESMTP id 50F9B5066FF for < 宛先メールアドレス>; Thu, 21 Dec 2006 13:47:53 +0900 (JST) Received: from ほげほげ(IPアドレス) (SquirrelMail authenticated user hogehoge) by ほげほげドメイン with HTTP; Thu, 21 Dec 2006 13:47:53 +0900 (JST) Message-ID: &lt;2933.ほげほげ(IPアドレス).1166676473.squirrel@www.ほげほげドメイン>
以前は/user/ports/japanese/に日本語版が置いてあったが今はここのみに置いてあるみたい。
日本語版本家では1.4.5で止まっているけど、portsのは1.4.8。とりあえずportsで入れてみる。
# cd /usr/ports/mail/squirrelmail # portinstall
その後、/usr/local/www/squirrelmailに降りて、
# cd /usr/local/www/squirrelmail # ./configure
で各種設定を行う。
日本語を使うなら、 メニュー10番目のLanguageの所を
Language preferences 1. Default Language : ja_JP 2. Default Charset : iso-2022-jp 3. Enable lossy encoding : false
でOK。あと、メニュー2番目のServer SettingsでIMAPサーバーを選択すれば使えるようになります。ウチはuw IMAPなのでこんな感じ。
IMAP Settings -------------- 4. IMAP Server : localhost 5. IMAP Port : 143 6. Authentication type : cram-md5 7. Secure IMAP (TLS) : false 8. Server software : uw 9. Delimiter : detect
あとは、適当に好みで。
apacheの設定は、SSLで使いたかったのでIncludesに置いたhttpd-ssl.confに下記を追記。
<code>Alias /webmail "/usr/local/www/squirrelmail"</code> AllowOverride All Options FollowSymLinks ExecCGI Includes Allow from All
これで https://wwwほげほげ/webmail で使えるようになる。
ところが、 返信とかすると下記のようなウォーニングが。
Warning: preg_split() expects parameter 4 to be long, string given in /usr/local/www/squirrelmail/functions/imap_messages.php on line 808Warning: Invalid argument supplied for foreach() in/usr/local/www/squirrelmail/functions/mime.php on line 52
ぐぐってみたらパッチ発見。
http://www.hmailserver.com/forum/viewtopic….
http://sourceforge.net/tracker/index.php?func=detail&aid=1543573…..
# diff imap_messages.php.org imap_ messages.php 808c808 < $flags = preg_split('/ /', $regs[1],-1,'PREG_SPLIT_NI_EMPTY'); --- > $flags = preg_split('/ /', $regs[1],-1,PREG_SPLIT_NO_EMPTY);
これで解決。