ubuntu部署zimbra邮件系统

下载:
chenwei@119-81-29-73:~$ wget http://files2.zimbra.com/downloads/8.0.6_GA/zcs-8.0.6_GA_5922.UBUNTU12_64.20131203103702.tgz
–2014-03-13 15:20:08–  http://files2.zimbra.com/downloads/8.0.6_GA/zcs-8.0.6_GA_5922.UBUNTU12_64.20131203103702.tgz
Resolving files2.zimbra.com (files2.zimbra.com)… 58.26.185.33, 58.26.185.10
Connecting to files2.zimbra.com (files2.zimbra.com)|58.26.185.33|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 778458807 (742M) [binary/octet-stream]
Saving to: `zcs-8.0.6_GA_5922.UBUNTU12_64.20131203103702.tgz’

100%[===================================================================================================================================================================================================>] 778,458,807 5.41M/s   in 2m 21s  

2014-03-13 15:22:30 (5.26 MB/s) – `zcs-8.0.6_GA_5922.UBUNTU12_64.20131203103702.tgz’ saved [778458807/778458807]
解压:
tar zxvf zcs-8.0.6_GA_5922.UBUNTU12_64.20131203103702.tgz ;cd  zxvf zcs-8.0.6_GA_5922.UBUNTU12_64.20131203103702

安装:

sudo ./install.sh

下面是安装过程:

chenwei@119-81-29-73:~/zcs-8.0.6_GA_5922.UBUNTU12_64.20131203103702$ sudo ./install.sh 

Operations logged to /tmp/install.log.23715
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.4.html

Do you agree with the terms of the software license agreement? [N] 

一直选择输入Y安装,直到:

Do you agree with the terms of the software license agreement? [N] y

Checking for prerequisites…
     FOUND: NPTL
     FOUND: netcat-openbsd-1.89-4ubuntu1
     FOUND: sudo-1.8.3p1-1ubuntu3.4
     FOUND: libidn11-1.23-2
     FOUND: libpcre3-8.12-4
     MISSING: libgmp3c2
     FOUND: libexpat1-2.0.1-7.2ubuntu1.1
     FOUND: libstdc++6-4.6.3-1ubuntu5
     FOUND: libperl5.14-5.14.2-6ubuntu2.3

Checking for suggested prerequisites…
     MISSING: pax does not appear to be installed.
     FOUND: perl-5.14.2
     FOUND: sysstat
     MISSING: sqlite3 does not appear to be installed.

###WARNING###

The suggested version of one or more packages is not installed.
This could cause problems with the operation of Zimbra.

Do you wish to continue? [N] y

###ERROR###

One or more prerequisite packages are missing.
Please install them before running this installer.

Installation cancelled.

有两个包没有安装上导致安装失败,现在安装那两个包  libgmp3c2  sqlite3 pax

执行 sudo apt-get install  libgmp3c2  sqlite3 安装

安装完后重新sudo ./install

过程如下:选择你需要安装的程序,输入Y

Do you agree with the terms of the software license agreement? [N] y

Checking for prerequisites…
     FOUND: NPTL
     FOUND: netcat-openbsd-1.89-4ubuntu1
     FOUND: sudo-1.8.3p1-1ubuntu3.4
     FOUND: libidn11-1.23-2
     FOUND: libpcre3-8.12-4
     FOUND: libgmp3c2-2:4.3.2+dfsg-2ubuntu1
     FOUND: libexpat1-2.0.1-7.2ubuntu1.1
     FOUND: libstdc++6-4.6.3-1ubuntu5
     FOUND: libperl5.14-5.14.2-6ubuntu2.3

Checking for suggested prerequisites…
     MISSING: pax does not appear to be installed.
     FOUND: perl-5.14.2
     FOUND: sysstat
     FOUND: sqlite3

###WARNING###

The suggested version of one or more packages is not installed.
This could cause problems with the operation of Zimbra.

Do you wish to continue? [N] y
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] 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

The system will be modified.  Continue? [N] y

Removing /opt/zimbra
Removing zimbra crontab entry…done.
Cleaning up zimbra init scripts…done.
Cleaning up /etc/ld.so.conf…done.
Cleaning up /etc/security/limits.conf…done.

Finished removing Zimbra Collaboration Server.

Installing packages

    zimbra-core……zimbra-core_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
    zimbra-ldap……zimbra-ldap_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
    zimbra-logger……zimbra-logger_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
    zimbra-mta……zimbra-mta_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
    zimbra-snmp……zimbra-snmp_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
    zimbra-store……zimbra-store_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
    zimbra-apache……zimbra-apache_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
    zimbra-spell……zimbra-spell_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
    zimbra-memcached……zimbra-memcached_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
    zimbra-proxy……zimbra-proxy_8.0.6.GA.5922.UBUNTU12.64_amd64.deb…done
