Top

ドメイン名入門
入門ガイド
管理ガイド基礎
[Email]
  alias
  procmail
  M4 Macro
  SPAM防止
    SpamAssassin
    vinstallログ
    accessファイル
  メールリスト
    Mailman
      VHostで利用
      リスト作成
    Majordomo
      インストール
      リスト作成
      MajorCool
  暗号化ツール
    SSL上での利用
    PGP
      暗号化PGP
      暗号化GnuPG
  自動返信メール
  virtusertable
  squirrelmail
      インストール
[FTP]
[Web]
[Ports]
[Shell]
[User]
[CPX]
[Webmin]
管理上級編
v3
Top
v3
Start
v3
Email
v3
Ftp
v3
Web
v3
Ports
v3
Shell
v3
User
v3
Perl
v3
Java
v3
System
v3
CPX


squirrelmail

本ページは 2011-07-12 更新されました

Speedex サーバーのサポートを行っている当職は、非常に多くのメールを扱っており、それらを廃棄できない立場にあります。ローカルな環境では Windows7 上で Widows Live Mail を利用していますが、件数が多く、フォルダー構造も複雑になっているためか、頻繁に障害が発生しています。
社内での情報の共有にも配慮し、webmail との併用を検討してみました。
CPX で webmail が使えますが、メールのボリュームが CPX で扱える範囲を超えています。Google Apps の採用も有力だったのですが、将来、サーバー上でメールデータを様々に加工したいこともあり、自由に使える squirrelmail をテストしてみました。

squirrelmail (すくいれるめーると読みます)は SquirrelMail プロジェクトチームが開発している GNU General Public License ライセンスのソフトウエアです。(squirrel はリスのことで画面にもリスのマークが使われています)

上記の目的のため以下条件でテストしました。

php5.3 vinstall 手順

# vinstall php5.3

オプション選択で IMAP support, Multibyte String Functions, OpenSSL Functions, Session Handling Functions, Zip File Functions, Zlib Compression Functions を選択しました。
vinstall 完了後、

# vi /usr/local/php5/lib/php.ini

で、short_open_tag = on に変更。
完了後、

# restart_apache

で、Apache を再起動。

CPX uninstall 手順

# vuninstall cpx

Maildir 形式設定手順
sendmail は Maildir 形式に対応していませんが、VPS では localmail に procmail を使っていますので、/etc/procmailrc に以下のように設定します。

DEFAULT=$HOME/Maildir/

ドメインによっては mbox 形式を使い続けたいという場合は、/etc/procmailrc ではなく、SquirrelMail を使うユーザーごとにホームディレクトリ内の .procmailrc に上記の設定を行います。

Dovecot 設定変更手順
Dovecot の設定ファイル /etc/dovecot.conf を以下のように編集します。

mail_location = maildir:~/Maildir
imap_listen = *
pop3_listen = *
imaps_listen = *
pop3s_listen = *

ドメインによっては mbox 形式を使い続けたいという場合は、mail_location = maildir:~/Maildirの記述は行わないでください。mail_location を Dovecot が自動判定します。

メールユーザー作成手順
コントロールパネルが利用できないので、vadduser コマンドでユーザーを作成、virtusertable、でメールアドレスの登録、転送設定がある場合は、aliases に転送設定を登録します。
以下は info@*******.jp のメールアドレスを使う test ユーザーを作成した場合の例です。
aliases に転送設定が必要な場合は適宜設定してください。

