トップページ > インフォメーション

自宅サーバ構築MY HOME SERVER

ウエブメール(Squirrel Mail) SquirrelMailとプラグインのインストール SquirrelMailの設定 Apacheの設定 ウエブメールのアクセス

- ウエブメール(Squirrel Mail) -

ウエブメールの構築をします。外部ドメインからメールソフト等を使わず、IEからYahooやHotmail等のようにウエブ上で 自宅メールサーバにアクセスして、送受信が可能です。ウエブメールとしてSquirrel Mailをサーバーに組み込みます。 通信内容が読み取られないように暗号化設定もします。ウエブメールのメニュー表示は英語です。慣れれば大丈夫! Σ( ̄▽ ̄ι)



- SquirrelMailのインストール -

Squirrel Mailとプラグインをダウンロードします。

root@hoge123:~# aptitude -y install squirrelmail squirrelmail-compatibility squirrelmail-secure-login squirrelmail-decode squirrelmail-locales



- SquirrelMailの設定 -

SquirrelMailの設定用プログラムを起動して、変更・保存します。

root@hoge123:~# /etc/squirrelmail/conf.pl 

赤文字の部分が入力する内容です。
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 off
S Save data
Q Quit

Command >> 1

SquirrelMail Configuration : Read: config.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 off
S   Save data
Q   Quit

Command >> 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

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

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

Command >> 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. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color off
S   Save data
Q   Quit

Command >> 2

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

General
-------
1.  Domain           : trim(implode('', file('/etc/'.(file_exists('/etc/mailname')?'mail':'host').'name')))
2.  Invert Time            : false
3.  Sendmail or SMTP       : SMTP

A.  Update IMAP Settings   : localhost:143 (uw)
B.  Change Sendmail Config : /usr/sbin/sendmail

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

Command >> 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.

[trim(implode('', file('/etc/'.(file_exists('/etc/mailname')?'mail':'host').'name')))]: hoge123.ddo.jp

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

General
-------
1.  Domain                 : hoge123.ddo.jp
2.  Invert Time            : false
3.  Sendmail or SMTP       : SMTP

A.  Update IMAP Settings   : localhost:143 (uw)
B.  Change Sendmail Config : /usr/sbin/sendmail

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

Command >> A

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

General
-------
1.  Domain                 : hoge123.ddo.jp
2.  Invert Time            : false
3.  Sendmail or SMTP       : SMTP

A.  Update IMAP Settings   : localhost:143 (uw)
B.  Change Sendmail Config : /usr/sbin/sendmail

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

Command >> 4

This is the hostname where your IMAP server can be contacted.
[localhost]: hoge123.dip.jp  
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : hoge123.ddo.jp
2.  Invert Time            : false
3.  Sendmail or SMTP       : SMTP

IMAP Settings
--------------
4. IMAP Server:		hoge123.dip.jp
5. IMAP Port : 		143
6. Authentication type: 		login
7. Secure IMAP (TLS): 		false
8. Server software: 		other
9. Delimiter : 		detect

B. Update SMTP Settings: 	localhost:25
H. Hide IMAP Server Settings

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

Command >> 8


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.
   bincimap = Binc IMAP server
   courier= Courier IMAP server
   cyrus= Cyrus IMAP server
   dovecot= Dovecot Secure IMAP server
   exchange= Microsoft Exchange IMAP server
   hmailserver= hMailServer
   macosx= Mac OS X Mailserver
   mercury32= Mercury/32
   uw= University of Washington's IMAP server
   gmail= IMAP access to Google mail (Gmail) accounts
   other= Not one of the above servers
[other]:  dovecot 
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : hoge123.ddo.jp
2.  Invert Time            : false
3.  Sendmail or SMTP       : SMTP

IMAP Settings
--------------
4. IMAP Server: hoge123.dip.jp
5. IMAP Port : 143
6. Authentication type: login
7. Secure IMAP (TLS): false
8. Server software: other
9. Delimiter : detect

B. Update SMTP Settings: localhost:25
H. Hide IMAP Server Settings

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

Command >> B
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1.  Domain                 : hoge123.ddo.jp
2.  Invert Time            : false
3.  Sendmail or SMTP       : SMTP

SMTP Settings
-------------
4. SMTP Server				: localhost
5. SMTP Port				: 25
6. POP before SMTP			: false
7. SMTP Authentication		: none
8. Secure SMTP (TLS)		: false
9. Header encryption key	:

A. Update IMAP Settings		: hoge123.dip.jp:143 (dovecot)
H. Hide SMTP Settings

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

Command >> 4