Operations logged to /tmp/zmsetup.03132014-160453.log
Installing LDAP configuration database…done.
Setting defaults…No results returned for A lookup of 119-81-29-73.video.raidcall.com.tw
Checked nameservers:
        10.0.80.11
        10.0.80.12
No results returned for AAAA lookup of 119-81-29-73.video.raidcall.com.tw
Checked nameservers:
        10.0.80.11
        10.0.80.12

DNS ERROR resolving 119-81-29-73.video.raidcall.com.tw
It is suggested that the hostname be resolvable via DNS
Change hostname [Yes] 
DNS ERROR resolving 119-81-29-73.video.raidcall.com.tw
It is suggested that the hostname be resolvable via DNS
Change hostname [Yes] no

DNS ERROR resolving MX for 119-81-29-73.video.raidcall.com.tw
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes] no
done.
Checking for port conflicts

Main menu

   1) Common Configuration:                                                  
   2) zimbra-ldap:                             Enabled                       
   3) zimbra-store:                            Enabled                       
        +Create Admin User:                    yes                           
        +Admin user to create:                 admin@119-81-29-73.video.raidcall.com.tw
******* +Admin Password                        UNSET                         
        +Anti-virus quarantine user:           virus-quarantine.yqj9ytwj@119-81-29-73.video.raidcall.com.tw
        +Enable automated spam training:       yes                           
        +Spam training user:                   spam.cdzyd4gf@119-81-29-73.video.raidcall.com.tw
        +Non-spam(Ham) training user:          ham.hfjeurb9@119-81-29-73.video.raidcall.com.tw
        +SMTP host:                            119-81-29-73.video.raidcall.com.tw
        +Web server HTTP port:                 80                            
        +Web server HTTPS port:                443                           
        +Web server mode:                      https                         
        +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://119-81-29-73.video.raidcall.com.tw:7780/aspell.php
        +Enable version update checks:         TRUE                          
        +Enable version update notifications:  TRUE                          
        +Version update notification email:    admin@119-81-29-73.video.raidcall.com.tw
        +Version update source email:          admin@119-81-29-73.video.raidcall.com.tw

   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) 

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

Store configuration

   1) Status:                                  Enabled                       
   2) Create Admin User:                       yes                           
   3) Admin user to create:                    admin@119-81-29-73.video.raidcall.com.tw
** 4) Admin Password                           UNSET                         
   5) Anti-virus quarantine user:              virus-quarantine.yqj9ytwj@119-81-29-73.video.raidcall.com.tw
   6) Enable automated spam training:          yes                           
   7) Spam training user:                      spam.cdzyd4gf@119-81-29-73.video.raidcall.com.tw
   8) Non-spam(Ham) training user:             ham.hfjeurb9@119-81-29-73.video.raidcall.com.tw
   9) SMTP host:                               119-81-29-73.video.raidcall.com.tw
  10) Web server HTTP port:                    80                            
  11) Web server HTTPS port:                   443                           
  12) Web server mode:                         https                         
  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://119-81-29-73.video.raidcall.com.tw:7780/aspell.php
  19) Enable version update checks:            TRUE                          
  20) Enable version update notifications:     TRUE                          
  21) Version update notification email:       admin@119-81-29-73.video.raidcall.com.tw
  22) Version update source email:             admin@119-81-29-73.video.raidcall.com.tw

Select, or ‘r’ for previous menu [r] 4

Password for admin@119-81-29-73.video.raidcall.com.tw (min 6 characters): [UgjRdmqPbC] admin123    

