리눅스 짐브라(zimbra) 웹메일 서버 구축 방법

프로그램명 : Zimbra
운영체제 : Linux
홈페이지 : http://www.zimbra.com/
라이센스 : 공개 소스(zlib 라이선스)

1. 리눅스 짐브라란 무엇인가?

vmware Zimbra는 이메일, 일정, 연락처, 파일 저장소, Desktop 싱크 기능을 제공하는 협업 프로그램이다. 또한 스마트폰에서 접속할 수 있도록 모바일 웹 인터페이스 또한 제공한다.

Zimbra는 내부적으로 Postfix, OpenLDAP, MySQL, Lucene, ClameAV, SpamAssassin 등과 같은 표준적으로 쓰이는 여러 오픈소스를 통합하여 구성되어 있다.

설치 이후의 용량이 약 3GB에 달할정도로 조금 덩치가 큰 편이기는 하지만, 기존에 Sendmail이나 Postfix, Qmail 설치 후 POP, IMAP 연동, 웹메일 프로그램 설치순으로 이루어지는 복잡한 과정이 없이 간단히 설치가 가능한 장점이 있다.

이러한 장점을 가지고 있지만, 국내에서는 이렇다할 설치 가이드 및 문서가 없는것 같아 이번에 소개를 해볼려고 한다.

2. 짐브라(zimbra) 설치

Os: centos 5.8 i386(32bit)

Version : zcs-7.1.0_GA_3140.RHEL5.20110329150824.tgz

Downloard : http://www.zimbra.com/downloads/os-archives-downloads.html

1) 필요 라이브 러리 설치

yum -y install gcc-c++
yum -y install gcc
yum -y install make
yum -y install wget
yum -y install libtermcap-devel ncurses-devel
yum -y install make cmake
yum -y install gcc g++ cpp gcc-c++
yum -y install perl
yum -y install ncurses-devel
yum -y install bison
yum -y install zlib curl
yum -y install openssl openssl-devel
yum -y install bzip2-devel
yum -y install libtermcap-devel libc-client-devel
yum -y install wget unzip
yum -y install gmp sysstat

2) sendmail 실행 중단

service sendmail stop
chkconfig sendmail off

또한 Zimbra를 설치할 서버에 웹서버(Port 80번)가 구동중이라면 다른 포트로 변경한다.
참고로 Zimbra에서 사용하는 포트는 아래와 같습니다. 이미 사용중인 포트가 있다면 변경하거나 중단해야된다.

3) 짐브라 설치시 기본 사용 Port

Remote Queue Manager : 22
Postfix : 25
HTTP : 80
POP3 : 110
IMAP : 143
LDAP : 389
HTTPS : 443
Mailboxd IMAP SSL : 993
Mailboxd POP SSL : 995
Mailboxd LMTP : 7025

4) 메일서버 호스트 이름 설정

설치할 리눅스 서버의 호스트 이름이 다음과 같이 설정되어 있는지 확인한다. 당연히 DNS서버의 MX레코드에 등록이 되어있어야 된다. 본 글에서는 DNS관련한 내용은 설명하지는 않는다.

[root@mail zcs-7.1.0_GA_3140.RHEL5.20110329150824]# cat /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mail.ps-ef.net
GATEWAY=210.114.223.1

5) /etc/hosts 파일 설정

아래와 같이 hosts 파일이 설정한다.

[root@mail zcs-7.1.0_GA_3140.RHEL5.20110329150824]# cat /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

210.114.223.192 mail.ps-ef.net mail

6) 소스파일 다운로드

wget http://files2.zimbra.com/downloads/7.1.0_GA/zcs-7.1.0_GA_3140.RHEL5.20110329150824.tgz
tar xvf zcs-7.1.0_GA_3140.RHEL5.20110329150824.tgz
cd zcs-7.1.0_GA_3140.RHEL5.20110329150824

7) 짐브라 설치 실행

[root@mail zcs-7.1.0_GA_3140.RHEL5.20110329150824]# sh install.sh --platform-override

