::
Home > ArchiveList > 2007-10 > 2007-10-23
«Prev | | 1 || Next»

2007-10-23

SquirrelMail / FreeBSD

iPod touch にはメールクライアントがありません。iPhone には Mail がありますので、install.app からインストールできるネイティブアプリケーションにも見あたりません。

このままでは仕方ないので、FreeBSD で運用している自宅サーバに Web メールシステムを組み込むことにしました。free な Web メールシステムとしては有名どころの SquirrelMail - Webmail for Nuts! を導入してみました。

インストールは単純に ports/mail/squirrelmail/ で

# make install

とするだけです。/usr/local/www/squirrelmail/ にインストールされます。インストールが終了したら

# cd /usr/local/www/squirrelmail/
l# ./configure

として、設定を行います。
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. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color on
S Save data
Q Quit

Command >>
となりますので、Courier IMAP を利用している私は、まず D から courier を選択しました。後は、2 を選択して、
1. Domain : kncn.net
2. Invert Time : false
3. Sendmail or SMTP : SMTP

A. Update IMAP Settings : localhost:993 (courier)
B. Update SMTP Settings : localhost:25
Domain と IMAP Settings を設定しました。自宅サーバでは IMAPS を利用していますので、IMAP Settings の port を 993、Secure IMAP (TLS) を trueとしています。
やはり私も日本人ですので、10
Language preferences
1. Default Language : ja_JP
2. Default Charset : iso-2022-jp
3. Enable lossy encoding : false
としておきました。ついでに、ログアウト後のページを 1 -> 5 で指定しておきました。

これで SquirrelMail 側の設定は完了です。後は apache で外からアクセスできるようにすればいいわけです。自宅サーバでは apache 2.2.6 を利用しています。これまで httpd.conf は 2.0 時代からの物をそのまま使い回してきましたが、これを機にちょっと見直してみました。バーチャルホスト関係の設定を /usr/local/etc/apache22/extra/httpd-vhosts.conf に移し、/usr/local/etc/apache22/httpd.conf の
# Include etc/apache22/extra/httpd-vhosts.conf
とコメントアウトされているところを有効にしました。また、Web メールですので、SSL を使うようにしたいと思い、
# Include etc/apache22/extra/httpd-ssl.conf
のコメントも外しておきました。

apache 2.2.6 で SSL を有効にするためには、さほど特別な操作は必要ありません。
まずは、自己署名の証明書を作成します。

cd /usr/local/etc/apache22/
# openssl genrsa -out server.key 1024
Generating RSA private key, 1024 bit long modulus
.....++++++
..................................................++++++
e is 65537 (0x10001)

# openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:JP
State or Province Name (full name) [Some-State]:Hiroshima
Locality Name (eg, city) []:Hiroshima
Organization Name (eg, company) [Internet Widgits Pty Ltd]:kncn
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:ippo
Email Address []:webmaster@kncn.net

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
Signature ok
subject=/C=JP/ST=Hiroshima/L=Hiroshima/・・・・
Getting Private key

斜字の部分が入力した部分です。
続いて、/usr/local/etc/apache22/extra/httpd-ssl.conf の一部を書き換えました。書き換えたのは
DocumentRoot "/usr/local/www/squirrelmail"
ServerName xxx.kncn.net:443
ServerAdmin webmaster@kncn.net
くらいです。これで、https://xxx.kncn.net/ で SquirrelMail に SSL でアクセスできるようになります。勿論、DNS は適切に設定しております。


06:34:01 - No Trackbacks | Permalink Posted by ippo - No comments


«Prev | | 1 || Next»


ポチッとお願いします
   ↓