トップページ >玄箱> 玄箱にSquirrelMailを導入
« 迷惑メールは続くよ何時までも?(BlogPet) | トップページ | イイものはイイんですよ »
2005/02/06
玄箱にSquirrelMailを導入
SquirrelMail!
何て読むんでしょうか?読み方も分かりませんが、導入してみます。
これで玄箱にWebmailの環境ができあがります。
今回、主に参考にしたのは下記のサイト様です。いつもながら感謝!
以下、簡単な作業記録です。
ちょっとハマリましたが、何とか使える形にはなりました。
1. SquirrelMailの導入 $ sudo apt-get install squirrelmail ← いつものようにapt-getでインストールします 特に問題はありません。2. SquirrelMailの初期設定
$ sudo /usr/sbin/squirrelmail-configure ← 初期設定のためのスクリプトを実行します。
今回導入したのはV1.4.4なのですが、ネット上のお手本サイトとは若干メニュー構成が異なっていました。まあでも、何とかなるものです。多分見にくいでしょうが、画面イメージを貼り付けます。
↓↓↓SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. LanguagesD. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q QuitCommand >> 10 ← とりあえず言語設定を……
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : en_US
2. Default Charset : iso-8859-1
3. Enable lossy encoding : falseR Return to Main Menu
C Turn color on
S Save data
Q QuitCommand >> 1 ← Default Languageを選択
↓↓↓
SquirrelMail attempts to set the language in many ways. If it
can not figure it out in another way, it will default to this
language. Please use the code for the desired language.[en_US]: ja_JP ← もちろん日本語を希望します
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : ja_JP
2. Default Charset : iso-8859-1
3. Enable lossy encoding : falseR Return to Main Menu
C Turn color on
S Save data
Q QuitCommand >>2 ← 次にDefault Charsetを選択
↓↓↓
This option controls what character set is used when sending
mail and when sending HTML to the browser.This option is used only when default language is 'en_US'.
[iso-8859-1]: iso-2022-jp ← iso-2022-jpを設定
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : ja_JP
2. Default Charset : iso-2022-jp
3. Enable lossy encoding : falseR Return to Main Menu
C Turn color on
S Save data
Q QuitCommand >> r ← メインメニューに戻ります
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. LanguagesD. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q QuitCommand >> 2 ← 次は、サーバ設定を……
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server SettingsGeneral
-------
1. Domain : trim(implode('', file('/etc/'.(file_exists('/etc/mailname')?'mail':'hos
t').'name')))
2. Invert Time : false
3. Sendmail or SMTP : SMTPA. Update IMAP Settings : localhost:143 (other)
B. Update SMTP Settings : localhost:25R Return to Main Menu
C Turn color on
S Save data
Q QuitCommand >> a ← Update IMAP Settingsを選択
#Domainの設定とかは変更しなくても大丈夫なようです(たぶん)↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server SettingsGeneral
-------
1. Domain : trim(implode('', file('/etc/'.(file_exists('/etc/mailname')?'mail':'hos
t').'name')))
2. Invert Time : false
3. Sendmail or SMTP : SMTPIMAP Settings
--------------
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : other
9. Delimiter : detectB. Update SMTP Settings : localhost:25
H. Hide IMAP Server SettingsR Return to Main Menu
C Turn color on
S Save data
Q QuitCommand >> 8 ← IMAPのサーバソフトを指定します
↓↓↓
Each IMAP server has its own quirks. As much as we tried to stick
to standards, it doesn't help much if the IMAP server doesn't follow
the same principles. We have made some work-arounds for some of
these servers. If you would like to use them, please select your
IMAP server. If you do not wish to use these work-arounds, you can
set this to "other", and none will be used.
cyrus = Cyrus IMAP server
uw = University of Washington's IMAP server
exchange = Microsoft Exchange IMAP server
courier = Courier IMAP server
macosx = Mac OS X Mailserver
hmailserver = hMailServer
other = Not one of the above servers
[other]: courier ← 私の場合は、Courier IMAPです↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server SettingsGeneral
-------
1. Domain : trim(implode('', file('/etc/'.(file_exists('/etc/mailname')?'mail':'hos
t').'name')))
2. Invert Time : false
3. Sendmail or SMTP : SMTPIMAP Settings
--------------
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : courier
9. Delimiter : detectB. Update SMTP Settings : localhost:25
H. Hide IMAP Server SettingsR Return to Main Menu
C Turn color on
S Save data
Q QuitCommand >> r ← メインメニューに戻ります
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. LanguagesD. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q QuitCommand >> 4 ← General Optionsを選択
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1. Data Directory : /var/lib/squirrelmail/data/
2. Attachment Directory : /var/spool/squirrelmail/attach/
3. Directory Hash Level : 0
4. Default Left Size : 150
5. Usernames in Lowercase : false
6. Allow use of priority : true
7. Hide SM attributions : false
8. Allow use of receipts : true
9. Allow editing of identity : true/true
10. Allow server thread sort : false
11. Allow server-side sorting : false
12. Allow server charset search : true
13. Enable UID support : true
14. PHP session name : SQMSESSIDR Return to Main Menu
C Turn color on
S Save data
Q QuitCommand >> 1 ← データディレクトリの場所を変更します
↓↓↓
Specify the location for your data directory.
The path name can be absolute or relative (to the config directory).
It doesn't matter. Here are two examples:
Absolute: /var/lib/squirrelmail/data/
Relative: ../data/
Relative paths to directories outside of the SquirrelMail distribution
will be converted to their absolute path equivalents in config.php.Note: There are potential security risks with having a writable directory
under the web server's root directory (ex: /home/httpd/html).
For this reason, it is recommended to put the data directory
in an alternate location of your choice.[/var/lib/squirrelmail/data/]: /var/www/webmail/data/ ← 注意事項が表示されますが、私は/var/www/webmail/data/にしました
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1. Data Directory : /var/www/webmail/data/
2. Attachment Directory : /var/spool/squirrelmail/attach/
3. Directory Hash Level : 0
4. Default Left Size : 150
5. Usernames in Lowercase : false
6. Allow use of priority : true
7. Hide SM attributions : false
8. Allow use of receipts : true
9. Allow editing of identity : true/true
10. Allow server thread sort : false
11. Allow server-side sorting : false
12. Allow server charset search : true
13. Enable UID support : true
14. PHP session name : SQMSESSIDR Return to Main Menu
C Turn color on
S Save data
Q QuitCommand >> 2 ← アタッチ(添付ファイルの事でしょう)ディレクトリの場所を変更します
Path to directory used for storing attachments while a mail is
being sent. The path name can be absolute or relative (to the config directory).
It doesn't matter. Here are two examples:
Absolute: /var/spool/squirrelmail/attach/
Relative: ../attach/
Relative paths to directories outside of the SquirrelMail distribution
will be converted to their absolute path equivalents in config.php.Note: There are a few security considerations regarding this
directory:
1. It should have the permission 733 (rwx-wx-wx) to make it
impossible for a random person with access to the webserver
to list files in this directory. Confidential data might
be laying around in there.
Depending on your user:group assignments, 730 (rwx-wx---)
may be possible, and more secure (e.g. root:apache)
2. Since the webserver is not able to list the files in the
content is also impossible for the webserver to delete files
lying around there for too long.
3. It should probably be another directory than the data
directory specified in option 3.[/var/spool/squirrelmail/attach/]: /var/www/webmail/attach/ ← こっちも注意事項が表示されますが、私は/var/www/webmail/attach/にしました
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1. Data Directory : /var/www/webmail/data/
2. Attachment Directory : /var/www/webmail/attach/
3. Directory Hash Level : 0
4. Default Left Size : 150
5. Usernames in Lowercase : false
6. Allow use of priority : true
7. Hide SM attributions : false
8. Allow use of receipts : true
9. Allow editing of identity : true/true
10. Allow server thread sort : false
11. Allow server-side sorting : false
12. Allow server charset search : true
13. Enable UID support : true
14. PHP session name : SQMSESSIDR Return to Main Menu
C Turn color on
S Save data
Q QuitCommand >> r ← メインメニューに戻ります
↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. LanguagesD. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q QuitCommand >> s ← セーブして……
Data saved in config.php
Press enter to continue... ENTER ← ENTERキーを押します↓↓↓
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. LanguagesD. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q QuitCommand >> q ← 終了です……
Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!http://your-squirrelmail-location/src/configtest.phpにアクセスして確認しろ!と出ますが、それは後ほど……
Squirrelmailの導入・初期設定は出来ましたが、Apache2等の設定をもう少し行います。
3. フォルダの設定
$ su - ← rootで作業します
# cd /var/www ← Apache2のドキュメントルートディレクトリに移動します
# mkdir webmail ← webmail用のディレクトリを作成します
# mkdir webmail/data webmail/attach ← dataディレクトリとattachディレクトリを作成します
# chown -R www-data.www-data webmail ← ディレクトリのオーナーを”www-data”にします(私のdebianの場合)
# chmod -R 730 webmail ← パーミッションを”rwx-wx---”に変更します4. Apache2の設定
# cd /etc/apache2/sites-available/ ← Apache2の設定ファイルのあるディレクトリに移動します
# vi kazz7 ← サーバ設定ファイルに設定を追加します。(kazz7は、私のサーバ設定ファイルの名前)
以下を追加しました
Alias /webmail/ "/usr/share/squirrelmail/"
<Directory "/usr/share/squirrelmail">
AllowOverride Limit
</Directory><Directory "/var/www/webmail">
AllowOverride Limit
</Directory># vi ssl ← SSL用のサーバ設定ファイルも修正します。(sslは、私のサーバ設定ファイルの名前)
上記と同じ内容を追加しました
# /etc/init.d/apache2 restart ← Apache2をリスタートします5. ちょっとしたセキュリティ対策
パソコンおやじさんのところを参考に、以下の設定を追加しました。
# cd /usr/share/squirrelmail ← Squirelmailのファイルがあるディレクトリに移動します
# vi index.php ← index.phpファイルを修正して、httpによるアクセスを必ずhttpsにリダイレクトするようにします
以下のように修正しました
header('Location: src/login.php');
↓
header('Location: https://xxxxxx.com/webmail/src/login.php');
exit();
これで一応完了です。
ブラウザでhttp://kuro-box/webmail/にアクセスしてみると、ちゃんとhttpsにリダイレクトされたログイン画面が出ました。
そしてログインしてみると、IMAPの受信箱がちゃんと表示されます。
サブジェクトも本文も日本語で問題ありませんし、ちゃんと外にメールを出す事も出来ます。
うわぁ……ちょっとした感動ですよ。
そういえばセットアップした時に、以下のようなメッセージがありました。
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!
思い出したので
http://kuro-box/webmail/src/configtest.phpにアクセスしてみると……
SquirrelMail configtest
This script will try to check some aspects of your SquirrelMail configuration and point you to errors whereever it can find them. You need to go run conf.pl in the config/ directory first before you run this script.SquirrelMail version: 1.4.4
Config file version: 1.4.0
Config file last modified: 06 February 2005 17:20:23
Checking PHP configuration...
PHP version 4.3.10-2 OK.
PHP extensions OK.
Checking paths...
Data dir OK.
Attachment dir OK.
Plugins are not enabled in config.
Themes OK.ERROR: You have set ja_JP as your default language, but I cannot find this translation (should be in ../locale/ja_JP/LC_MESSAGES/squirrelmail.mo). Please note that you have to download translations separately from the main SquirrelMail package.
何か日本語のLocaleが見つからないとか言われてしまいます。
いろいろとググってみると、どうやらSquirrelMailのv1.4.4というのはそういうものらしい!?
インターフェイスが日本語でなくても十分に使えるので、とりあえずヨシ!とします(またか……)
■追記:2005.02.19 16:30ごろ
本日 apt-get update → apt-get upgrade によって、SquirrelMailの更新が判明したので、早速アップデートしたところ、インターフェイス周りが無事に日本語で表示されるようになりました。
メデタシメデタシ……
「玄箱」カテゴリの記事
- 玄箱にPukiwikiを導入(だけ)(2005.03.02)
- 玄人志向の「玄箱」プロ向けの後継モデル登場!(2007.02.17)
- フレッシュリーダーの脆弱性対策について(2007.01.21)
- 玄箱今までのまとめ(3)(2005.07.24)
- 玄箱今までのまとめ(2)(2005.03.06)
参考になる本があるかも
参考になりそうなものをGoogleで調べてみる
トラックバック
この記事のトラックバックURL:
http://app.cocolog-nifty.com/t/trackback/26616/2828893
この記事へのトラックバック一覧です: 玄箱にSquirrelMailを導入:
コメント
コメントを書く

![]() |
|
|
|---|