관련 패키지를 검색중에 설치가 안안되어있다는 항목이 나타남

Operations logged to /tmp/install.log.3126
Checking for existing installation...
zimbra-ldap...NOT FOUND
zimbra-logger...NOT FOUND
zimbra-mta...NOT FOUND
zimbra-snmp...NOT FOUND
zimbra-store...NOT FOUND
zimbra-apache...NOT FOUND
zimbra-spell...NOT FOUND
zimbra-convertd...NOT FOUND
zimbra-memcached...NOT FOUND
zimbra-proxy...NOT FOUND
zimbra-archiving...NOT FOUND
zimbra-cluster...NOT FOUND
zimbra-core...NOT FOUND

PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE.
ZIMBRA, INC. ("ZIMBRA") WILL ONLY LICENSE THIS SOFTWARE TO YOU IF YOU
FIRST ACCEPT THE TERMS OF THIS AGREEMENT. BY DOWNLOADING OR INSTALLING
THE SOFTWARE, OR USING THE PRODUCT, YOU ARE CONSENTING TO BE BOUND BY
THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS
AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL OR USE THE PRODUCT.

License Terms for the Zimbra Collaboration Suite:
http://www.zimbra.com/license/zimbra_public_eula_2.1.html
Do you agree with the terms of the software license agreement? [N] y
Checking for prerequisites...
FOUND: NPTL
FOUND: sudo-1.7.2p1-13
FOUND: libidn-0.6.5-1.1
FOUND: gmp-4.1.4-10
FOUND: /usr/lib/libstdc++.so.6
Checking for suggested prerequisites...
FOUND: perl-5.8.8
FOUND: sysstat
FOUND: sqlite
Prerequisite check complete.

Checking for installable packages

Found zimbra-core
Found zimbra-ldap
Found zimbra-logger
Found zimbra-mta
Found zimbra-snmp
Found zimbra-store
Found zimbra-apache
Found zimbra-spell
Found zimbra-memcached
Found zimbra-proxy

Select the packages to install

Install zimbra-ldap [Y]
Install zimbra-logger [Y] y
Install zimbra-mta [Y] y
Install zimbra-snmp [Y] y
Install zimbra-store [Y] y
Install zimbra-apache [Y] y
Install zimbra-spell [Y] y
Install zimbra-memcached [N] y
Install zimbra-proxy [N] y

일반적인 환경에서는 필요없는 패키지를 설치를 안해줘도 되지만 이왕이면 모두 설치 진행한다.

Checking required space for zimbra-core
checking space for zimbra-store

Installing:
zimbra-core
zimbra-ldap
zimbra-logger
zimbra-mta
zimbra-snmp
zimbra-store
zimbra-apache
zimbra-spell
zimbra-memcached
zimbra-proxy

You appear to be installing packages on a platform different
than the platform for which they were built.

This platform is CentOS5
Packages found: RHEL5
This may or may not work.

Using packages for a platform in which they were not designed for
may result in an installation that is NOT usable. Your support
options may be limited if you choose to continue.

Install anyway? [N] y
The system will be modified. Continue? [N] y
Removing /opt/zimbra
Removing zimbra crontab entry...done.
done.
Cleaning up zimbra init scripts...done.
Cleaning up /etc/ld.so.conf...done.
Cleaning up /etc/prelink.conf...done.
Cleaning up /etc/security/limits.conf...done.
Finished removing Zimbra Collaboration Suite.

Installing packages
zimbra-core......zimbra-core-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done
zimbra-ldap......zimbra-ldap-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done
zimbra-logger......zimbra-logger-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done
zimbra-mta......zimbra-mta-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done
zimbra-snmp......zimbra-snmp-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done
zimbra-store......zimbra-store-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done
zimbra-apache......zimbra-apache-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done
zimbra-spell......zimbra-spell-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done
zimbra-memcached......zimbra-memcached-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done
zimbra-proxy......zimbra-proxy-7.1.0_GA_3140.RHEL5-20110329150824.i386.rpm...done

