1、   关闭系统的防火墙和selinux,以防出现异常的问题

确认iptables和ip6tables服务关闭
 
  1. [root@jdserver named]# chkconfig --list |grep tables  
  2. ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off 
  3. iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off 
确认selinux关闭,打开/etc/sysconfig/selinux文件,修改成一下内容:
 
  1. # This file controls the state of SELinux on the system.  
  2. # SELINUX= can take one of these three values:  
  3. #       enforcing - SELinux security policy is enforced.  
  4. #       permissive - SELinux prints warnings instead of enforcing.  
  5. #       disabled - SELinux is fully disabled.  
  6. SELINUX=disabled  
  7. # SELINUXTYPE= type of policy in use. Possible values are:  
  8. #       targeted - Only targeted network daemons are protected.  
  9. #       strict - Full SELinux protection.  
  10. SELINUXTYPE=targeted 
以上设置后需要重启系统。
2、   首先确保OS未开启其他mail服务器,否则会冲突
RedHat Enterprise Linux 5安装时默认会安装sendmail,并启动,需要我们关闭
 
  1. [root@jdserver selinux]# chkconfig --list |grep sendmail  
  2. sendmail        0:off   1:off   2:off   3:off   4:off   5:off   6:off 
  3. [root@jdserver selinux]# service sendmail stop 

 

3、   安装jdmail
 
  1. cd /opt/                                                //安装在/opt目录下  
  2. tar zxvf jdmail_linux_x86_393.tar.gz                    //解压jdmail  
4、   修改jdmail相关shell脚本的路径
/opt/jdmail/startjd.sh
 
  1. #!/bin/sh  
  2.  
  3. JDMAIL_ROOT=/opt/jdmail 
/opt/jdmail/safestart.sh
 
  1. #!/bin/bash  
  2.  
  3. cd /opt/jdmail 
/opt/jdmail/onestart.sh
 
  1. #!/bin/bash  
  2. /opt/jdmail/startjd.sh  
  3. /opt/jdmail/web/bin/startup.sh  
  4. #sleep 3  
  5. #/opt/jdmail/safestart.sh & 
 
/opt/jdmail/shutdown.sh
 
  1. #!/bin/sh  
  2.  
  3. JDMAIL_ROOT=/opt/jdmail 
/opt/jdmail/web/bin/startup.sh
 
  1. #!/bin/sh  
  2. -----------------------------------------------------------------------------  
  3. # Start Script for the CATALINA Server  
  4. #  
  5. # $Id: startup.sh,v 1.3 2002/08/04 18:19:43 patrickl Exp $  
  6. -----------------------------------------------------------------------------  
  7.  
  8. # resolve links - $0 may be a softlink  
  9. PRG="$0" 
  10.  
  11. JAVA_HOME="/opt/jdmail/jdk" 
  12. export JAVA_HOME 
/opt/jdmail/sa/sa_server.sh
 
  1. #!/bin/sh  
  2. SA_ROOT=/opt/jdmail/sa  
  3. export SA_ROOT  
  4.  
  5. PERL_ROOT=/opt/jdmail/perl  
  6. export PERL_ROOT 
5、   jdmail设置为随系统启动
/etc/rc.local文件中加入如下内容:
 
  1. #!/bin/sh  
  2. #  
  3. # This script will be executed *afterall the other init scripts.  
  4. # You can put your own initialization stuff in here if you don't  
  5. # want to do the full Sys V style init stuff.  
  6.  
  7. touch /var/lock/subsys/local 
  8. /opt/jdmail/startjd.sh &  
  9. /opt/jdmail/web/bin/startup.sh & 
6、   关闭反病毒引擎功能,否则jdmail进程启动后会自动退出
反垃圾\发病毒→ClamAV反病毒引擎设置
将病毒库自动升级间隔设置为-1,保存,重启jdmail即可。
 
 
7、   修改金笛邮件系统的登录端口号为80
默认金笛邮件系统的登录端口号为8080,我们便于访问修改为80
配置文件为/opt/jdmail/web/conf/server.xml
 
  1. <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->  
  2.  <Connector port="80" 
  3.             maxThreads="150" minSpareThreads="25" maxSpareThreads="75" 
  4.             enableLookups="false" redirectPort="8443" acceptCount="100" 
  5.             debug="0" connectionTimeout="20000"   
  6.             disableUploadTimeout="true" /> 
