Linux Mail

다람쥐메일(squirrelmail) 사용하기

2009.04.09 00:34

jook 조회 수:29323

다람쥐 메일은 무료로 제공되는 웹메일이며, 리눅스상의 sendmail, qmail 등과 호환이 가능하며, 쉽게설치가 가능하다.
다람쥐 메일을 설치하기 위해서는 우선 아래의 패키지가 설치되어 있어야 한다.

- sendmail 또는 qmail
- imap
- apache
- php
- ZendOptimizer

위 패키지들이 설치 되어 있다는 가정하에서, 아래와 같은 순서로 설치를 진행 하면 된다.

다람쥐메일에서 제공되는 여러 확장기능을 사용하기 위해서는 php설치시 아래와 같은 옵션이 포함되어 있어야 한다.
아래의 기능들을 사용하려면, 아래의 옵션을 추가하여 php를 재설치 한 후에 다람쥐메일 설치를 진행 하면된다.

--with-ldap LDAP -> 주소록 사용을 위해 필요
--with-mhash -> 문자 디코딩을 향상
--with-mysql -> 주소록 등을 Mysql 디비에 저장하길 원할때 필요
--with-openssl -> 암호화된 IMAP연결시 필요


1. 다람쥐메일 소스 다운로드.

https://sourceforge.net 에서 squirrelmail을 검색하여 다운로드 받아서 서버에 업로드한다.
squirrelmail-1.4.18.tar.gz, squirrelmail-decode-1.2.tar.gz, ko_KR-1.4.13-20071220.tar.gz 을 다운로드 받는다.

 

2. 압축 해제후, 홈 디렉토리로 사용할 위치에 옮겨 놓는다.

[root@jook src]# pwd
/usr/local/src
[root@jook src]# tar xvzfp squirrelmail-1.4.18.tar.gz | more
squirrelmail-1.4.18/
squirrelmail-1.4.18/class/
squirrelmail-1.4.18/class/index.php
squirrelmail-1.4.18/class/mime/
squirrelmail-1.4.18/class/mime/index.php
squirrelmail-1.4.18/class/mime/Disposition.class.php
squirrelmail-1.4.18/class/mime/SMimeMessage.class.php

 ~ ~

[root@jook src]# mv squirrelmail-1.4.18 /home/squirrelmail

 

3. configure 명령으로 다람쥐메일에서 사용할 환경을 설정한다.

[root@jook src]# cd /home/squirrelmail/
[root@jook squirrelmail]# ./configure

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


- Organization Preferences
Command에서 1을 입력하고, Organization Preferences 설정메뉴로 이동한다.
Organization Preferences 에서는 다람쥐메일 로그인 페이지를 비롯하여, 메인페이지 로고, title 등을 수정 할 수 있다.
default 설정을 그대로 사용해도 되며, 수정이 완료되면 R 을 입력하여 메인메뉴로 이동한다.

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 on
S   Save data
Q   Quit

Command >>


- Server Settings
Command에서 2를 입력한다. 서버관련 설정메뉴로, 메일서버에서 사용할 도메인, 메일서버종류 설정 imap, sendmail 경로 등을 설정한다.
설정 완료후, R을 입력하여 메인 메뉴로 이동한다.

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

General
-------
1.  Domain                 : hwk.co.kr
2.  Invert Time            : false
3.  Sendmail or SMTP       : Sendmail

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

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

Command >>


- Folder Defaults
메일이 저장될 폴더에 관련된 설정을 하는 부분이다. default 설정을 그대로 사용해도 상관없으며, 수정완료 후 R 명령을 입력하여 메인메뉴로 이동한다.

SquirrelMail Configuration : Read: config.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 >>


- General Options
General Options 부분에서는 데이터 디렉토리에 대한 설정만 추가하고 나머지는 디폴트로 사용해도 무관하다.
데이터 디렉토리는 다람쥐메일의 홈디렉토리내에 data, attach 디렉토리를 사용한다.
data 디렉토리는 홈디렉토리 하위에 기본적으로 생성되어 있으며, attach 디렉토리는 생성되어 있지 않기 때문에 디렉토리를 만들어준다.
두 디렉토리는 nobody 권한(apache 실행권한)으로 설정되어 있어야 한다.

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1.  Data Directory               : /home/squirrelmail/data/
2.  Attachment Directory         : /home/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

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

Command >>


- Themes
테마 설정 부분이다. 우선 default 설정을 그대로 사용한다.

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Themes
1.  Change Themes
     Default                                     Plain Blue
     Sand Storm                                  Deep Ocean
     Slashdot                                    Purple
     Forest                                      Ice
     Sea Spray                                   Blue Steel
     Dark Grey                                   High Contrast
     Black Bean Burrito                          Servery
     Maize                                       BluesNews
     Deep Ocean 2                                Blue Grey
     Dompie                                      Methodical
     Greenhouse Effect (Changes)                 In The Pink (Changes)
     Kind of Blue (Changes)                      Monostochastic (Changes)
     Shades of Grey (Changes)                    Spice of Life (Changes)
     Spice of Life - Lite (Changes)              Spice of Life - Dark (Changes)
     Holiday - Christmas                         Darkness (Changes)
     Random (Changes every login)                Midnight
     Alien Glow                                  Dark Green
     Penguin                                     Minimal BW
     Redmond                                     Net Style
     Silver Steel                                Simple Green
     Wood                                        Bluesome
     Simple Green 2                              Simple Purple
     Autumn                                      Autumn 2
     Blue on Blue                                Classic Blue
     Classic Blue 2                              Powder Blue
     Techno Blue                                 Turquoise
