トップ  > サーバ設定:運用  > 各アプリケーションのインストール  > Webmailシステム構築(SquirrelMail)

Webmailシステム構築(SquirrelMail)  (最終更新日:2011/08/07)

Webブラウザ上でメールができるWebmailシステム(SquirrelMail)を構築します。

なお通信はセキュリティ向上のため自動的にhttps://でアクセスするようにします。

メールサーバ構築(sendmail+Dovecot)Webサーバ構築(Apache)Webサーバ間通信内容暗号化(mod_ssl)が導入されていること。

SquirrelMailインストール

[root@sv ~]# wget http://jaist.dl.sourceforge.net/project/squirrelmail/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.bz2 ← SquirrelMailダウンロード
※最新版はこちらで確認。(2011/08/07時点。squirrelmail-1.4.22.tar.bz2)

[root@sv ~]# tar jxvf squirrelmail-webmail-1.4.22.tar.bz2 ← SquirrelMail展開

[root@sv ~]# mv squirrelmail-webmail-1.4.22 /var/www/webmail ← SquirrelMail展開先ディレクトリを移動

[root@sv ~]# mv squirrelmail-webmail-1.4.22.tar.bz2 app/ ← ダウンロードしたファイルは念のため保存

[root@sv ~]# mkdir -p locales ← 日本語を格納するディレクトリを作成

[root@sv ~]# cd locales ← 日本語を格納するディレクトリへ移動

[root@sv locales]# wget http://jaist.dl.sourceforge.net/sourceforge/squirrelmail/ja_JP-1.4.18-20090526.tar.bz2 ← localeダウンロード
※最新版はこちらで確認。(2011/08/07時点。ja_JP-1.4.18-20090526.tar.bz2)

[root@sv locales]# tar jxvf ja_JP-1.4.18-20090526.tar.bz2 ← ダンロードしたlocaleファイルを展開

[root@sv locales]# ./install ← localeインストール
Please enter path to your squirrelmail installation:/var/www/webmail ← SquirrelMailインストール先を入力

[root@sv locales]# mv ja_JP-1.4.18-20090526.tar.bz2 ~/app/ ← ダウンロードしたファイルは念のため保存

[root@sv locales]# cd ← カレントディレクトリへ戻る

[root@sv ~]# rm -rf locales ← locale展開先ディレクトリを削除

[root@sv ~]# cd /var/www/webmail/po/ ← ディレクトリ移動

[root@sv po]# ./compilepo ja_JP ← squirrelmail.poファイル作成
Compiling ../locale/ja_JP/LC_MESSAGES/squirrelmail.po

[root@sv po]# cd ← カレントディレクトリへ戻る

[root@sv ~]# chmod 730 /var/www/webmail/data/ ← dataディレクトリのパーミッション変更

[root@sv ~]# chown -R apache:apache /var/www/webmail/data/ ← dataディレクトリ所有者をApache実行ユーザへ変更

[root@sv ~]# vi /var/www/webmail/functions/i18n.php ← i18n.phpファイル編集
        case 'decodeheader':
            $ret = str_replace("\t", "", $ret);
            if (preg_match('/=\?([^?]+)\?(q|b)\?([^?]+)\?=/i', $ret))
                $ret = @mb_decode_mimeheader($ret);
            //$ret = @mb_convert_encoding($ret, 'EUC-JP', 'AUTO') ← 行頭に//を入れてコメントアウト
            $ret = @mb_convert_encoding($ret, 'EUC-JP', 'ASCII,JIS,EUC-JP,UTF-8,SJIS'); ← 追加(差出人文字化け対処)
            break;
        case 'downloadfilename':
            $useragent = func_get_arg(2);
            if (strstr($useragent, 'Windows') !== false ||
                strstr($useragent, 'Mac_') !== false) {
                //$ret = mb_convert_encoding($ret, 'SJIS', 'AUTO'); ← 行頭に//を入れてコメントアウト
                $ret = mb_convert_encoding($ret, 'UTF-8', 'AUTO'); ← 追加(添付ファイル名文字化け対処)
            } else {
                $ret = mb_convert_encoding($ret, 'EUC-JP', 'AUTO');
}
            break;

SquirrelMail設定

1.基本設定
[root@sv ~]# /var/www/webmail/config/conf.pl ← 設定スクリプト実行
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 >> 10 ← Languages選択


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 ← 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 ← ja_JPを入力


SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Language preferences
1.  Default Language       : ja_JP
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 >> 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_default.php (1.4.0)
---------------------------------------------------------
Language preferences
1.  Default Language       : ja_JP
2.  Default Charset        : iso-2022-jp
3.  Enable lossy encoding  : false

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> r ← 戻る


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 >> 1 ← Organization Preferences選択


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://squirrelmail.org/
8.  Provider name          : SquirrelMail

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 5 ← Signout Page選択

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入力(ログアウトしたらログインページに戻るようにする)


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           : /webmail
6.  Top Frame              : _top
7.  Provider link          : http://squirrelmail.org/
8.  Provider name          : SquirrelMail

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> r ← 戻る


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 >> 2 ← Server Settings選択


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 (other)
B.  Update SMTP Settings   : localhost:25

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 1 ← Domain選択

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]: rx-93dff.net ← ドメイン入力(rx-93dff.netは当サイトの例)


SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : rx-93dff.net
2.  Invert Time            : false
3.  Sendmail or SMTP       : SMTP

A.  Update IMAP Settings   : localhost:143 (other)
B.  Update SMTP Settings   : localhost:25

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> r ← 戻る


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 >> 4 ← General Options選択


SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
General Options
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         : 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
15. Location base                : 
16. Only secure cookies if poss. : true
17. Disable secure forms         : false
18. Page referal requirement     : 

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 7 ← Hide SM attributions選択


Hide SM attributions (y/n) [n]: y ← y入力(ログインページでSquirrelMailのバージョンを表示しないようにする)


SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
General Options
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                : 
16. Only secure cookies if poss. : true
17. Disable secure forms         : false
18. Page referal requirement     : 

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 1 ← Data Directory選択

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/]: ../data/ ← ../data/入力


SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
General Options
1.  Data Directory               : ../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                : 
16. Only secure cookies if poss. : true
17. Disable secure forms         : false
18. Page referal requirement     : 

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 2 ← Attachment Directory選択

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/local/squirrelmail/attach/]: $data_dir ← $data_dir入力


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         : 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                : 
16. Only secure cookies if poss. : true
17. Disable secure forms         : false
18. Page referal requirement     : 

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 16 ← Only secure cookies if poss選択

This option allows you to specify that if a user session is initiated
under a secure (HTTPS, SSL-encrypted) connection, the cookies given to
the browser will ONLY be transmitted via a secure connection henceforth.

Generally this is a Good Thing, and should NOT be disabled.  However,
if you intend to use the Secure Login or Show SSL Link plugins to
encrypt the user login, but not the rest of the SquirrelMail session,
this can be turned off.  Think twice before doing so.

Transmit cookies only on secure connection when available? (y/n) [y]: n ← n入力(Secure Loginプラグインによるログイン不可対処)


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         : 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                : 
16. Only secure cookies if poss. : false
17. Disable secure forms         : false
18. Page referal requirement     : 

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> r ← 戻る


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 >> 3 ← Folder Defaults選択


SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Folder Defaults
1.  Default Folder Prefix          : 
2.  Show Folder Prefix Option      : false
3.  Trash Folder                   : INBOX.Trash
4.  Sent Folder                    : INBOX.Sent
5.  Drafts Folder                  : INBOX.Drafts
6.  By default, move to trash      : true
7.  By default, save sent messages : true
8.  By default, save as draft      : true
9.  List Special Folders First     : true
10. Show Special Folders Color     : true
11. Auto Expunge                   : true
12. Default Sub. of INBOX          : true
13. Show 'Contain Sub.' Option     : false
14. Default Unseen Notify          : 2
15. Default Unseen Type            : 1
16. Auto Create Special Folders    : true
17. Folder Delete Bypasses Trash   : false
18. Enable /NoSelect folder fix    : false

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 3 ← Trash Folder選択

You can now specify where the default trash folder is located.
On servers where you do not want this, you can set it to anything
and set option 6 to false.

This is relative to where the rest of your email is kept.  You do
not need to worry about their mail directory.  If this folder
would be ~/mail/trash on the filesystem, you only need to specify
that this is 'trash', and be sure to put 'mail/' in option 1.

[INBOX.Trash]: Trash ← Trash入力


SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Folder Defaults
1.  Default Folder Prefix          : 
2.  Show Folder Prefix Option      : false
3.  Trash Folder                   : Trash
4.  Sent Folder                    : INBOX.Sent
5.  Drafts Folder                  : INBOX.Drafts
6.  By default, move to trash      : true
7.  By default, save sent messages : true
8.  By default, save as draft      : true
9.  List Special Folders First     : true
10. Show Special Folders Color     : true
11. Auto Expunge                   : true
12. Default Sub. of INBOX          : true
13. Show 'Contain Sub.' Option     : false
14. Default Unseen Notify          : 2
15. Default Unseen Type            : 1
16. Auto Create Special Folders    : true
17. Folder Delete Bypasses Trash   : false
18. Enable /NoSelect folder fix    : false

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 4 ← Sent Folder選択

This is where messages that are sent will be stored.  SquirrelMail
by default puts a copy of all outgoing messages in this folder.

This is relative to where the rest of your email is kept.  You do
not need to worry about their mail directory.  If this folder
would be ~/mail/sent on the filesystem, you only need to specify
that this is 'sent', and be sure to put 'mail/' in option 1.

[INBOX.Sent]: Sent ← Sent入力


SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Folder Defaults
1.  Default Folder Prefix          : 
2.  Show Folder Prefix Option      : false
3.  Trash Folder                   : Trash
4.  Sent Folder                    : Sent
5.  Drafts Folder                  : INBOX.Drafts
6.  By default, move to trash      : true
7.  By default, save sent messages : true
8.  By default, save as draft      : true
9.  List Special Folders First     : true
10. Show Special Folders Color     : true
11. Auto Expunge                   : true
12. Default Sub. of INBOX          : true
13. Show 'Contain Sub.' Option     : false
14. Default Unseen Notify          : 2
15. Default Unseen Type            : 1
16. Auto Create Special Folders    : true
17. Folder Delete Bypasses Trash   : false
18. Enable /NoSelect folder fix    : false

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 5 ← Drafts Folder選択

You can now specify where the default draft folder is located.
On servers where you do not want this, you can set it to anything
and set option 9 to false.

This is relative to where the rest of your email is kept.  You do
not need to worry about their mail directory.  If this folder
would be ~/mail/drafts on the filesystem, you only need to specify
that this is 'drafts', and be sure to put 'mail/' in option 1.

[INBOX.Drafts]: Drafts ← Drafts入力


SquirrelMail Configuration : Read: config_default.php (1.4.0)
---------------------------------------------------------
Folder Defaults
1.  Default Folder Prefix          : 
2.  Show Folder Prefix Option      : false
3.  Trash Folder                   : Trash
4.  Sent Folder                    : Sent
5.  Drafts Folder                  : Drafts
6.  By default, move to trash      : true
7.  By default, save sent messages : true
8.  By default, save as draft      : true
9.  List Special Folders First     : true
10. Show Special Folders Color     : true
11. Auto Expunge                   : true
12. Default Sub. of INBOX          : true
13. Show 'Contain Sub.' Option     : false
14. Default Unseen Notify          : 2
15. Default Unseen Type            : 1
16. Auto Create Special Folders    : true
17. Folder Delete Bypasses Trash   : false
18. Enable /NoSelect folder fix    : false

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> q ← qを入力し設定スクリプト終了

You have not saved your data.
Save?  [Y/n]: y ← 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!
2.必要プラグインの導入

Compatibilityプラグイン…プラグインをすべてのバージョンのSquirrelMailでそのまま動くようにします。

Secure Loginプラグイン…ログイン時に自動的にhttpsでアクセスするようにします。

[root@sv ~]# wget http://www.squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fwww.squirrelmail.org%2Fplugins%2Fcompatibility-2.0.16-1.0.tar.gz ← compatibilityプラグインダウンロード
※最新版はこちらで確認。(2011/08/07時点。compatibility-2.0.16-1.0.tar.gz)

[root@sv ~]# tar zxvf compatibility-2.0.16-1.0.tar.gz ← ダウンロードしたcompatibilityを解凍

[root@sv ~]# mv compatibility /var/www/webmail/plugins/ ← compatibilityプラグインを所定の位置移動

[root@sv ~]# mv compatibility-2.0.16-1.0.tar.gz app/ ← ダウンロードしたファイルは念のため保存

[root@sv ~]# wget http://www.squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fwww.squirrelmail.org%2Fplugins%2Fsecure_login-1.4-1.2.8.tar.gz ← secure_loginプラグインダウンロード
※最新版はこちらで確認。(2011/08/07時点。secure_login-1.4-1.2.8.tar.gz)

[root@sv ~]# tar zxvf secure_login-1.4-1.2.8.tar.gz ← ダウンロードしたsecure_loginを解凍

