1:安装courier-authlib-0.60.5.tar.bz2时,提示出错:configure: error: --with-authMySQL specified but no MySQLclient.so
安装MySQL以后需要做两步处理
1:设置环境变量的路径
echo "export PATH=$PATH:/usr/local/MySQL/bin">>/etc/profile
source /etc/profile
2: echo "/usr/local/MySQL/lib/MySQL ">>/etc/ld.so.conf ; ldconfig -v
这两个步骤的目的是为了后面安装courier-authlib做准备,否则易出现"configure: error: --with-authMySQL specified but no MySQLclient.so".
设置MySQL路径的目的是courier-authlib执行配置脚本时需要使用文件MySQL-config.
3:安装cyrus-sasl:
安装后, 启动服务:
[root@ungeoxliu lib]# /usr/local/sasl2/sbin/saslauthd -a shadow pam -d
测试服务:
[root@ungeoxliu ~]# /usr/local/sasl2/sbin/testsaslauthd -u root -p root811026 ##root811026为linux系统上的root用户对应的密码
3:安装extmail后,发现运行mail.ungeo.net时提示出错:
internal error
解决方法:
将SuexecUserGroup postfix postfix注释掉!
然后在httpd.conf中将User daemon和Group daemon 修改为postfix用户和postfix组!
4:运行mail.ungeo.net时有如下报错:
/var/log/extmail.log not writable:Permission denied
见附件
解决方法:修改/var/log/extmail.log的用户名为postfix:postfix组即可!
4:其中extmail将会用到perl的DBD::mysql和Unix::syslogd功能
安装方法:
cpan
cpan>install DBI
cpan>install DBD::mysql ##注意区分大小写
cpan>install Unix::syslogd
5:后台管理平台登录后,不显示校验码图片!
unix下安装perl GD
perl -MCAPN -e shell
cpan>install GD
出错:
Could not find gdlib-config in the search path. Please install libgd
2.0.28 or higher.
解决办法:如果安装了yum,运行
yum install gd-devel
再在CPAN下安装 install GD
要检测已安装的perl module
可以 perl -e "use GD"
如果没有错误提示,就说明已经装好
安装后提图片即可正常显示!
6:但点击日志显示时却提示出错如下:
Can't locate RRDs.pm in @INC (@INC contains: /var/www/extsuite/extman/libs /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/5.8.8 .) at /var/www/extsuite/extman/libs/Ext/GraphLog.pm line 23.
BEGIN failed--compilation aborted at /var/www/extsuite/extman/libs/Ext/GraphLog.pm line 23. Compilation failed in require at /var/www/extsuite/extman/libs/Ext/MgrApp/ViewLog.pm line 22. BEGIN failed--compilation aborted at /var/www/extsuite/extman/libs/Ext/MgrApp/ViewLog.pm line 22. Compilation failed in require at /var/www/extsuite/extman/cgi/viewlog.cgi line 18.
yum install perl-rrdtool 即可解决!
7:但图片还是不能显示:解决方法:
配置Mailgraph_ext,使用Extman的图形日志:
接下来安装图形日志的运行所需要的软件包Time::HiRes、File::Tail和rrdtool,
前两个可以使用
#cpan
cpan>install Time::HiRes
cpan>install File::Tail 来安装!
rpm -qa | grep rrdtool
如果没有安装,安装rpm即可!
#注意,如果不更改viewlog的属主和属组权限,extman的图形日志将无法显示
有一次 我修改了maildrop后,就不能在发送邮件了。 我将把所有的maildrop相关部分给修改过去了,
但就是忘记修改/tmp/extview文件夹的权限了! 结果造成图片不能正常显示!
8:authdaemond: authmysql: MYSQL_CRYPT_PWFIELD and MYSQL_CLEAR_PWFIELD not set in /etc/authmysqlrc
原因:/etc/authmysqlrc中MYSQL_CRYPT_PWFIELD password 中的关键字MYSQL_CRYPT_PWFIELD 设置错误! 忘记加_
9: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2:
解决方法:ln -s /usr/local/sasl2/lib/sasl2 /etc/sasldb2/
[root@ungeoxliu etc]# ll -ld sasldb2/
drwxr-xr-x 2 root root 4096 Aug 22 15:39 sasldb2/
[root@ungeoxliu etc]# ll -ld sasldb2
lrwxrwxrwx 1 root root 27 Aug 22 16:18 sasldb2 -> /usr/local/sasl2/lib/sasl2 ##做个软连接就可以了!
10:
Aug 22 16:56:49 ungeoxliu postfix/trivial-rewrite[4798]: warning: do not list domain qinghe.com in BOTH mydestination and virtual_mailbox_domains
Aug 23 11:23:20 ungeoxliu postfix/trivial-rewrite[5608]: warning: do not list domain qinghe.com in BOTH mydestination and virtual_mailbox_domains
Aug 23 11:23:20 ungeoxliu pop3d: LOGIN, user=zhang@qinghe.com, ip=[192.168.1.155], port=[52715]
解决方法:注释掉以下几行,
#myhostname = mail.ungeo.net
#myorigin = ungeo.net
#mydomain = ungeo.net
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
并加入:
smtpd_sender_login_maps = mysql:/etc/postfix/mysql_virtual_sender.cf
该文件内容如下:
-
[root@mail postfix]# cat /etc/postfix/mysql_virtual_sender.cf
-
user = extmail
-
password = extmail
-
hosts = localhost
-
dbname = extmail
-
table = mailbox
-
select_field = username
-
where_field = username
-
additional_conditions = AND active = 1
##解决这个问题用了蛮长的时间!
11:错误信息:550 5.1.1 : Recipient address rejected: User unknown in local recipient table##这是forxmail客户端的提示信息
warning: do not list domain qinghe.com in BOTH mydestination and virtual_mailbox_domains ##日志文件中的提示信息
解决方法:
其实mydestination已经被注释掉了,不知道为什么还是有这个提示,只需要将myhostname = qinghe.com 注释掉即可!
12:Aug 23 15:35:07 ungeoxliu postfix/error[5744]: B05E1D2DFDB: to=, relay=none, delay=0.09, delays=0.08/0/0/0.01, dsn=4.3.0, status=deferred (mail transport unavailable)
Aug 23 15:35:07 ungeoxliu postfix/error[5744]: B05E1D2DFDB: to=, relay=none, delay=0.1, delays=0.08/0/0/0.02, dsn=4.3.0, status=deferred (mail transport unavailable)
Aug 23 15:35:07 ungeoxliu postfix/error[5744]: B05E1D2DFDB: to=, relay=none, delay=0.11, delays=0.08/0/0/0.03, dsn=4.3.0, status=deferred (mail transport unavailable)
Aug 23 15:35:12 ungeoxliu pop3d: Connection, ip=[192.168.1.155]
解决方法:
查看master.cf 文件,是否有问题!
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} ##一定要注意第二句前必须有两个空格!
13:安装maildrop后测试
x/qinghe.com/liu/Maildir/, quota=5242880S, options=
Aug 24 08:58:27 ungeoxliu authdaemond: Authenticated: clearpasswd=, passwd=$1$GuAOzviJ$PG4tnRIpHpjcrr0iJWnao.
Aug 24 08:58:27 ungeoxliu postfix/pipe[4314]: B9C28D2DFE0: to=, relay=maildrop, delay=0.82, delays=0.23/0.2/0/0.39, dsn=2.0.0, status=sent (delivered via maildrop service)
Aug 24 08:58:27 ungeoxliu postfix/pipe[4312]: B9C28D2DFE0: to=, relay=maildrop, delay=0.82, delays=0.23/0.2/0/0.39, dsn=2.0.0, status=sent (delivered via maildrop service)
Aug 24 08:58:27 ungeoxliu postfix/pipe[4313]: B9C28D2DFE0: to=, relay=maildrop, delay=0.82, delays=0.23/0.2/0/0.39, dsn=2.0.0, status=sent (delivered via maildrop service)
Aug 24 08:58:27 ungeoxliu postfix/qmgr[4154]: B9C28D2DFE0: removed
有如下结果输出,显然maildrop已经工作了!
14:邮箱迁移:
1: 将原来机器上242 mysql下的extmail压缩,下载到新email服务器上
tar zxvf extmail.tar.gz -C /usr/local/mysql/var
2: 因为原来的/etc/authmysqlrc下的 配置homedir目录为:
MYSQL_HOME_FIELD concat('/data/mail_data/mailbox/',homedir)
MYSQL_HOME_FIELD concat('/data/mail_data/mailbox/',maildir)
所以必须要修改配置文件,使得和原来的一样!
然后在/目录下mkdir -p /data/mail_data/mailbox/
chown -R postfix: /data
将原来邮件服务器上所有的用户的邮件都压缩scp或ftp到新机器上即可!
3:新建用户名测试,即可正常!
但遇到一个问题,不能发送邮件!
原来是:
#myhostname = qinghe.com
#myorigin = qinghe.com
#mydomain = qinghe.com
将这几行注释掉即可!
15:安装clamav
[root@ungeoxliu init.d]# service clamd start
Starting clamd: ERROR: Can't open /var/log/clamav/clamd.log in append mode (check permissions!).
ERROR: Problem with internal logger. Please check the permissions on the /var/log/clamav/clamd.log file.
touch /var/log/clamav/clamd.log
chown -R amavis: /var/log/clamav/clamd.log ##不能是这个文件所有者,修改即可
LibClamAV Warning: **************************************************
ERROR: LOCAL: Socket file /var/run/clamd.socket could not be bound: Permission denied
[FAILED]
修改/etc/clamav/clamd.conf 下的 ##这种方式也可以!
LocalSocket /var/run/clamd.socket
为
LocalSocket /var/run/clamav/clamd.socket
这样还是不行 , 不修改,恢复为默认的/tmp/clamd.socket即可!
16:在使用cpan安装Mail::SPF::Query时提示出错
perl -MCPAN -e shell
install Mail::SPF::Query
提示出错:
解决方法:
cd /root/.cpan/build/Mail-SPF-Query-1.999.1
perl Makefile.PL
make
make test ## 本来该测试一下,这里就不要测试了,直接make install即可
make install
IO-Socket-INET6-2.69也是这种安装方法!
17:[root@ungeoxliu amavisd-new-2.6.0]# /usr/local/sbin/amavisd
ERROR: MISSING REQUIRED BASIC MODULES:
IO::Wrap
IO::Stringy
MIME::Words
MIME::Head
MIME::Body
MIME::Entity
MIME::Parser
MIME::Decoder
MIME::Decoder::Base64
MIME::Decoder::Binary
MIME::Decoder::QuotedPrint
MIME::Decoder::NBit
MIME::Decoder::UU
MIME::Decoder::Gzip64
Net::Server
Net::Server::PreFork
BEGIN failed--compilation aborted at /usr/local/sbin/amavisd line 231.
解决方法:
安装文档上提供的perl模块!
18:
[root@ungeoxliu amavisd-new-2.6.0]# /usr/local/sbin/amavisd
Problem in Amavis::DB or Amavis::DB::SNMP code: Can't locate BerkeleyDB.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8) at (eval 69) line 19.
BEGIN failed--compilation aborted at (eval 69) line 19.
[root@ungeoxliu amavisd-new-2.6.0]#
解决方法:
#cpan
>install BerkeleyDB 即可
19: 451 4.5.0 Error in processing, id=18645-01, virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED:
run_av error: Too many retries to talk to /var/run/clamav/clamd.socket (Can't connect to UNIX socket /var/run/clamav/clamd.socket: No such file or directory) at (eval 88) line 306.
修改/etc/init.d/clamd 下的ulimit -f 20000 为ulimit -f 80000
然后启动,又报错:
LibClamAV Error: cli_hex2str(): Malformed hexstring: This ClamAV version has reached End of Life! Please upgrade to version 0.95 or later. For more information see and (length: 169)
LibClamAV Error: Problem parsing database at line 61412
LibClamAV Error: Can't load /tmp/clamav-f433e6c90328c1b6623ac5c1f9b09f77/main.ndb: Malformed database
LibClamAV Error: Can't load /usr/local/clamav/share/main.cvd: Malformed database
ERROR: Malformed database
[FAILED]
解决方法:
删除原来的clamav,重新安装
20: 451-4.5.0 Error in processing, id=04222-02, virus_scan FAILED:
virus_scan: ALL VIRUS SCANNERS FAILED: ClamAV-clamd av-scanner FAILED: CODE(0x57ada90) unexpected ,
output="/var/amavis/tmp/amavis-20120824T134816-04222/parts: lstat() failed: Permission denied. ERROR
451 4.5.0 " at (eval 88) line 523.
Clamd reported that it can't access the mail file.
In clamd.conf you need: # 这个必须修改,否则就算是将clamav加入amavis组也不行!
AllowSupplementaryGroups yes
and in /etc/group you need to add clamav to a group :
amavis:*:110:clamav
22: Aug 24 15:37:56 ungeoxliu amavis[4844]: (04844-01) Blocked SPAM, MYNETS LOCAL [192.168.1.155]
[192.168.1.155] -> , quarantine: spam-4UH8XT9gjdt0.gz, Message-ID: <201208241537543726228@qinghe.com>, mail_id: 4UH8XT9gjdt0, Hits: 7.64, size: 1663, 676 ms
解决方法:
vi amavisd.conf
将@mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10
10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 );
修改为
@mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10
10.0.0.0/8 172.16.0.0/12 192.168.1.0/24 );
192.168.1.0/24 是我的机器的地址网段!
23: rhel6下遇到的问题:
configure: error: Cannot find either the gdbm or the db library.
解决方法:
yum -y install gdbm-devel*即可
24: configure: error: libjpeg.(a|so) not found.
[root@mail postfix]# rpm -qa | grep libjpeg ##先确认如下包已经安装
libjpeg-devel-6b-46.el6.x86_64
libjpeg-6b-46.el6.x86_64
然后执行:
cp -frp /usr/lib64/libjpeg.* /usr/lib/ ##我的系统为64位的
25:修改 /etc/authdaemonrc 中的 DEBUG_LOGIN=0 为 2更方便察看出错的日志!
26:configure: error: libpng.(a|so) not found.
解决方法:
[root@mail postfix]# rpm -qa | grep libpng ##先确认如下包已经安装!
libpng-1.2.49-1.el6_2.x86_64
libpng-devel-1.2.49-1.el6_2.x86_64
然后执行:
cp -frp /usr/lib64/libpng.* /usr/lib/ ##我的系统为64位的
27:auth_getpwent.c:48:20: error: des.h: No such file or directory
解决方法:
cp /home/liuxiaojie/software/cyrus-sasl-2.1.22/mac/libdes/public/des.h /home/liuxiaojie/software/cyrus-sasl-2.1.2
28:No include file found.
解决方法:
ln -sv /usr/local/BerkeleyDB/include/db.h /usr/include/db.h
29:
安装postfix时提示:error openssl/rand.h no such file or directory
解决方法:
ln -s /usr/local/ssl/include/openssl/ /usr/include/openssl
make即可正常
30:
Aug 28 18:17:27 mail postfix/local[2652]: fatal: main.cf configuration error: mailbox_size_limit is smaller than message_size_limit
解决方法:我在main.cf中有message_size_limit = 52428800
后来添加mailbox_size_limit = 524288000
即可!
31:邮箱收发都是正常的,但日志文件里老是有如下的输出,感觉甚是不爽
.....
Jun 21 15:18:31 mail postfix/smtpd[673]: sql_select option missing
Jun 21 15:18:31 mail postfix/smtpd[673]: auxpropfunc error no mechanism available