10、重启jdmail服务
11、检查jdmail
默认会打开80、25、110、143四个端口。
 
  1. [root@jdserver2 conf]# lsof -i :25  
  2. COMMAND   PID USER   FD   TYPE DEVICE SIZE NODE NAME 
  3. jdmail  18567 root   23u  IPv4 155106       TCP *:smtp (LISTEN)  
  4. jdmail  18571 root   23u  IPv4 155106       TCP *:smtp (LISTEN)  
  5. jdmail  18572 root   23u  IPv4 155106       TCP *:smtp (LISTEN)  
  6. jdmail  18573 root   23u  IPv4 155106       TCP *:smtp (LISTEN)  
  7. jdmail  18574 root   23u  IPv4 155106       TCP *:smtp (LISTEN)  
  8. jdmail  18575 root   23u  IPv4 155106       TCP *:smtp (LISTEN)  
  9. jdmail  18576 root   23u  IPv4 155106       TCP *:smtp (LISTEN)  
  10. jdmail  18577 root   23u  IPv4 155106       TCP *:smtp (LISTEN) 
 
  1. [root@jdserver2 conf]# ps aux |grep web  
  2. root     18583  1.1  9.7 267292 49380 pts/1    Sl   16:01   0:06 /opt/jdmail/jdk/bin/java -Djava.awt.headless=true -Djava.endorsed.dirs=/opt/jdmail/web/common/endorsed -classpath /opt/jdmail/jdk/lib/tools.jar:/opt/jdmail/web/bin/bootstrap.jar:/opt/jdmail/web/bin/commons-logging-api.jar -Dcatalina.base=/opt/jdmail/web -Dcatalina.home=/opt/jdmail/web -Djava.io.tmpdir=/opt/jdmail/web/temp org.apache.catalina.startup.Bootstrap start  
  3. root     18905  0.0  0.1   3924   676 pts/1    R+   16:11   0:00 grep web 
 
  1. [root@jdserver2 conf]# ps aux |grep jdmail  
  2. root     18567  0.1  2.2 428728 11316 pts/1    S    16:01   0:00 ./jdmail  
  3. root     18571  0.0  2.2 428728 11316 pts/1    S    16:01   0:00 ./jdmail  
  4. root     18572  0.0  2.2 428728 11316 pts/1    S    16:01   0:00 ./jdmail  
  5. root     18573  0.0  2.2 428728 11316 pts/1    S    16:01   0:00 ./jdmail  
  6. root     18574  0.0  2.2 428728 11316 pts/1    S    16:01   0:00 ./jdmail  
  7. root     18575  0.0  2.2 428728 11316 pts/1    S    16:01   0:00 ./jdmail  
  8. root     18576  0.0  2.2 428728 11316 pts/1    S    16:01   0:00 ./jdmail  
  9. root     18577  0.0  2.2 428728 11316 pts/1    S    16:01   0:00 ./jdmail 
 
12、登录邮件服务器,默认用户名postmaster,密码为空,域名为root。
13、问题:
(1)、升级jdmail,需要备份accounts目录,然后升级完后覆盖新accounts,这时在jdmail管理界面上是无法看到先前用户和组的,但是这些用户可以正常登录?
需要“重建辅助用户数据库”,
用户管理→ 重建辅助用户数据库
这样用户和组就出现了!
(2)、如果修改了DNS设置(A、MX记录等),那么jdmail需要清除一下dns缓存,否则dns修改后并不会自动更新dns缓存。
rm –rf /opt/jdmail/dnscache/*
 
  1. [root@jdserver2 dnscache]# pwd  
  2. /opt/jdmail/dnscache  
  3. [root@jdserver2 dnscache]# ls  
  4. a  mx  
  5. [root@jdserver2 dnscache]#  
如果不修改的话,默认jdmail的dnscache的生存时间同bind的TTL值,也就是说要等到过了这个时间后dnscache才会自动向bind更新,这样jdmail才会获得修改后的bind记录。
(3)、如果日志一直显示发邮件,可能是因为队列堵塞了,可以删除以下队列,然后重启jdmail
删除/opt/jdmail/spool下面的东西,记得删除后,要建立一个local目录。