DebianにSquirrelmailの設定メモ

Apr 2005

SquirrelメールはWebメールです。postfix -->APOP --->SMTP Auth --->Courier-imap の順に設定し、
IMAPが稼働していることを前提にしたメモです。

関連 postfixメモ APOP設定メモ SMTP Auth設定メモ Courier-imap設定メモ
     DebianにSquirrelmailの設定メモ

1 インストール

www.squirrelmail.jpからダウンロードのページを見つけてダウンロードします。(debパッケージだとインストールした後の設定ファイルがみつからないので)今回はtarパッケージをダウンロードしました。
(squirrelmail-1.4.3-ja-20040531.tar.gzをダウンロード)
/tmpにsquirrelmail_1.4.2ja-1.tar.gzがあるとします。
# cd /var/www
# tar zxvf /tmp/squirrelmail-1.4.3-ja-20040531.tar.gz <---展開
# mv squirrelmail-1.4.3-ja webmail <----アクセスしやすい名前に変更
# cd webmail
# zcat /tmp/squirrelmail-1.4.3-ja-20040531-patch.gz | patch -p1  <----パッチを当てる
# cd po
# ./compilepo ja_JP <-----日本語対応にする(ここでエラーになったら下の※2)
# cd ../
# chmod 730 data/ <----dataディレクトリのパーミッション変更
# chown -R www-data:www-data data <----dataディレクトリのオーナ変更※1
※1上のオーナ www-data とはDebianのapacheの設定ファイル/etc/apache/httpd.confに
apacheの実行ユーザ/グループ権限が www-data という記述があるからです。
※2 もし「./compilepo: msgfmt: command not found」が出たらgettexをaptでインストールしてみる

/etc/apache/httpd.confの最後に次の内容を追加しておきます。/var/www/webmail/data/.htacessを有効にしてdataディレクトリが外部から見えないようにする設定です。
<Directory "/var/www/webmail">
  AllowOverride Limit
</Directory>

補足 php4がインストールされていなければapt-get install php4 でインストールしておきます。


2 設定
/var/www/webmail内にあるconfigureを使います。
# cd /var/www/webmail
# ./configure

つぎのメニューが表示されます。

SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books (LDAP)
7. Message of the Day (MOTD)
8. Plugins
9. Database

D. Set pre-defined settings for specific IMAP servers

C. Turn color on
S Save data
Q Quit

Command >> 1

設定メニューより
1. Organization Preferencesを選んで

Organization Name に何か組織の名前を書きます。
Default Language : ja_JP デフォルトの言語は普通ja_JPを設定します。


2. Server Settings
Domain : karappi.minidns.net ドメイン名を書きこみます。
Sendmail or SMTP : SMTP これはデフォルトのまま
SMTP Authentication
IMAP Settings
IMAP Server : karappi.minidns.net
Secure IMAP (TLS) : true
Server software : courier
SMTP Settings
SMTP Server : karappi.minidns.net
SMTP Authentication : cram-md5
Secure SMTP (TLS) : true
4. General Options
Default Charset : iso-2022-jp

8. Plugins
好みにあわせて設定。片っ端セットしてみよう。




3 apache-sslの設定

基本的には/etc/apache/httpd.conf と/etc/apache-ssl/httpd.confは同じにしました。

CGIの実行を許可しました。ほんとはIndexesを削除した方が安全です。これがあるとなぜならindex.htmlなどがないときファイルリストが表示されてしまいます。でもデバッグ上、稼働するまではあった方がいいと思います。

# Options Indexes Includes FollowSymLinks MultiViews
Options Indexes Includes FollowSymLinks MultiViews ExecCGI

#AddHandler cgi-script .cgi .sh .pl
AddHandler cgi-script .cgi .sh .pl

SSIを使うのでコメントをはずします。

#LoadModule includes_module /usr/lib/apache/1.3/mod_include.so
LoadModule includes_module /usr/lib/apache/1.3/mod_include.so


#AddType text/html .shtml
#AddHandler server-parsed .shtml
AddType text/html .shtml
AddHandler server-parsed .shtml


phpが動くようにします。
# LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so

index.phpも動くようにします。
<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.php woody.shtml index.cgi
</IfModule>



文字化けしないようにします。
# AddDefaultCharset on
AddDefaultCharset off

/etc/apache-ssl/httpd.confの最後にもこれを追加しておきます。
<Directory "/var/www/webmail">
AllowOverride Limit
</Directory>

4 再起動
# /etc/init.d/apache restart
# /etc/init.d/apache-ssl restart

5 Webmailへのアクセス
安全のためhttps://を使ってアクセスします。

アドレスは
https://ドメイン/webmail/


目次 top

アンケートにお答え下さい.
このページについて とても参考になった。
すこし参考になった。
参考にならなかった。