[root@sv ~]# mv secure_login /var/www/webmail/plugins/ ← secure_loginプラグインを所定の位置移動

[root@sv ~]# mv secure_login-1.4-1.2.8.tar.gz app/ ← ダウンロードしたファイルは念のため保存

[root@sv ~]# cd /var/www/webmail/plugins/secure_login/ ← secure_loginプラグインディレクトリへ移動

[root@sv secure_login]# cp config.sample.php config.php ← サンプルよりsecure_login設定ファイル作成

[root@sv secure_login]# vi config.php ← secure_login設定ファイル編集
   // if you want user sessions to remain in SSL for their entire duration, 
   // set the following to zero:
   //
   $change_back_to_http_after_login = 1;
   ↓
   $change_back_to_http_after_login = 0; ← ログイン後もSSL通信を継続

[root@sv secure_login]# cd ← カレントディレクトリへ戻る

[root@sv ~]# /var/www/webmail/config/conf.pl ← SquirrelMail設定スクリプト実行
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 ← Plugins選択


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
  Installed Plugins

  Available Plugins:
    1. administrator
    2. bug_report
    3. calendar
    4. compatibility
    5. delete_move_next
    6. demo
    7. filters
    8. fortune
    9. info
    10. listcommands
    11. mail_fetch
    12. message_details
    13. newmail
    14. secure_login
    15. sent_subfolders
    16. spamcop
    17. squirrelspell
    18. test
    19. translate

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 4 ← compatibilityの番号を選択(番号は環境によって異なる)


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
  Installed Plugins
    1. compatibility

  Available Plugins:
    2. administrator
    3. bug_report
    4. calendar
    5. delete_move_next
    6. demo
    7. filters
    8. fortune
    9. info
    10. listcommands
    11. mail_fetch
    12. message_details
    13. newmail
    14. secure_login
    15. sent_subfolders
    16. spamcop
    17. squirrelspell
    18. test
    19. translate

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> 14 ← secure_loginの番号を選択(番号は環境によって異なる)


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
  Installed Plugins
    1. compatibility ← 追加されていることを確認
    2. secure_login ← 追加されていることを確認

  Available Plugins:
    3. administrator
    4. bug_report
    5. calendar
    6. delete_move_next
    7. demo
    8. filters
    9. fortune
    10. info
    11. listcommands
    12. mail_fetch
    13. message_details
    14. newmail
    15. sent_subfolders
    16. spamcop
    17. squirrelspell
    18. test
    19. translate

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> q ← 設定スクリプト終了

You have not saved your data.
Save?  [Y/n]: y ← 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!
3.メールファイルサイズ設定
[root@sv ~]# vi /etc/mail/sendmail.mc ← sendmail.mc編集
以下を最終行へ追加(受信メールサイズを20MBに制限)
define(`confMAX_MESSAGE_SIZE',`20971520')

[root@sv ~]# m4 /usr/share/sendmail-cf/m4/cf.m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf ← sendmail.mcよりsendmail.cf作成

[root@sv ~]# /etc/rc.d/init.d/sendmail restart ← sendmail再起動
sm-client を停止中:                                        [  OK  ]
sendmail を停止中:                                         [  OK  ]
sendmail を起動中:                                         [  OK  ]
sm-client を起動中:                                        [  OK  ]

[root@sv ~]# vi /etc/php.ini ← php設定ファイル編集
; Maximum allowed size for uploaded files.
; http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize
upload_max_filesize = 2M
↓
upload_max_filesize = 10M ← ファイルサイズを変更

; Maximum size of POST data that PHP will accept.
; http://www.php.net/manual/en/ini.core.php#ini.post-max-size
post_max_size = 8M
↓
post_max_size = 10M ← ファイルサイズを変更

[root@sv ~]# /etc/rc.d/init.d/httpd reload ← Apacheへ設定反映

Apache設定

1.Apache設定
[root@sv ~]# vi /etc/httpd/conf.d/webmail.conf ← SquirrelMail用Apache設定ファイル作成
ここから----------
Alias /webmail /var/www/webmail
<Directory /var/www/webmail>
    AllowOverride Limit
</Directory>
----------ここまで

[root@sv ~]# /etc/rc.d/init.d/httpd reload ← Apache設定反映
httpd を再読み込み中:                                      [  OK  ]

SquirrelMail確認

http://サーバー名/webmail/にアクセスしてSquirrelMailログインページが表示されることを確認。

また、URLが「http://」指定をしたが「https://」となっていることを確認。