Operations logged to /tmp/zmsetup.02072014-171558.log
Installing LDAP configuration database...done.
Setting defaults...

DNS ERROR resolving MX for mail.ps-ef.net
It is suggested that the domain name have an MX record configured in DNS

도메인 변경을 해줘야 된다.

이부분에서 도메인을 변경해주지 않으면, admin@mail.ps-ef.net 와 같은 서브도메인을 사용하는 꼴이 되버린다.

정확한 도메인으로 수정.

Change domain name? [Yes] yes
Create domain: [mail.ps-ef.net] ps-ef.net
MX: mail.ps-ef.net (210.114.223.192)
Interface: 210.114.223.192
Interface: 127.0.0.1
done.
Checking for port conflicts

정상적으로 MX 레코드값을 확인이 가능해졌다.(DNS에서 이부분은 미리 설정이 되어있어야된다.)

Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
+Create Admin User: yes
+Admin user to create: admin@ps-ef.net
******* +Admin Password UNSET
+Anti-virus quarantine user: virus-quarantine.ca7ovwmko@ps-ef.net
+Enable automated spam training: yes
+Spam training user: spam.dclvwzqamo@ps-ef.net
+Non-spam(Ham) training user: ham.90vqf3iex@ps-ef.net
+SMTP host: mail.ps-ef.net
+Web server HTTP port: 80
+Web server HTTPS port: 443
+Web server mode: http
+IMAP server port: 7143
+IMAP server SSL port: 7993
+POP server port: 7110
+POP server SSL port: 7995
+Use spell check server: yes
+Spell server URL: http://mail.ps-ef.net:7780/aspell.php
+Enable version update checks: TRUE
+Enable version update notifications: TRUE
+Version update notification email: admin@ps-ef.net
+Version update source email: admin@ps-ef.net
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) zimbra-proxy: Enabled
9) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit

Address unconfigured (**) items (? - help) 3

Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@ps-ef.net
** 4) Admin Password UNSET
5) Anti-virus quarantine user: virus-quarantine.ngn76dth@ps-ef.net
6) Enable automated spam training: yes
7) Spam training user: spam.feh2zm1ke@ps-ef.net
8) Non-spam(Ham) training user: ham.kqqbhmfx5@ps-ef.net
9) SMTP host: mail.ps-ef.net
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: http
13) IMAP server port: 7143
14) IMAP server SSL port: 7993
15) POP server port: 7110
16) POP server SSL port: 7995
17) Use spell check server: yes
18) Spell server URL: http://mail.ps-ef.net:7780/aspell.php
19) Enable version update checks: TRUE
20) Enable version update notifications: TRUE
21) Version update notification email: admin@ps-ef.net
22) Version update source email: admin@ps-ef.net

Select, or 'r' for previous menu [r] 4

기본 관리자(admin)패스워드 변경을 해줌.

Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@ps-ef.net
4) Admin Password set
5) Anti-virus quarantine user: virus-quarantine.ngn76dth@mail.ps-ef.net
6) Enable automated spam training: yes
7) Spam training user: spam.feh2zm1ke@ps-ef.net
8) Non-spam(Ham) training user: ham.kqqbhmfx5@ps-ef.net
9) SMTP host: mail.ps-ef.net
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: http
13) IMAP server port: 7143
14) IMAP server SSL port: 7993
15) POP server port: 7110
16) POP server SSL port: 7995
17) Use spell check server: yes
18) Spell server URL: http://mail.ps-ef.net:7780/aspell.php
19) Enable version update checks: TRUE
20) Enable version update notifications: TRUE
21) Version update notification email: admin@ps-ef.net
22) Version update source email: admin@ps-ef.net

Select, or 'r' for previous menu [r] r

Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) zimbra-proxy: Enabled
9) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit

*** CONFIGURATION COMPLETE - press 'a' to apply
Select from menu, or press 'a' to apply config (? - help) a
Save configuration data to a file? [Yes] yes
Save config in file: [/opt/zimbra/config.11937]
Saving config in /opt/zimbra/config.11937...done.
The system will be modified - continue? [No] yes
Operations logged to /tmp/zmsetup.02072014-182254.log
Setting local config values...done.
Setting up CA...done.
Deploying CA to /opt/zimbra/conf/ca ...done.
Creating SSL certificate...done.
Installing mailboxd SSL certificates...done.
Initializing ldap...done.
Setting replication password...done.
Setting Postfix password...done.
Setting amavis password...done.
Setting nginx password...done.
Creating server entry for mail.ps-ef.net...done.
Saving CA in ldap ...done.
Saving SSL Certificate in ldap ...done.
Setting spell check URL...done.
Setting service ports on mail.ps-ef.net...done.
Adding mail.ps-ef.net to zimbraMailHostPool in default COS...done.
Installing webclient skins...
tree...done.
lemongrass...done.
hotrod...done.
beach...done.
lavender...done.
steel...done.
bones...done.
bare...done.
sky...done.
waves...done.
smoke...done.
carbon...done.
twilight...done.
sand...done.
lake...done.
pebble...done.
oasis...done.
Finished installing webclient skins.
Setting zimbraFeatureTasksEnabled=TRUE...done.
Setting zimbraFeatureBriefcasesEnabled=TRUE...done.
Setting MTA auth host...done.
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mail.ps-ef.net...done.
Creating domain ps-ef.net...done.
Setting default domain name...done.
Creating domain ps-ef.net...already exists.
Creating admin account admin@ps-ef.net...done.
Creating root alias...done.
Creating postmaster alias...done.
Creating user spam.dclvwzqamo@ps-ef.net...done.
Creating user ham.90vqf3iex@ps-ef.net...done.
Creating user virus-quarantine.ca7ovwmko@ps-ef.net...done.
Setting spam training and Anti-virus quarantine accounts...done.
Initializing store sql database...done.
Setting zimbraSmtpHostname for mail.ps-ef.net...done.
Configuring SNMP...done.
Checking for default IM conference room...not present.
Initializing default IM conference room...done.
Setting up syslog.conf...done.

You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Suite.
The only information that will be transmitted is:
The VERSION of zcs installed (7.1.0_GA_3140_CentOS5)
The ADMIN EMAIL ADDRESS created (admin@ps-ef.net)

짐브라 설치 과정 정보를 전송하지 않도록 한다. 해줘도 상관은 없다.

Notify Zimbra of your installation? [Yes] no

Notification complete

Starting servers...done.
Installing common zimlets...
com_zimbra_attachmail...done.
com_zimbra_webex...done.
com_zimbra_phone...done.
com_zimbra_dnd...done.
com_zimbra_cert_manager...done.
com_zimbra_date...done.
com_zimbra_srchhighlighter...done.
com_zimbra_url...done.
com_zimbra_adminversioncheck...done.
com_zimbra_linkedin...done.
com_zimbra_social...done.
com_zimbra_bulkprovision...done.
com_zimbra_attachcontacts...done.
com_zimbra_email...done.
Finished installing common zimlets.
Restarting mailboxd...done.
Setting up zimbra crontab...done.

Moving /tmp/zmsetup.02072014-182254.log to /opt/zimbra/log

Configuration complete - press return to exit

설치 완료 된 모습이다.

중간에 에러 메시지가 보이면.. 설치중 관련 프로그램 미설치나..hostname 부분. 등등

잘 살펴봐야된다. 아니면 삽질의 연속을..

Zimbra는 zimbra 계정으로 설치 및 실행된다.

zimbra 계정으로 전환한 후 zmcontrol status를 명령을 하여 구동중인지 확인해본다.

[root@mail zcs-7.1.0_GA_3140.RHEL5.20110329150824]# su - zimbra

[zimbra@mail ~]$ zmcontrol status

Host mail.ps-ef.net
antispam Running
antivirus Running
imapproxy Running
ldap Running
logger Running
mailbox Stopped
mysql.server is not running.
memcached Running
mta Running
snmp Running
spell Stopped
zmapachectl is not running
stats Stopped
zmconfigd Running
[zimbra@mail ~]$