Store configuration

   1) Status:                                  Enabled                       
   2) Create Admin User:                       yes                           
   3) Admin user to create:                    admin@119-81-29-73.video.raidcall.com.tw
   4) Admin Password                           set                           
   5) Anti-virus quarantine user:              virus-quarantine.yqj9ytwj@119-81-29-73.video.raidcall.com.tw
   6) Enable automated spam training:          yes                           
   7) Spam training user:                      spam.cdzyd4gf@119-81-29-73.video.raidcall.com.tw
   8) Non-spam(Ham) training user:             ham.hfjeurb9@119-81-29-73.video.raidcall.com.tw
   9) SMTP host:                               119-81-29-73.video.raidcall.com.tw
  10) Web server HTTP port:                    80                            
  11) Web server HTTPS port:                   443                           
  12) Web server mode:                         https                         
  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://119-81-29-73.video.raidcall.com.tw:7780/aspell.php
  19) Enable version update checks:            TRUE                          
  20) Enable version update notifications:     TRUE                          
  21) Version update notification email:       admin@119-81-29-73.video.raidcall.com.tw
  22) Version update source email:             admin@119-81-29-73.video.raidcall.com.tw

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.15703] 
Saving config in /opt/zimbra/config.15703…done.
The system will be modified – continue? [No] yes
Operations logged to /tmp/zmsetup.03132014-163832.log
Setting local config values…done.
Initializing core config…Setting up CA…done.
Deploying CA to /opt/zimbra/conf/ca …done.
Creating SSL zimbra-store certificate…done.
Creating new zimbra-ldap SSL certificate…done.
Creating new zimbra-mta SSL certificate…done.
Creating new zimbra-proxy SSL certificate…done.
Installing mailboxd SSL certificates…done.
Installing MTA SSL certificates…done.
Installing LDAP SSL certificate…done.
Installing Proxy SSL certificate…done.
Initializing ldap…done.
Setting replication password…done.
Setting Postfix password…done.
Setting amavis password…done.
Setting nginx password…done.
Creating server entry for 119-81-29-73.video.raidcall.com.tw…done.
Setting Zimbra IP Mode…done.
Saving CA in ldap …done.
Saving SSL Certificate in ldap …done.
Setting spell check URL…done.
Setting service ports on 119-81-29-73.video.raidcall.com.tw…done.
Adding 119-81-29-73.video.raidcall.com.tw to zimbraMailHostPool in default COS…done.
Setting zimbraFeatureTasksEnabled=TRUE…done.
Setting zimbraFeatureBriefcasesEnabled=FALSE…done.
Setting MTA auth host…done.
Setting TimeZone Preference…done.
Initializing mta config…done.
Setting services on 119-81-29-73.video.raidcall.com.tw…done.
Creating domain 119-81-29-73.video.raidcall.com.tw…done.
Setting default domain name…done.
Creating domain 119-81-29-73.video.raidcall.com.tw…already exists.
Creating admin account admin@119-81-29-73.video.raidcall.com.tw…done.
Creating root alias…done.
Creating postmaster alias…done.
Creating user spam.cdzyd4gf@119-81-29-73.video.raidcall.com.tw…done.
Creating user ham.hfjeurb9@119-81-29-73.video.raidcall.com.tw…done.
Creating user virus-quarantine.yqj9ytwj@119-81-29-73.video.raidcall.com.tw…done.
Setting spam training and Anti-virus quarantine accounts…done.
Initializing store sql database…done.
Setting zimbraSmtpHostname for 119-81-29-73.video.raidcall.com.tw…done.
Configuring SNMP…done.
Setting up syslog.conf…done.
Starting servers…done.
Installing common zimlets…
        com_zimbra_attachcontacts…done.
        com_zimbra_proxy_config…done.
        com_zimbra_bulkprovision…done.
        com_zimbra_url…done.
        com_zimbra_tooltip…done.
        com_zimbra_date…done.
        com_zimbra_cert_manager…done.
        com_zimbra_clientuploader…done.
        com_zimbra_viewmail…done.
        com_zimbra_adminversioncheck…done.
        com_zimbra_webex…done.
        com_zimbra_email…done.
        com_zimbra_srchhighlighter…done.
        com_zimbra_ymemoticons…done.
        com_zimbra_attachmail…done.
        com_zimbra_phone…done.
Finished installing common zimlets.
Restarting mailboxd…done.
Creating galsync account for default domain…done.

You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Server.
The only information that will be transmitted is:
        The VERSION of zcs installed (8.0.6_GA_5922_UBUNTU12_64)
        The ADMIN EMAIL ADDRESS created (admin@119-81-29-73.video.raidcall.com.tw)
Notify Zimbra of your installation? [Yes] no
Notification skipped
Setting up zimbra crontab…done.

Moving /tmp/zmsetup.03132014-163832.log to /opt/zimbra/log

Configuration complete – press return to exit 

到这里zimbra就安装完成了,之后开始管理和修改具体的配置适合自己使用。

将HTTP登陆方式更改为HTTPHTTPS登陆方式
$ zmprov ms <servername> zimbraMailSSLPort <https port> (将HTTPS更改成非443端口)
$ zmtlsctl httphttps
$ tomcat restart
 
smtp认证错误的解决
zmprov ms `zmhostname` zimbraMtaAuthHost mail.example.com
 
日志服务器错误的解决
$ zmprov getConfig zimbraLogHostname
$ zmprov modifyConfig zimbraLogHostname mail.domain.com
 
