Last Update: "2007/08/17 20:55:37 makoto"

squirrelmail

これを使うと imap サーバを Web から見えるように出来ます。 次のものが必要です。

url

本家(日本語)
http://www.squirrelmail.jp/
Postfixで Cyrus IMAP + SquirrelMail(WebMail)
http://www.g-ninja.net/freebsd/squirrelmail.html

設置と設定

mail/squirellmail の options.mk を見ると、最近 (2007/05 以降)は
PKG_OPTIONS.squirrelmail =  squirrelmail-japanese
PKG_OPTIONS.squirrelmail += squirrelmail-lite
等の指定をして mail/squirrelmail で make package をするようになっています。 以下の記述はそれに合わせて更新する前のものです。
cd /usr/pkgsrc/mail/ja-squirrelmail sudo make package
とした後に、httpd.conf で
 DocumentRoot  /usr/pkg/share/squirrelmail
とすれば使えるようになります。 実際には、 何点か変更が必要です。

pkg_info -D

sudo make package 時や pkg_info -D の時に表示される内容
=> Please note the following:
$NetBSD: MESSAGE,v 1.5 2005/07/20 15:42:34 taca Exp $

Please run the SquirrelMail configuration script:

        cd /usr/pkg/share/squirrelmail/config && ./conf.pl

to customize the SquirrelMail webmail system for your site.

You will need to make SquirrelMail accessible through your HTTP server.
If you are running Apache and ap-php, then you may either symlink

        /usr/pkg/share/squirrelmail

into DocumentRoot, or add the following line to httpd.conf:

        Include /usr/pkg/etc/httpd/squirrelmail.conf

to make IMAP accounts accessible through:

        http://www.example.com/squirrelmail/
=> Registering installation for squirrelmail-1.4.10anb2
squirrelmail-1.4.10anb2 requires installed package perl-5.8.8nb4
squirrelmail-1.4.10anb2 requires installed package php4-gettext-4.4.7
===> Building binary package for squirrelmail-1.4.10anb2
Creating package /export/pkgsrc/packages/All/squirrelmail-1.4.10anb2.tgz
Using SrcDir value of /usr/pkg
Registering conflicts: sq-attachment-handlers-[0-9]* sq-squirrelspell-[0-9]* ja-squirrelspell-[0-9]* ja-squirrelmail-[0-9]*.
ttyp0:makoto@s900 23:19:17/070815(...mail/squirrelmail)> 
conf.pl は root 権限で実行する必要があります。
conf.pl を実行した時の表示
00 Main | 01 Org | 02 Server | 03 Folder | 04 General | 05 Themes | 06 Addr Book
| 07 Motd | 08 Plugins | 09 DataBase | 10 Languages | 11 (09 ->11) | D | /
Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!

apache

開始画面例

文字符号

日本語化以前の mail/squirrelmail を使うと、文字が化けてしまいます。

以下の設定は、日本語化以前の時のものなので、あてになりません。 調べて修正予定です。

--- /usr/pkg/share/squirrelmail/config/config.php-dist  2006-12-16 23:40:58.000000000 +0900
+++ /usr/pkg/share/squirrelmail/config/config.php       2006-12-16 23:45:02.000000000 +0900
@@ -947,7 +947,7 @@
  * symbol and country code
  * @global string $squirrelmail_default_language
  */
-$squirrelmail_default_language = 'en_US';
+$squirrelmail_default_language = 'ja_JP';
 
 /**
  * Default Charset
@@ -962,7 +962,7 @@
  *
  * @global string $default_charset
  */
-$default_charset = 'iso-8859-1';
+$default_charset = 'iso-2022-jp';
 
 /**
  * Lossy Encoding Control
ttyp0:makoto@st4200 23:46:07/061216(...mail/ja-squirrelmail)> 

課題

問題

実は 2006/08/01 頃設定して動作を確認したのですが、 2006/08/16 に確認したところ
                 ERROR
Unknown user or password incorrect.
       Go to the login page
と言われるようになってしまいました。
ttyp2:makoto@hostname 8:09:03/060817(~)> sudo saslpasswd2 cyrus
Password:
Password: 
Again (for verification): 
ttyp2:makoto@hostname 8:09:56/060817(~)> 
とやると、次のような字が console に表示されます。
Aug 17 08:09:56 hostname saslpasswd2: setpass succeeded for cyrus
Aug 17 08:09:56 hostname saslpasswd2: Couldn't update db
ここで db と言っているのは、次のものです。
ttyp2:makoto@hostname 8:10:31/060817(~)> ls -l /usr/pkg/etc/sasldb.db -rw------- 1 root wheel 16384 Aug 17 08:09 /usr/pkg/etc/sasldb.db
実は、これは、次のようにして中を読めます
sudo makedbm -u /usr/pkg/etc/sasldb.db
また前の日にいろいろ試した時には次のような字も見えました
Aug 16 20:01:53 hostname sasldblistusers2: Could not open db
Aug 16 20:01:53 hostname sasldblistusers2: _sasldb_getkeyhandle has failed