Vine Linux 4でSMTP-AUTHやIMAPを利用しよう@釣ったよ!
SSLによるセキュアなメールサーバーについて一通り書いてある。
# cat server.key server.pem > mail.pemとしてimapd-sslで指定しないと駄目
【Vine Linuxで自宅サーバー】WebMailの導入(SquirrelMail)
Webmail: SquirrelMailのインストールはほとんどこの通りにやって、バージョンを2008年2月現在の物に代え、私の環境ではうまくいかなかったところを調整しました。
Vine4.1をフルインストールするとPostfixがインストールされている。
# vi /etc/postfix/main.cf
# myhostname → ホスト名の定義
myhostname = hoge.jp
# mydomain → ドメイン名の定義
mydomain = hoge.jp
# myorigin → ローカルから配信するときの送信元アドレス定義
myorigin = $mydomain
# inet_interfaces → メール送信するインターフェイスの設定
inet_interfaces = all
メール送信するインターフェイスの設定は、デフォルトではローカルのみなので、外部からメールを受け取れるように all に設定。
# mydestination → どのメールアドレスをローカル配信するかの定義
mydestination = $myhostname, localhost.$mydomain, $mydomain
# mynetworks → メールリレーを受け付けるクライアントアドレスの定義
mynetworks = 192.168.0.0/24, 127.0.0.0/8
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
mai_spool_directory = /var/spool/mail
を確認。
# vi /etc/postfix/aliases
最後に
root: webmaster@hoge.jp
と追加し、
# postalias /etc/postfix/aliases
「サービスの管理」から起動。
cyrus-sasl-md5
cyrus-sasl-plain
をインストール
# vi /usr/lib/sasl2/smtpd.conf
pwcheck_method: saslauthd
# saslpasswd2 -u hoge.jp -c testuser
hoge.jp は 認証を行うメールサーバーの名前で、Postfixの環境設定ファイル main.cf で設定する [ smtpd_sasl_local_domain = ] に一致させる必要があります。これは後から編集します。
testuser は認証に使用する専用のユーザー名です。Linuxのユーザー名と一致させる必要はありません。逆に一致させない方がより安全になります。
ユーザーのパスワードを変更したい時は、
# saslpasswd2 -u hoge.jp testuser
ユーザーの削除は、
# saslpasswd2 -u hoge.jp -d testuser
ユーザーの一覧表示は、
# sasldblistusers2
testuser@hoge.jp: userPassword
# touch /etc/sasldb2
# chown postfix.postfix /etc/sasldb2
# vi /etc/postfix/main.cf
最後に以下の文を追加
smtpd_sasl_auth_enable = yes → SASLによるSMTP_AUTHを有効にする
# smtpd_sasl_local_domain → ローカル認証のREALMの指定
smtpd_sasl_local_domain = $mydomain
# noanonymous → anonymousログイン禁止
# noplaintext → 平文パスワード禁止(plain / login)。やりたいところだが、Outlook 2007は使えなくなってしまった。
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = no → Outlook のバージョン 5 以前の認証を拒否。
# smtpd_recipient_restrictions → メールリレー制御の設定(宛先の制限)
# permit_mynetworks → サーバーが属するネットワーク内のクライアントを許可
# permit_sasl_authenticated → SMTP_AUTHに認証されたクライアントを許可
# reject_unauth_destination → 以下のパラメータにセットされているアドレス宛て
# のメールかどうかをチェックし、それ以外は拒否
# $mydestination,
# $inet_interfaces,
# $virtual_alias_domains,
# $virtual_mailbox_domains,
# $relay_domains
smtpd_recipient_restrictions = permit_mynetworks
permit_sasl_authenticated
reject_unauth_destination
最後の行 smtpd_recipient_restrictions は3行に分かれていますが、半角スペースで区切ればよい。
# /sbin/servise postfix restart
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 hoge.jp ESMTP Postfix
と表示されたら、
EHLO localhost
と入力します。表示された一覧に、
250-AUTH PLAIN LOGIN DIGEST-MD5 CRAM-MD5
が入っていれば SMTP-AUTH は動作しています。broken_sasl_auth_clients = yesだと
250-AUTH=PLAIN LOGIN DIGEST-MD5 CRAM-MD5
も表示されます。
quit
と入力して、telnet を終了
外部へ公開するので、SMTPの通信ポートである25番TCPを開放する。
外部からの送受信が出来るように設定された場合は、安全のために不正中継のチェックを行う。
下記のサイトを表示する。
http://www.ugtop.com/spill.shtml
表示されたサイトから、自分の外部のIPアドレスが確認できる。上から3番目の「現在接続している場所(現IP)」の欄をメモして押して下さい。次に下記のサイトを表示して下さい。
http://www.abuse.net/relay.html
表示されたサイトの入力できる項目の一番上に、「 Address to test:(as host name or dotted quad) 」 という欄がありますので、ここに先ほどメモしたIPアドレスを入力して、【 Test for relay 】 をクリックして下さい。不正中継のチェックが行われます。
全部で17種類のチェックが行われます。不正中継に問題が無ければ、最下部に「 All tests performed, no relays accepted. 」と表示されます。案外時間が掛かります。
# vi /etc/postfix/main.cf
最後に以下を追加
smtpd_use_tls = yes
smtpd_tls_key_file = /etc/postfix/ssl/server.key
smtpd_tls_cert_file = /etc/postfix/ssl/server.pem
Apache 2 のインストールの時作ったSSL証明書をコピーする。
# cp /usr/share/ssl/misc/servernopass.key /etc/postfix/ssl/server.key
# cp /usr/share/ssl/misc/server.cert /etc/postfix/ssl/server.pem
server.pemの要らない部分を消す。
# vi /etc/postfix/ssl/server.pem
"d"を2回押すと1行ずつ消えるので、
-----BEGIN CERTIFICATE-----
の直前まで消す。
# /sbin/service postfix restart
先程と同じくtelnetすると
250-STARTTLS
となるはず。
Outbound Port25 Blockingが導入されるとそのISPから自宅サーバーのSMTPが使えなくなるので、メール投稿用に587番TCPを開けておきます。
# vi /etc/postfix/master.cf
以下のコメントアウトを外します。
#submission inet n - n - - smtpd
# -o smtpd_etrn_restrictions=reject
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
# /sbin/servise postfix restart
STARTTLSだとそれまでは平文での通信で、その後だけが暗号化されるので、最初からSSLになるように465番TCPを使った方がいいかも。特にOutlook ExpressやVer. 7.0x以前のNetscapeだとcram-md5認証が出来ず平文パスワードになってしまうらしいので。
# vi /etc/postfix/master.cf
以下のコメントアウトを外します。
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
# /sbin/servise postfix restart
# iptables -L --line-numbers
一番下に出てくる行番号を使って、secure-smtpを開ける。
# iptables -I RFirewallH--1-INPUT 15 -m state --state NEW -p tcp --dport 465 -j ACCEPT
# /etc/init.d/iptables save
ファイアーウォールの設定を使っているならそれで開ける。
メールクライアントのThunderbirdでメールを全てダウンロードしておく。
「Synapticパッケージマネージャ」でCourier-IMAPをインストールする。
# cd /etc/courier-imap
# vi pop3d
POP3DSTART=NO
# vi pop3d-ssl
POP3DSSLSTART=NO
# vi imapd
IMAPDSTART=NO
# vi imapd-ssl
IMAPDSSLSTART=YES
及びpemファイルを指定するため、
TLS_CERTFILE=/usr/lib/courier-imap/share/imapd.pem
を
TLS_CERTFILE=/etc/postfix/ssl/mail.pem
に変更。
これでIMAP over SSLのみ使用できる状態になる。
mail.pemはSSL証明書と秘密鍵が一緒になっているものなので、
# cd /etc/postfix/ssl
# cat server.pem server.key > mail.pem
# iptables -L --line-numbers
一番下に出てくる行番号を使って、secure-imapを開ける。
# iptables -I RFirewallH--1-INPUT 16 -m state --state NEW -p tcp --dport 993 -j ACCEPT
# /etc/init.d/iptables save
ファイアーウォールの設定を使っているならそれで開ける。
Corier-IMAPのメールBoxはMaildir形式なので、各ユーザのホームディレクトリにMaildirを作成する。
$ cd ~
$ /usr/sbin/maildirmake Maildir
新規ユーザ作成時に、自動的にユーザホームディレクトリにMaildirが作られるようにするには、root で「/etc/skel」にも作成しておく。
# /usr/lib/courier-imap/bin/maildirmake /etc/skel/Maildir
PostfixをMaildir形式対応にするには、/etc/postfix/main.cf を編集してhome_mailboxでのMaildirの指定と、mail_spool_directoryでのスプールディレクトリの指定を行う。
* メールBoxの指定
#home_mailbox = Mailbox
#home_mailbox = Maildir/
↓削除
#home_mailbox = Mailbox
home_mailbox = Maildir/
* スプールディレクトリの指定
#mail_spool_directory = /var/mail
mail_spool_directory = /var/spool/mail
↓追加
#mail_spool_directory = /var/mail
#mail_spool_directory = /var/spool/mail
courier-imapのスクリプト(/etc/rc.d/init.d/courier-imap)では、初回起動時に自動的にダミーのSSL証明書を作成するようになっているので、そこをコメントアウトして利用する。IMAP用とPOP3用の2箇所ある。使用しなければいいだけなので、変更しなくても特に問題はない。
# vi /etc/rc.d/init.d/courier-imap
# First time we start this, generate a dummy SSL certificate.
ここからコメントアウト
# if test ! -f ${prefix}/share/imapd.pem
# then
# echo -n " generating-SSL-certificate..."
# ${prefix}/share/mkimapdcert >/dev/null 2>&1
# fi
ここまで /usr/lib/courier-imap/libexec/imapd-ssl.rc start
echo -n " imap-ssl"
fi
:
(snip)
:
# First time we start this, generate a dummy SSL certificate.
ここからコメントアウト
# if test ! -f ${prefix}/share/pop3d.pem
# then
# echo -n " generating-SSL-certificate..."
# ${prefix}/share/mkpop3dcert >/dev/null 2>&1
# fi
ここまで /usr/lib/courier-imap/libexec/pop3d-ssl.rc start
echo -n " pop3-ssl"
fi
ThunderbirdやOutlook ExpressでIMAPフォルダを作り、今までのフォルダからドラッグアンドドロップをすれば時間は掛かるが移行される。
Thunderbirdで保護された認証は設定できない。
出先で自分のパソコンを持っていなくてもメールを確認したいときがあるので、SquirrelMail(スクイリルメール)を使用してWebブラウザ上でメールの送受信ができるようにします。
SquirrelMail(スクイリルメール)日本語バージョン本体と、日本語化ファイル(locales)をダウンロード
本体の最新版はこちらを確認
Localesの最新版はこちらを確認
# cd /usr/local/src/
# wget http://www.yamaai-tech.com/~masato/Download/squirrelmail-1.4.13-ja-20071215.tar.gz ← 本体DL
# wget http://downloads.sourceforge.net/squirrelmail/ja_JP-1.4.9-20070106.tar.gz?modtime=1168106199&big_mirror=1 ← localesのDL
# cd /var/www/html/ ← インストールするディレクトリに移動
# tar zxfv /root/squirrelmail-1.4.13-ja-20071215.tar.gz ← 本体展開
# mv squirrelmail-1.4.13-ja webmail ← 展開してできたディレクトリの名前をwebmailに変更(実際には任意の違う名前にすること)
# cd /usr/local/src ← ダウンロード先に戻る
# tar zxfv ja_JP-1.4.9-20070106.tar.gz ← 日本語化ファイルの展開
# \rm -rf /var/www/html/webmail/help/ ← ノーマルのhelpファイル削除
# ./install ← 日本語化ファイルのインストール
Please enter path to your squirrelmail installation:/var/www/html/webmail ← インストール先を指定
# cd /var/www/html/webmail
# chmod 730 data ← ディレクトリのパーミッション変更
# chown -R apache:apache data ← 所有権をApacheのユーザとグループ(httpd.confに記載)に変更
# cd /usr/local/src
# rm -f ./install ← 展開ディレクトリの削除
# \rm -rf help ← 展開ディレクトリの削除
# rrm -rf locale ← 展開ディレクトリの削除
# cd /home/httpd/html/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
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 >> d ← dを指定(使用するIMAPサーバの設定)
SquirrelMail Configuration : Read: config_default.php
---------------------------------------------------------
While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others. If you select your IMAP server, this option will
set some pre-defined settings for that server.
Please note that you will still need to go through and make sure
everything is correct. This does not change everything. There are
only a few settings that this will change.
Please select your IMAP server:
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
quit = Do not change anything
Command >> courier ← courierを指定
imap_server_type = courier
default_folder_prefix = INBOX.
trash_folder = Trash
sent_folder = Sent
draft_folder = Drafts
show_prefix_option = false
default_sub_of_inbox = false
show_contain_subfolders_option = false
optional_delimiter = .
delete_folder = true
Press any key to continue... 「Enter」
ログアウトしたときに表示されるページを指定
同様に
Command >> 1 ← 1を指定
SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Organization Preferences
1. Organization Name : SquirrelMail
2. Organization Logo : ../images/sm_logo.png
3. Org. Logo Width/Height : (308/111)
4. Organization Title : SquirrelMail $version
5. Signout Page :
6. Top Frame : _top
7. Provider link : http://www.squirrelmail.org/
8. Provider name : SquirrelMail
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 5 ← 5を指定
When users click the Sign Out button they will be logged out and
then sent to signout_page. If signout_page is left empty,
(hit space and then return) they will be taken, as normal,
to the default and rather sparse SquirrelMail signout page.
[]: /webmail ← /webmailを指定(ログアウトしたらログインページに戻るようにする)
同様に
Command >> r ← メニューに戻る
ドメイン名の設定
同様に
Command >> 2 ← 2を指定
SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Server Settings
General
-------
1. Domain : example.com
2. Invert Time : false
3. Sendmail or SMTP : SMTP
A. Update IMAP Settings : localhost:143 (courier)
B. Update SMTP Settings : localhost:25
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 1 ← 1を指定
The domain name is the suffix at the end of all email addresses. If
for example, your email address is jdoe@example.com, then your domain
would be example.com.
[example.com]: hoge.com ← ドメイン名を指定
Command >> A ← メニューに戻る
SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Server Settings
General
-------
1. Domain : example.com
2. Invert Time : false
3. Sendmail or SMTP : SMTP
A. Update IMAP Settings : localhost:143 (courier)
B. Update SMTP Settings : localhost:25
R Return to Main Menu
C Turn color on
S Save data
Q Quit
同様に
Command >> a ← aを指定(どういう訳かSSL指定にしないと動きませんでした。localhostだから無理にそうする必要もなく、SMTPの方はそのままで動くので、今までのcourier IMAPの設定のどこかが悪かったのかも。特に実害もないのでSquirrelmailの方の設定をいじって解決してます。)
General
-------
1. Domain : hoge.com
2. Invert Time : false
3. Sendmail or SMTP : SMTP
IMAP Settings
--------------
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : courierv
9. Dlimiter : .
B. Update SMTP Settings : localhost:25
H. Hide IMAP Server Settings
R Return to Main Menu
C Turn color on
S Save data
Q Quit
同様に
Command >> 5 ← メニューに戻る
This is the port that yourt IMAP server is on. Usually this is 143.
[143]: 993
同様に
Command >> 7 ← Secure IMAP (TLS)
TLS (Transport Layer Security) encrypts the traffic between server and client.
If you're familiar with SSL, you get the idea.
To use this feature, your IMAP server must offer TLS
capability, plus PHP 4.3.x with OpenSSL support.
Note that the 'STARTTLS' command is not supported; the server must
have a dedicated port listening for TLS connections.
If your IMAP server is localhost, you can safely disable this.
If it is remote, you may wish to seriously consider enabling this.
Enable TLS (y/n) [y]: y
同様に
Command >> r ← メニューに戻る
言語の設定
同様に
Command >> 10 ← 10を指定
SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : en_US
2. Default Charset : iso-8859-1
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 1 ← 1を指定
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 ← 日本語を指定
同様に
Command >> 2 ← 2を指定
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を指定
同様に
Command >> r ← メニューに戻る
SquirrelMailのバージョン非表示化
同様に
Command >> 4 ← 4を指定
SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
General Options
1. Data Directory : ../data/
2. Attachment Directory : $data_dir
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
Allow editing of name : true
Remove username from header : false
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 : SQMSESSID
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 7 ← 7を指定
Hide SM attributions (y/n) [n]: y ← yでログインページでSquirrelMailのバージョンを表示しないようにする
同様に
Command >> q ← 終了
You have not saved your data.
Save? [Y/n]: y ← 保存
プラグインの説明
Compatibility → プラグインを全てのバージョンのSquirrelMailでそのまま動くようにする。
Empty → Trash(ゴミ箱フォルダ)を自動的に空にする。
Secure → ログイン時に自動的にhttps(SSL)でアクセスする。
# cd /usr/local/src ← ダウンロード先ディレクトリに戻る
プラグインのダウンロード
最新版はこちら
# wget http://www.squirrelmail.org/plugins/compatibility-2.0.10-1.0.tar.gz
最新版はこちら
# wget http://www.squirrelmail.org/plugins/empty_trash-1.4-1.2.2.tar.gz
最新版はこちら
# wget http://www.squirrelmail.org/plugins/secure_login-1.3-1.2.8.tar.gz
# cd /home/httpd/html/webmail/plugins/ ← プラグインディレクトリに移動
# tar zxvf /root/compatibility-2.0.8-1.0.tar.gz ← compatibilityを解凍
# tar zxvf /root/empty_trash-1.4-1.2.2.tar.gz ← empty_trashを解凍
# tar zxvf /root/secure_login-1.3-1.2.8.tar.gz ← secure_loginを解凍
# cd .. ← 上へ移動
# ./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 >> 8 ← 8を指定
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
Available Plugins:
1. info
2. translate
3. squirrelspell
4. spamcop
5. filters
6. calendar
7. abook_take
8. fortune
9. administrator
10. newmail
11. bug_report
12. sent_subfolders
13. mail_fetch
14. listcommands
15. message_details
16. delete_move_next
17. compatibility
18. empty_trash
19. secure_login
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 17 ← compatibilityの番号を選択(番号は環境によって異なります)
同様に
Command >> 18 ← empty_trashの番号を選択(番号は環境によって異なります)
同様に
Command >> 19 ← secure_loginの番号を選択(番号は環境によって異なります)
同様に
Command >> q ← 終了
You have not saved your data.
Save? [Y/n]: y ← 保存
Data saved in config.php
Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!
# ./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 >> 4 ← 4を指定
1. Data Directory : /var/local/squirrelmail/data/
2. Attachment Directory : /var/local/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 : true
8. Allow use of receipts : true
9. Allow editing of identity : true
Allow editing of name : true
Remove username from header : false
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 : SQMSESSID
15. Location base :
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 1 ← 1を指定
Specify the location for your data directory.
The path name can be absolute or relative (to the config directory).
You probably need to create this directory yourself. Here are two examples:
Absolute: /var/local/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/local/squirrelmail/data/]: /var/www/html/webmail/data/ ← 実際のdataディレクトリを指定
同様に
Command >> 2 ← 2を指定
同様に適当なattachディレクトリを作って指定する。
同様に
Command >> q ← 終了
You have not saved your data.
Save? [Y/n]: y ← 保存
Data saved in config.php
# chmod 730 attach ← ディレクトリのパーミッション変更
# chown -R apache:apache attach ← 所有権をApacheのユーザとグループ(httpd.confに記載)に変更
Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!
http://サーバーIPアドレス/webmail/(webmailは任意の別名にしてますね?)にアクセスしてSquirrelMailログインページが表示されていればOKです。そのときURLは
https://サーバーIPアドレス/webmail/src/login.php?secure_login=yes
となってますね?
# vi /etc/php5/php.ini
short_open_taq=offをonに書き換えます。
# /sbin/service apache2 restart
secure pluginを導入して、ログインページは確かにhttpsになったのですが、その先が何故かhttpです。よく分からなかったのでリダイレクトでごまかしました。
# vi /etc/apache2/conf/httpd.conf
モジュールロードより下に
<If Module mod_rewrite.c>
RewriteEngine On
RewriteLog "logs/rewrite.log"
RewriteLogLevel 0
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/webmail/(.*)?$ https://%{HTTP_HOST}/webmail/$1 [L,R]
</IfModule>
を追記してください。
# /sebin/service apache2 restart
これでうちの環境ではOKになりました。
現在うちでは自宅サーバのアドレスを何かのアンケートに書いたりとかしませんし、送受信にも使っていません。IMAPとして貯めておくだけです。だからスパムメールは来ませんし、もし来たらアドレス変えるつもりですが、Webmailから使うとなるとは送受信にも使った方が利便性が上がります。それにはスパムフィルタを導入しないといけないので面倒ですね。いつか導入したいと思います。
移動
↑Proftpdのインストール
↓PHP5のインストール
←PCG-FX33G/BPでVineを使ってサーバー管理
←今まで使ったパソコン
←高橋秀徳のページtop