查看系统参数
可以通过zmlocalconfig -s命令查看系统的参数
$ postconf                                             //查看postfix的所有配置
$ zmlocalconfig                                        //查看各种组件的配置信息
$ zmlocalconfig -s|grep zimbra_ldap_userdn       //查看zimbra帐号在LDAP中的DN
$ zmlocalconfig -s|grep zimbra_ldap_userdn             //查看zimbra帐号在LDAP中的密码
$ zmlocalconfig -s|grep zimbra_mysql                   //查看mysql的配置信息
 
更改系统最大邮件大小:
查看最大系统邮件大小,显示当前系统最大邮件为10M。
$ postconf message_size_limit
message_size_limit = 10240000
将系统最大邮件大小更改为20M。
$ zmprov modifyConfig zimbraMtaMaxMessageSize 2048000
$ postfix reload
 
更改系统最大附件大小:
将系统中所有帐户允许最大的附件更改为5M
$ zmprov modifyConfig zimbraFileUploadMaxSize 5000000
将系统中mail2.domain.com帐户允许最大的附件更改为20M
$ zmprov modifyServer mail2.domain.com zimbraFileUploadMaxSize 20000000
 
更改管理员密码:
$ zmprov gaaa                      //列出所有管理员
$ zmprov sp <admin email address> <new password>         //更改管理员密码
例如:zmprov sp admin q1w2e3r4 或 zmprov sp admin@wish.com q12e3r4
 
更改LDAP密码:
$ ldap status(start)
$ zmldappasswd –root newpass (root)
$ zmldappasswd newpass         (zimbra)
 
更改MYSQL Database密码:
$ mysql.server status(start)
$ zmmypasswd –root newrootpass
$ zmmypasswd newpass
 
更改Logger MYSQL Database密码:
$ logmysql.server status(start)
$ zmmylogpasswd –root newrootpass  (root)
$ zmmylogpasswd newpass             (zimbra)
 
清空邮箱
$ zmmailbox -z -m rootking@wish.net emptyFolder /[inbox][chats][sent][drafts][junk][trash]
inbox(收件箱)  chats(聊天)  snet(已发送邮件)  drafts(草稿箱)  junk(垃圾邮件)  trash(已删除邮件)
 
备份还原LDAP
1、备份LDAP(两个命令是相等的)
1)、ldapsearch -h 服务器对外的地址 -x -D “uid=zimbra,cn=admins,cn=zimbra” -w 密码 objectclass=* > 201014.ldif
2)、ldapsearch -h 服务器对外的地址 -x -D “uid=zimbra,cn=admins,cn=zimbra” -w 密码 > 201014.ldif
 
2、还原LDAP
ldapadd -h 服务器对外的地址 -x -c -D “uid=zimbra,cn=admins,cn=zimbra” -w 密码 < 20101214.ldif
 
导出导入用户的邮件
#!/bin/bash
while read  USER
do
TODAY=`date`
LOGFILE=”/tmp/bak/backuplog.txt”
echo $TODAY  >> $LOGFILE
echo $USER >> $LOGFILE
/opt/zimbra/bin/zmmailbox -z -m $USER gms >> $LOGFILE
zmmailbox -z -m $USER@test.com getRestURL “//?fmt=tgz” > /tmp/bak/$USER.tgz
done < /tmp/user.txt
 
PS:user.txt里是用户名,不需要跟域名
 
恢复用户的邮件
zmmailbox -z -m $USER@test.com postRestURL “//?fmt=tgz&resolve=reset” tmp/bak/$USER.tgz
 
Zimbra之黑名单、白名单
由于zimbra采用ClamAV 做防病毒软件和SpamAssassin 做反垃圾邮件过滤器,但在WEB控制台中ClamAV+SpamAssassin只有6个调节选项。所以如果要想详细的调节防病毒、反垃圾邮件的功能只有更改相应的配置文件了。
例如调节SpamAssassin的配置文件实现黑名单、白名单的功能。
编辑/opt/zimbra/conf/amavisd.conf.in
寻找下列段落,然后加上你要信任的域:
{ # a hash-type lookup table (associative array)
    ‘nobody@cert.org’                        => -3.0,
    ‘cert-advisory@us-cert.gov’              => -3.0,
    ‘owner-alert@iss.net’                    => -3.0,
    ‘slashdot@slashdot.org’                  => -3.0,
    ‘bugtraq@securityfocus.com’              => -3.0,
    ‘ntbugtraq@listserv.ntbugtraq.com’       => -3.0,
    ‘security-alerts@linuxsecurity.com’      => -3.0,
-10就是无条件信任了,相反+10就是无条件阻挡了。然后存盘,
$ su zimbra
$ zmamavisdctl stop
$ zmamavisdctl start

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>