에러 메시지가 나오는 현상을 볼수있을 것이다. 물론 에러 현상이 안보이고 성공한 사람들에게 박수를 보낸다.

에러부분을 잡아야되는데, 자세히 보니.. DB 가 올라가지 않는 현상때문에 그 밑에 spell 도 함께 에러가 발생된듯 싶다.

[zimbra@mail ~]$ exit
logout

[root@mail ~]# setenforce 0
[root@mail ~]# su - zimbra
[zimbra@mail ~]$ rm -rf /opt/zimbra/db/data/*

[zimbra@mail ~]$ /opt/zimbra/libexec/zmmyinit
* Creating required directories
* Generating mysql config /opt/zimbra/conf/my.cnf
* Creating database in /opt/zimbra/db/data
* Starting mysql server
* Loading schema /opt/zimbra/db/db.sql
* Loading version from /opt/zimbra/db/versions-init.sql
* Setting random passwd for mysql root user in zimbra localconfig
* Setting random passwd for mysql zimbra user in zimbra localconfig
* Changing mysql root user password
* Changing mysql zimbra user password
* Changed zimbra mysql user password

[zimbra@mail ~]$ zmcontrol start
Host mail.ps-ef.net
Starting ldap...Done.
Starting zmconfigd...Done.
Starting logger...Done.
Starting mailbox...Done.
Starting memcached...Done.
Starting imapproxy...Done.
Starting antispam...Done.
Starting antivirus...Done.
Starting snmp...Done.
Starting spell...Done.
Starting mta...Done.
Starting stats...Done.

[zimbra@mail ~]$ zmcontrol status
Host mail.ps-ef.net
antispam Running
antivirus Running
imapproxy Running
ldap Running
logger Running
mailbox Running
memcached Running
mta Running
snmp Running
spell Running
stats Running
zmconfigd Running

[zimbra@mail ~]$

성공이다.

/etc/init.d/iptables stop

iptables 을 중단하거나, zimbra 관련 해당 port 열어줘야지 정상적으로 사이트가 열린다.

http://mail.ps-ef.net

정상적으로 접근이 가능하면 성공!

아래는 짐브라 접속 화면.

기본 html 방식으로 봤을때. 고급형으로 보면 더 좋음!!(익스플로러 8.0에서는 고급형은 지원이 안되는듯.)

꼭 네이버나 다음과 같은 일부 포털 사이트의 메일 확인 서비스랑 비교할때 전혀 부족함이 없다. 물론 보안적인 면에서는 많이 부족할수 있다.

아래는 스마트폰으로 메일 확인하는 모습이다.

3. 짐브라 설치를 마치며

이번 짐브라를 설치하면서, 이렇게 편하고, 가벼운 웹메일 솔류션 프로그램이 있다는걸 세삼 깨닿게 되었다. 기존 sendmail(센드메일) 같은 경우는 설치는 쉬울수 있겠지만, 보안문제부터 사용자 측면에서 아웃룩이나 썬더버드와 같은 별도의 MTA 프로그램이 필요하고, 또한 스마트폰에서도 별도의 설정 등을 해줘야되는 불편함이 많다.

또한 센드메일과 잘 알려지는 qmail(큐메일) 같은 경우에는 설치과정이 너무 복잡하고, 설치중간에 한번끊기게되면, 새로 설치하거나, 혹시 시스템을 재설치를 해야되는 불편함이 있고, 센드메일처럼 자체 웹메일 시스템이 없기 때문에, 별도의 아웃룩과 같은 프로그램을 사용해야 된다.

하지만 짐브라는 이 모든것을 통합한 웹메일 솔류션 프로그램이기 때문에, 별도의 MTA프로그램 같은것이 필요 없다. 그리고 일반 PC 나 스마트폰으로 웹사이트 접근을 하여메일을 확인할수 있기 때문에 사용자는 어떠한 환경에서는 인터넷만 된다면, 메일 확인이 가능하다.

기회가 된다면, 자신의 조직내에 짐브라를 설치해서 운영해보는것도 좋을것 같다.

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다