# vadduser
Please supply answers to the series of questions below.  When a
`default answer' is available, it will follow the question in square
brackets.  For example, the question:

        What is your favorite color? [blue]:

has the default answer 'blue'.  Accept the default (without any
extra typing!) by pressing the  key -- or type your answer
and then press .

Use the  key to erase and aid correction of any mistyped
answers -- before you press .  Generally, once you press
 you move onto the next question.

Once you've proceeded through all the questions, you will be given
the option of modifying your choices before any files are updated.

Hit ^C (Ctrl-C) at any time to quit without making changes.
Press  to continue: 
(1) User Name


Usernames consist of up to 16 alphanumeric characters, underscores and
hyphens, but may not begin with a hyphen. Uppercase letters are
discouraged in usernames.
Username: test
(2) Password

Now, enter a password for this account.

For security reasons you may want to use a password that is longer than 6
characters and that has at least one non alphabetic character.  The password
will *not* be echoed to the screen and you will be required to type it twice.
Password: 
Retype new password: 
(3) User's Full Name
Now, enter the full name for this account.
Full Name: Test User

You must specify a home directory.

(4) Account Home Directory
Where would you like to put the home directory for this account?

  Enter "1" for an account home directory:           /home/test
  Or enter in any custom path (beginning with /).
Select a number above or enter a path [1]: 
(5) Services
Please select the services that this account will be using:

      ftp             FTP services
      mail            Email services
      shell           shell login

Enter the service name (e.g., "ftp", "mail", etc.) to toggle that service for
the account. Hit  when you are done selecting/deselecting services for
this user.
Select/deselect services [ftp mail]: ftp
Select/deselect services [mail]: 
(6) Quotas

Enter filesystem quotas for this user. The quota should be an integer
(no decimal fractions) in megabytes (e.g., 5 = 5 megabytes). Enter 0
for no quota.
Quota (MB): 0
Account setup complete.

/etc/mail/virtusertable に以下に1行を追加しました。

info@*******.jp    test

保存後、以下のコマンドを実行しました。

# makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable

VirtualHost設定手順
squirrelmailはVirtualHostに対応していますので、Apache のVirtualHost設定を vaddhost コマンドで行いました。
以下は *******.jp ドメインの設定例です。

# vaddhost

--------------------------------------------------------------------------------
--                                                                            --
--                              H O S T N A M E S                             --
--                                                                            --
--    Please enter the hostnames (e.g., foo.com) you wish to associate with   --
--                          this virtual host entry.                          --
--                                                                            --
--    We suggest you enter the primary domain first, followed by the 'www'    --
--      cname (i.e., www.foo.com). These should be followed by any other      --
--       domains that also point to this virtual host (e.g., foo.net and      --
--    foo.org may simply be aliases for foo.com; those domains should also    --
--                              be entered here).                             --
--                                                                            --
--    You may enter only one domain per line. Valid domain names consist of   --
--    any alphabetic character (a-z), digit (0-9), hyphens (-), and periods   --
--                                    (.).                                    --
--------------------------------------------------------------------------------
Enter hostnames (one per line). When done, hit .
Hostname: *******.jp
(Hostname '*******.jp' accepted)

Enter hostnames (one per line). When done, hit .
Hostname: www.*******.jp
(Hostname 'www.*******.jp' accepted)

Enter hostnames (one per line). When done, hit .
Hostname: 
===============================================
==                                           ==
==  Please verify the following information  ==
==                                           ==
===============================================

        hostname
        ========
        *******.jp
        www.*******.jp

Is the information correct? [y]: 

--------------------------------------------------------------------------------
--                                                                            --
--                       U S E R   A S S O C I A T I O N                      --
--                                                                            --
--      Please select a user account to associate this virtual host with.     --
--                                                                            --
--       In order for the web sites you host on your system to function       --
--       securely and independently from the other web sites you may be       --
--      hosting, each virtual host you add must be associated with a user     --
--                           account on your system.                          --
--                                                                            --
--    You may select an existing user below, or you may choose to add a new   --
--    user (exit vaddhost by typing Ctrl-C, then run 'vadduser'). If you do   --
--     not associate the virtual host (which you are about to add) with a     --
--    particular user, it will be associated with the system 'vhost' user.    --
--                                                                            --
--      If the 'vhost' user does not exist, enter 'vhost' anyway and the      --
--    'vhost' user will be created for you (you will be prompted for a new    --
--       FTP password, which you should remember or write down in a safe      --
--                                   place).                                  --
--                                                                            --
--       For security reasons, you may not associate 'root' or any other      --
--                  privileged users with this virtual host.                  --
--------------------------------------------------------------------------------
Enter username (or  for a list of users): test

All hostnames (virtual hosts) you enter below will be associated with
this 'test' account.

===============================================
==                                           ==
==  Please verify the following information  ==
==                                           ==
===============================================

        user
        ====
        test

Is the information correct? [y]: 

--------------------------------------------------------------------------------
--                                                                            --
--                            I P    A D D R E S S                            --
--                                                                            --
--         Please enter the IP address you wish to associate with this        --
--                             virtual host entry.                            --
--------------------------------------------------------------------------------
Enter IP address (or  for a list of IP addresses): 
1) 111.111.111.111
Please select an ip from the list. [1]: 
===============================================
==                                           ==
==  Please verify the following information  ==
==                                           ==
===============================================

        ip
        ==
        111.111.111.111

Is the information correct? [y]: 

--------------------------------------------------------------------------------
--                                                                            --
--                        S S L  V I R T U A L  H O S T                       --
--                                                                            --
--    If you plan on serving secure content for this virtual host, you may    --
--    now enable SSL for this virtual host, allowing it to serve web pages    --
--             and accept form submissions over an encrypted link.            --
--------------------------------------------------------------------------------
Would you like to enable SSL for this host? [n]: y
===============================================
==                                           ==
==  Please verify the following information  ==
==                                           ==
===============================================

        ssl
        ===
        (enabled)

Is the information correct? [y]: 

--------------------------------------------------------------------------------
--                                                                            --
--                    A D M I N I S T R A T O R   E M A I L                   --
--                                                                            --
--    Please enter the email address of the administrator for this virtual    --
--    host (e.g., webmaster@domain.com). This person is responsible for the   --
--                       site content this virtual host.                      --
--------------------------------------------------------------------------------

The administrator email address should contain only alphanumeric
characters (a-z, 0-9), hyphens (-), underscores (_), and periods (.)
followed by an at sign (@) and then a domain name.

Hit  to accept the default value.

Administrator email address [webmaster@*******.jp]: info@*******.jp
===============================================
==                                           ==
==  Please verify the following information  ==
==                                           ==
===============================================

        admin
        =====
        info@*******.jp

Is the information correct? [y]: 

--------------------------------------------------------------------------------
--                                                                            --
--                          D O C U M E N T   R O O T                         --
--                                                                            --
--     Please enter the document root for this virtual host. The document     --
--   root is the full path (beginning with '/') where your web site content   --
--              (i.e., web pages) will be stored and served from.             --
--                                                                            --
--     For example, if the 'foo.com' virtual host is associated with user     --
--                     'joe', the document root might be:                     --
--                                                                            --
--                              /home/joe/www/foo.com                         --
--                                                                            --
--   It is recommended to accept the default value because secure directory   --
--    permission and ownership settings are made automatically.  Selecting    --
--     a path *other* than the default path means you will need to perform    --
--       the following steps (as root) in order to secure that directory      --
--                                 hierarchy:                                 --
--                                                                            --
--                           1) chmod 0750 /path/to/www                       --
--                                                                            --
--   where 'www' is one directory above the document root (but which is not   --
--     a user's home directory). This setting disallows all users on your     --
--    system from viewing contents of your web directory hierarchy (except    --
--                         the 'apache' Apache user).                         --
--                                                                            --
--                     2) chown :apache /path/to/www                --
--                                                                            --
--    where  is the user you have selected to associate with this   --
--     virtual host. These settings allow the Apache user ('www') to serve    --
--                 web content from this directory hierarchy.                 --
--                                                                            --
--           Hit  to accept the default value (recommended).          --
--------------------------------------------------------------------------------
Document root [/home/test/www/*******.jp]: 
'/home/test/www' directory created
'/home/test/www/*******.jp' directory created
===============================================
==                                           ==
==  Please verify the following information  ==
==                                           ==
===============================================

        docroot
        =======
        /home/test/www/*******.jp

Is the information correct? [y]: 

--------------------------------------------------------------------------------
--                                filename  => '',                            --
--                                userperm  => '',                            --
--                                grpperm   => '',                            --
--                                                                            --
--                           T R A N S F E R   L O G                          --
--                                                                            --
--   Please select a location for your transfer logs for this virtual host.   --
--       Transfer logs record HTTP traffic to your host, including file       --
--                          requests and other data.                          --
--                                                                            --
--   For security reasons, Apache logs should never be placed in a directory  --
--  writable by anyone other than root. Placing logs in a directory writable  --
--      by a regular user may lead to elevated privileges for that user.      --
--                                                                            --
--   Because Apache opens its log files with root permissions, putting them   --
--       in a directory writable by a non-root user can compromise your       --
--    system's security. If you are uncertain about where to keep users log   --
--   files, select the default location (which will keep them in a location   --
--           where the user can read them but cannot write to them).          --
--                                                                            --
--    Please see http://httpd.apache.org/docs/logs.html for more details on   --
--                     selecting locations for log files.                     --
--                                                                            --
--                  Hit  to accept the default value.                 --
--------------------------------------------------------------------------------

Please select one of the following transfer log options for this
virtual host. If you specify a custom path, it is strongly recommended
NOT to place the logs in any location that the user can write to them.

    1) no transfer log
    2) log to server transfer log
       (/var/log/httpd/access_log)
    3) log to combined virtual host log
       (/var/log/httpd/test/access_log)
    4) log to separate virtual host log
       (/var/log/httpd/test/*******.jp-access_log)

Please select a logging option [4]: 
'/var/log/httpd/test/' directory created
===============================================
==                                           ==
==  Please verify the following information  ==
==                                           ==
===============================================

        transferlog
        ===========
        (separate virtual host log)

Is the information correct? [y]: 

--------------------------------------------------------------------------------
--                                filename  => '',                            --
--                                userperm  => '',                            --
--                                grpperm   => '',                            --
--                                errorlog  => '',                            --
--                                                                            --
--                              E R R O R   L O G                             --
--                                                                            --
--     Please select a location for your error logs for this virtual host.    --
--     Error logs record HTTP traffic errors to your host, including file     --
--    requests and other data as well as any output sent to stderr (program   --
--                               failures, etc.)                              --
--                                                                            --
--   For security reasons, Apache logs should never be placed in a directory  --
--  writable by anyone other than root. Placing logs in a directory writable  --
--      by a regular user may lead to elevated privileges for that user.      --
--                                                                            --
--   Because Apache opens its log files with root permissions, putting them   --
--       in a directory writable by a non-root user can compromise your       --
--    system's security. If you are uncertain about where to keep users log   --
--   files, select the default location (which will keep them in a location   --
--           where the user can read them but cannot write to them).          --
--                                                                            --
--    Please see http://httpd.apache.org/docs/logs.html for more details on   --
--                     selecting locations for log files.                     --
--                                                                            --
--                  Hit  to accept the default value.                 --
--------------------------------------------------------------------------------

Please select one of the following error log options for this virtual
host. If you specify a custom path, it is strongly recommended NOT to
place the logs in any location that the user can write to them.

    1) no error log
    2) log to server error log
       (/var/log/httpd/error_log)
    3) log to combined virtual host error log
       (/var/log/httpd/test/error_log)
    4) log to separate virtual host error log
       (/var/log/httpd/test/*******.jp-error_log)

Please select a logging option [4]: 
===============================================
==                                           ==
==  Please verify the following information  ==
==                                           ==
===============================================

        errorlog
        ========
        (separate virtual host error log)

Is the information correct? [y]: 

--------------------------------------------------------------------------------
--                                                                            --
--                         C G I - B I N   A C C E S S                        --
--                                                                            --
--   Please select an option below for CGI execution for this virtual host.   --
--     CGI is a means whereby the Apache web server will execute commands     --
--       (i.e., programs on the web server) on behalf of the web client.      --
--                                                                            --
--                  Hit  to accept the default value.                 --
--------------------------------------------------------------------------------

Please select one of the following cgi-bin paths for this virtual
host.

    1) no CGI access
    2) use server cgi-bin
    3) use server cgi-bin and virtual host cgi-local
    4) use virtual host cgi-bin

Please select a cgi-bin option [4]: 
/home/test/www/cgi-bin directory created
===============================================
==                                           ==
==  Please verify the following information  ==
==                                           ==
===============================================

        cgibin
        ======
        (use virtual host cgi-bin)

Is the information correct? [y]: 
============================================================
==                                                        ==
==                      C O N F I R M                     ==
==                                                        ==
==     Please confirm the following virtual host entry    ==
==                                                        ==
============================================================

## vaddhost: (*******.jp) at *:80

    SSLEngine off
    SuexecUserGroup test test
    ServerName     *******.jp
    ServerAlias    www.*******.jp
    ServerAdmin    info@*******.jp
    DocumentRoot   /home/test/www/*******.jp
    ScriptAlias    /cgi-bin/ "/home/test/www/cgi-bin/"
    
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
    
    CustomLog      /var/log/httpd/test/*******.jp-access_log combined
    ErrorLog       /var/log/httpd/test/*******.jp-error_log


## vaddhost: (*******.jp) at *:443

    SSLEngine on
    SuexecUserGroup test test
    ServerName     *******.jp
    ServerAlias    www.*******.jp
    ServerAdmin    info@*******.jp
    DocumentRoot   /home/test/www/*******.jp
    ScriptAlias    /cgi-bin/ "/home/test/www/cgi-bin/"
    
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
    
    CustomLog      /var/log/httpd/test/*******.jp-access_log combined
    ErrorLog       /var/log/httpd/test/*******.jp-error_log


Create the preceding virtual host entry? [y]: 
Restart Apache now? [y]: 

Syntax OK

============================================================
==                                                        ==
==           New virtual host entry successfully          ==
==          written to Apache configuration file          ==
==                                                        ==
============================================================

SquirrelMail 送受信テスト


http://www.*******.jp/webmail/ にアクセスし test アカウントでログインしました。


info@*******.jp のメールが閲覧できることを確認しました。


「オプション」「個人情報」「メールアドレス」で info@*******.jp を設定し、外部への送信テストを行いました。
送信先にメールが到着し、From が info@*******.jp になっていることを確認しました。

SPEEDEX サポートポリシー

Copyright @ Cyber Vision Hosting Co., Ltd. All rights reserved.
Email: support@speedex.ne.jp


株式会社サイバービジョンホスティング提供サービス一覧
再販売用レンタルサーバーのSPEEDEX | VPS(仮想専用サーバー) | 共用サーバー | 独自ドメイン取得・運用 | SSLサーバー証明書 | ワイルドカードサーバー証明書 | SEO | Google Apps(TM) | クリエイティブワークの検索エンジン