2.  CSS File :

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

Command >>


- Address Books
주소록 관련 설정 부분이다. php 설치시에 --with-ldap LDAP 옵션이 추가되어 있어야 하며, 우선 default 설정을 그대로 사용한다.

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Address Books
1.  Change LDAP Servers
2.  Use Javascript Address Book Search          : false
3.  Global file address book                    :
4.  Allow writing into global file address book : false
5.  Allow listing of global file address book   : true
6.  Allowed address book line length            : 2048

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

Command >>


- Message of the Day (MOTD)
로그인 후 보여질 메시지를 설정 할 수 있다. 1번을 선택하여 원하는 메시지를 넣고 그 다음 줄 첫번째 칸에서 @ 를 입력하면 된다.

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Message of the Day (MOTD)


1   Edit the MOTD

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

Command >>


- Plugins
플러그인을 설정하는 부분이다. 설치되어 있는 플러그인과 설치 가능한 플러그인을 보여주며, 해당 플러그인의 번호를 입력하면, 플러그인 상태가 변경된다.

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

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

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

Command >>


- Database
데이터베이스와 관련된 설정 부분이다. 우선 default 설정을 그대로 사용한다.

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Database
1.  DSN for Address Book   :
2.  Table for Address Book : address

3.  DSN for Preferences    :
4.  Table for Preferences  : userprefs
5.  Field for username     : user
6.  Field for prefs key    : prefkey
7.  Field for prefs value  : prefval

8.  DSN for Global Address Book            :
9.  Table for Global Address Book          : global_abook
10. Allow writing into Global Address Book : false
11. Allow listing of Global Address Book   : false

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

Command >>


- Language preferences
언어 설정 부분이다. 아래와 같이 한글로 설정을 변경한다.

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1.  Default Language       : EUC-KR
2.  Default Charset        : ko_KR
3.  Enable lossy encoding  : false

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

Command >>


모든 설정이 완료되었으면, Command >> 에서 S 를 입력하여 저장하고 Q를 입력하여 빠져 나온다.

 

4. data 디렉토리 소유권 변경

- configure 설정시 입력한 data 디렉토리와, attach 디렉토리의 소유권을 nobody(apache 실행권한)로 변경한다.
attach 디렉토리는 생성되어 있지 않기 때문에 생성해 준다.
[root@jook squirrelmail]# mkdir attach
[root@jook squirrelmail]# chown nobody data
[root@jook squirrelmail]# chown nobody attach

 

5. squirrelmail-decode 설치

- 소스파일의 압축을 풀고, install 파일을 실행하면 된다. install 파일을 실행할 때, 다람쥐메일이 설치된 경로를 입력하면 된다.

[root@jook src]# tar xvzfp squirrelmail-decode-1.2.tar.gz
[root@jook src]# cd squirrelmail-decode-1.2
[root@jook squirrelmail-decode-1.2]# ./install
Please enter path to your SquirrelMail installation: /home/squirrelmail

 

6. language pack 설치

- squirrelmail-decode와 같은 방법으로 설치 하면 된다. language pack의 경우는 압축을 풀어 놓을 디렉토리를 미리 생성해 놓고, 압축을 푼다.

[root@jook src]# mkdir ko_KR-1.4.13
[root@jook src]# tar xvzfp ko_KR-1.4.13-20071220.tar.gz -C /usr/local/src/ko_KR-1.4.13
[root@jook src]# cd /usr/local/src/ko_KR-1.4.13
[root@jook ko_KR-1.4.13]# ./install
Please enter path to your SquirrelMail installation: /home/squirrelmail

 

7. 웹메일 가상호스트 설정

아래와 같이 웹메일 apache 가상호스트를 추가하고 apache 데몬을 리스타트 한다.

<Virtualhost 211.239.xxx.xxx>
        ServerAdmin
webmaster@hwk.co.kr
        ServerName mail.hwk.co.kr
        DocumentRoot /home/squirrelmail
        ErrorLog logs/mail.hwk.co.kr-error_log
        CustomLog logs/mail.hwk.co.kr-access_log common
        ScriptAlias /cgi-bin/ "/home/squirrelmail/cgi-bin/"
</VirtualHost>

 

8. 설정 후 테스트 및 웹메일 로그인

설치 완료후 아래와 같이 웹메일 페이지 URL의 src/configtest.php 로 접속하여 설정 테스트를 확인 한다.

ex) http://mail.hwk.co.krsrc/configtest.php

ERROR 부분이 있으면, 에러내용을 확인하고, confiure 설정으로 되돌아가서 수정한다. 플러그인이나, 확장기능 등의 설정 ERROR가 발생하는 것은 무시해도 메일 송,수신에는 이상이 없다.

설정 테스트 완료 후, URL로 접속하여 메일 사용