This is the hostname of your SMTP server.
[localhost]:  hoge123.dip.jp
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain					: hoge123.dip.jp
2. Invert Time				: false
3. Sendmail or SMTP			: SMTP

SMTP Settings
-------------
4. SMTP Server				: hoge123.dip.jp
5. SMTP Port				: 25
6. POP before SMTP			: false
7. SMTP Authentication		: none
8. Secure SMTP (TLS)		: false
9. Header encryption key	:

A. Update IMAP Settings		: hoge123.dip.jp:143 (dovecot)
H. Hide SMTP Settings

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

Command >> 7

If you have already set the hostname and port number, I can try to
automatically detect the mechanisms your SMTP server supports.
Auto-detection is *optional* - you can safely say "n" here.

Try to detect auth mechanisms? [y/N]:  y
Trying to detect supported methods (SMTP)...
Testing none: SUPPORTED
Testing login: SUPPORTED
Testing CRAM-MD5: NOT SUPPORTED
Testing DIGEST-MD5: NOT SUPPORTED

What authentication mechanism do you want to use for SMTP connections?
none - Your SMTP server does not require authorization.
login - Plaintext. If you can do better, you probably should.
cram-md5 - Slightly better than plaintext.
digest-md5 - Privacy protection - better than cram-md5.

*** YOUR SMTP SERVER MUST SUPPORT THE MECHANISM YOU CHOOSE HERE ***
If you don't understand or are unsure, you probably want "none"

none, login, cram-md5, or digest-md5 [none]:  login
SMTP authentication uses IMAP username and password by default.

Would you like to use other login and password for all SquirrelMail
SMTP connections? [y/N]: n
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain 					: hoge123.dip.jp
2. Invert Time				: false
3. Sendmail or SMTP			: SMTP

SMTP Settings
-------------
4. SMTP Server				: hoge123.dip.jp
5. SMTP Port: 25
6. POP before SMTP			: false
7. SMTP Authentication		: login(with IMAP username and password)
8. Secure SMTP (TLS)		: false
9. Header encryption key	:

A. Update IMAP Settings		: hoge123.dip.jp:143 (dovecot)
H. Hide SMTP Settings

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

Command >> 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. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color off
S Save data
Q Quit

Command >> 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			: false

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

Command >> 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 
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			: false

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

Command >> 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
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			: false
R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >> 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. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color off
S Save data
Q Quit

Command >> 4
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
   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 off
S Save data
Q Quit

Command >> 7
Hide SM attributions (y/n) [n]: yes
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
   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 off
S Save data
Q Quit

Command >> 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. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color off
S Save data
Q Quit

Command >> 8
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. secure_login
2. view_as_html

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

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

Command >> 7 # delete_move_next の番号選択(番号は環境により違います)
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. secure_login
2. view_as_html
3. delete_move_next

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

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

Command >> 15 # newmail の番号選択(番号は環境により違います)
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. secure_login
2. view_as_html
3. delete_move_next
4. newmail

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

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

Command >> 8 # compatibility の番号選択(番号は環境により違います)
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. secure_login
2. view_as_html
3. delete_move_next
4. newmail
5. compatibility

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

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

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!




- Apacheの設定 -

ウエブメールなので、Apacheにも設定をする必要があります。
         
root@hoge123:~# vi /etc/apache2/conf.d/SquirrelMail.conf 

- 中は空です。下記内容を貼り付け・保存します。-

Alias /webmail /usr/share/squirrelmail
<Location /webmail>
Order Deny,Allow
Deny from all
Allow from 192.168.0.0/24
</Location>

root@hoge123:~# service apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name,
 using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified
domain name, using 127.0.1.1 for ServerName
                                                                         [ OK ]



- ウエブメールのアクセス -

IEのURLにhoge123.dip.jp/webmail と入力します。自己証明書の関係で、下記証明書エラー表示が出ますが、 「このサイトの閲覧を続行する(推奨されません)」をクリックします。


自動的にhttps://hoge123.dip.jpのURLに変わり、ログイン画面が出てきます。 「ユーザ名」hogehoge と「パスワード」hogehogeのメールパスワードを入力します。fufufuもメールアカウント があるので、fufufuの「ユーザ名」、「パスワード」を入力してログインできます。


ログインした状態です。YahooやHotmailアカウントがあれば、日本語でテスト送信してください。外部メールからも 日本語でテスト送信して、文字化けがなく受信できるか確認します。


自宅サーバ構築(Ubuntu12.04TLS)に戻る


Copyright(C) PCDEMAGIC All Rights Reserved.