出错提示:
Nov 6 20:07:06 ssn postfix/smtpd[4Array44]: connect from ssn[127.0.0.1]
Nov 6 20:07:10 ssn postfix/trivial-rewrite[4Array47]: warning: do not list domain test.edu.cn in BOTH mydestination and virtual_mailbox_domains
Nov 6 20:07:10 ssn postfix/trivial-rewrite[4Array47]: warning: do not list domain test.edu.cn in BOTH mydestination and virtual_mailbox_domains
Nov 6 20:07:10 ssn postfix/smtpd[4Array44]: NOQUEUE: reject: RCPT from ssn[127.0.0.1]: 550 5.1.1 : Recipient address rejected: User unknown in local recipient table; from= to= proto=ESMTP helo=
Nov 6 20:08:11 ssn postfix/smtpd[4Array44]: lost connection after RCPT from ssn[127.0.0.1]
解决方案:
此出错提示说明系统域名(mydestination)与虚拟域名(virtual_mailbox_domains)配置有冲突。
默认postfix从mydestination和virtual_mailbox_domains两个参数来确定postfix需要接收哪些域的邮件。如果接收的邮件域与mydestination匹配,则使用系统帐号处理邮件;如果接收的邮件域与virtual_mailbox_domains匹配则使用虚拟帐号处理邮件。
此处mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,($mydomain=test.edu.cn)且virtual_mailbox_domains指定的mysql数据库中也存在test.edu.cn域,这样test1@test.edu.cn邮件就同时匹配两种帐号,postfix不能判断使用哪种帐号去处理这个邮件,所以就出现了上述这种错误。
所以配置mydestination时,一定要考虑到不能与虚拟域有相同的域名。
查看默认mydestination值:
#postconf -d | grep mydestination
mydestination = $myhostname, localhost.$mydomain, localhost
//

出错提示(在/var/log/messages中):
Nov 5 21:41:33 ssn postfix/smtpd[12356]: sql_select option missing
Nov 5 21:41:33 ssn postfix/smtpd[12356]: auxpropfunc error no mechanism available
解决方案:
去掉mysql的支持即可,因为sasl2直接调用courier-authlib来实现查找mysql并验证用户的,sasl2本身不需要mysql支持。


mail client端帐号配置错误
出错提示:
Nov 6 1Array:56:2Array ssn postfix/smtpd[478Array]: connect from ssn[127.0.0.1]
Nov 6 1Array:56:33 ssn postfix/smtpd[478Array]: warning: SASL authentication failure: Password verification failed
Nov 6 1Array:56:33 ssn postfix/smtpd[478Array]: warning: ssn[127.0.0.1]: SASL PLAIN authentication failed: authentication failure
Nov 6 1Array:56:33 ssn postfix/smtpd[478Array]: warning: ssn[127.0.0.1]: SASL LOGIN authentication failed: authentication failure
Nov 6 1Array:56:37 ssn postfix/smtpd[478Array]: disconnect from ssn[127.0.0.1]
解决方案:
通过提示可以看出是SMPT的认证出错,如果smpt.conf配置文件没有错误,就一定是登录帐号出错了。
默认mail client处配置(如Thunderbird)的登录帐号是邮箱的全称,如:sense5@test.edu.cn,而不是sense5,切记!!!
可以通过以下配置来实现只使用用户名而不是邮箱全称来实现登录,类似于mail.163.com:
#vi /usr/local/courier-authlib/etc/authlib/authmysqlrc

##NAME: MYSQL_DEFAULT_DOMAIN:0
#
# If DEFAULT_DOMAIN is defined, and someone tries to log in as ’user’,
# we will look up ’user@DEFAULT_DOMAIN’ instead.
#
#
# DEFAULT_DOMAIN example.com
DEFAULT_DOMAIN test.edu.cn


courier-authlib认证文件配置错误
配置:
#vi /usr/local/courier-authlib/etc/authlib/authmysqlrc
==============
MYSQL_HOME_FIELD homedir
MYSQL_MAILDIR_FIELD maildir
=============
/

出错提示:
Nov 6 1Array:54:42 ssn imapd: Connection, ip=[127.0.0.1]
Nov 6 1Array:54:42 ssn imapd: test1@test.edu.cn: chdir(test.edu.cn/test1/) failed!!
Nov 6 1Array:54:42 ssn imapd: error: No such file or directory
Nov 6 1Array:54:42 ssn imapd: LOGIN FAILED, user=test1@test.edu.cn, ip=[127.0.0.1]
Nov 6 1Array:54:42 ssn imapd: authentication error: No such file or directory
解决方案:
从出错提示中可以看出,imapd已经通过用户的身份验证,只是没有找到用户的邮件目录。出错提示中看出,imapd是直接从mysql中提取的用户mailbox的相对路径,authlib当然找不到正确的文件了,所以需要配置指定其绝对路径。
#vi /usr/local/courier-authlib/etc/authlib/authmysqlrc

MYSQL_HOME_FIELD concat(’/var/mailbox/’,homedir)
MYSQL_MAILDIR_FIELD concat(’/var/mailbox/’,maildir)
以上两个参数一定要按上边的形式配置,否则就有可能出现这种错误。
concat(’/var/mailbox/’,homedir)与concat(’/var/mailbox/’,maildir)函数不能少,函数左边为预设的虚拟用户mailbox存放路径,此处为/var/mailbox/。

///
如果碰到:
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS -DHAS_PCRE -g -O -I. -I../../include -DLINUX2 -c dict_mysql.c
dict_mysql.c:173:19: 错误:mysql.h:没有那个文件或目录
先安装:
rpm -ivh mysql-devel-5.0.45-7.el5.i386.rpm
///
错误信息2:make -f Makefile.in MAKELEVEL= Makefiles
(echo "# Do not edit -- this file documents how Postfix was built for your machine."; /bin/sh makedefs) >makedefs.tmp
No <db.h> include file found.
Install the appropriate db*-devel package first.
See the RELEASE_NOTES file for more information.
make: *** [Makefiles] 错误 1
make: *** [makefiles] 错误 2
原因:没装berkeleyDB的开发库,或者是指定路径没有找到,所以报这个错了。如果是linux, 注意看有没有db*-devel的rpm,或者libdb*-dev的deb(debian)如果是bsd,则看看有没有装db3/db4等包
解决方法:cd /mnt/cdrom/Server
安装:rpm -ivh db4-devel-4.3.29-9.fc6.i386.rpm
///
错误4:error: Failed dependencies:
libpq.so.4 is needed by perl-DBD-Pg-1.49-2.el5.i386
解决方法:
安装:rpm -ivh postgresql-libs-8.1.11-1.el5_1.1.i386.rpm

service dovecot start

如果停止失败,报错:Error: auth(default): dovecot-auth: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory

Dovecot 会依赖MySQL-shared-
前面强制卸载系统自带mysql时,把此包也删掉了,因此手动装上(版本和现在装的mysql差不多,否则有可能不兼容)。
缺少libmysqlclient.so.15,将新的so.15f复制到/use/lib里面,可以试试或者:
或者解决方法如下:
#echo "/usr/local/mysql/lib">>/etc/ld.so.conf

#ldconfig
下载:MySQL-shared-compat-5.0.92-1.rhel5.i386.rpm 安装即可

如果碰到:
启动 Dovecot Imap:Error: Can't write to log directory /var/log/dovecot: Permission denied
Fatal: Invalid configuration in /etc/dovecot.conf
这是selinux的问题:
vi /etc/sysconfig/selinux
修改SELINUX 为 “disabled”
setenforce 0 让selinux生效
//
可以访问http://192.168.10.22/extman/了
碰到:验证码图片不显示时,需要先安装这个rpm:
rpm -ivh perl-GD-2.35-1.el5.rf.i386.rpm
可以配置extman/webman.cf中SYS_CAPTCHA_ON = 0 #取消校验码,1为使用校验码,
//
可以访问http://192.168.10.22/extmail/了
碰到:Unix::Syslog not found, please install it first! 错误时,需要先安装这个rpm:
rpm -ivh perl-Unix-Syslog-0.100-1.2.el5.rf.i386.rpm
//
[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/postfix/cyrus-sasl-2.1.18'
make: *** [all] Error 2
解决办法:将安装目录下mac/libdes/public/des.h拷贝到安装根目录
cp mac/libdes/public/des.h .
重新编译安装
####还是报错换个高版本的装就好了
//
cd cyrus-sasl-2.1.25
./configure --prefix=/usr/local/sasl2 --disable-gssapi --disable-anon --disable-digest --enable-plain --enable-login --enable-sql --with-mysql=/usr/local/mysql/ --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/ --with-authdaemond=/usr/local/courier-authlib/var/spool/authdaemon/socket
make
make install
如果在编译过程(make)出现错误,如“client.c:64: error: static declaration of 'global_callbacks' follows non-static declaration saslint.h:112…”,需要加一个补丁程序,然后再执行编译过程。
用vi在当前位置创建补丁文件,起名为sasl.patch,其内容包括:

--- cyrus-sasl-2.1.20/lib/client.c~ 2003-11-11 11:26:06.000000000 -0500
+++ cyrus-sasl-2.1.20/lib/client.c 2005-05-31 22:34:14.000000000 -0400
@@ -61,7 +61,7 @@

static cmech_list_t *cmechlist; /* global var which holds the list */

-static sasl_global_callbacks_t global_callbacks;
+sasl_global_callbacks_t global_callbacks;

static int _sasl_client_active = 0;
//
日志警告:warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
解决:找到/etc/postfix/main.cf 文件中的alias_maps = hash:/etc/aliases 去掉#

#如果apache后台日志出现[error] [client 192.168.24.16] Prototype mismatch: sub Encode::IMAPUTF7::decode ($$;$) vs none at /var/www/extman/libs/Encode/IMAPUTF7.pm line 76.
此报错不影响使用
解决方法:
cp /var/www/extman/libs/Encode/IMAPUTF7.pm IMAPUTF7.pm.bak
拷贝新下载的IMAPUTF7.pm
cp /mnt/win/postfix/Encode-IMAPUTF7-1.04.tar.gz /root/meng/
cd meng/
tar xzvf Encode-IMAPUTF7-1.04.tar.gz
cp Encode-IMAPUTF7-1.04/lib/Encode/IMAPUTF7.pm /var/www/extman/libs/Encode/

可能的错误及解决办法
1.warning: SASL authentication failure: cannot connect to Courier authdaemond: Permission denied
解决方法:检查 authdaemond 的socket所在目录及其父目录的属性是否对smtpd可读。如果不可读则出现这个问
题(permission 的问题)。
2.warning: SASL authentication failure: cannot connect to Courier authdaemond: No such file or directory
解决方法:检查/usr/local/lib/sasl2/smtpd.conf ,看看是否有多写一个空格,一般空格很难直观的发现.
3,查看 /var/log/maillog ,报如下错误:
Sep 17 16:04:56 redhat pop3d: chdir Maildir: No such file or directory
Sep 17 16:04:57 redhat pop3d: Connection, ip=[192.168.2.1]
Sep 17 16:04:57 redhat pop3d: chdir Maildir: No such file or directory
解决方法:authmysqlrc 文件里 MYSQL_MAILDIR_FIELD 字段有空格。
4,warning: do not list domain test.com in BOTH mydestination and virtual_mailbox_domains
解决方法:将/etc/postfix/main.cf 文件内mydestination设置为空即可,或完全注释也行. mydomain 和
myhostname, 这2 个项的值不要设置成一样.
5,fatal: file /etc/postfix/main.cf: parameter mail_owner: unknown user name value:
postfix mynetworks =127.0.0.0/8,10.1.1.0/24
解決方法:postconf -e mail_owner=postfix
6,fatal: file /etc/postfix/main.cf: parameter mail_owner: unknown user name value: postfix myhostname =
mail.test.com mydomain = test.com myorigin = test.com inet_interfaces = all
解決方法:配置/etc/postfix/main.cf 中的inte--inteface=all
7, fatal: open database /etc /aliases.db: No such file or directory
解決方法:执行:newaliase
8,warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
解决方法:找到/etc/postfix/main.cf 文件中的alias_maps = hash:/etc/aliases, nis:mail.aliases 去掉其后即可
9, warning: xsasl_cyrus_server_get_mechanism_list: no applicable SASL mechanisms
fatal: no SASL authentication mechanisms
warning: process /usr/libexec/postfix/smtpd pid 16829
解决方法:
# ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
///
编译安装postfix报错:bin/postconf: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory
处理:cp /usr/local/mysql/lib/libmysqlclient.so.15 /usr/lib
//
安装sasl 报错
如果出现下面的错误:
auth_getpwent.c:48:20: des.h: No such file or directory
make[3]: *** [auth_getpwent.o] Error 1
make[3]: Leaving directory `/tmp/cyrus-sasl-2.1.22/saslauthd’
make[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/cyrus-sasl-2.1.22/saslauthd’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/cyrus-sasl-2.1.22’
make: *** [all] Error 2
修改/tmp/cyrus-sasl-2.1.22/saslauthd/Makefiles内的变量CFLAGS添加-I/opt/openssl/include/openssl
或者直接
mail~#cp /tmp/cyrus-sasl-2.1.22/mac/libdes/public/des.h /tmp/cyrus-sasl-2.1.22/
mail~#make
mail~#make install
///
Jul 30 15:02:32 mail authdaemond: Authenticated: clearpasswd=extmail, passwd=$1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0
Jul 30 15:02:32 mail pop3d: postmaster@extmail.org: chdir(/home/mailusers/extmail.org/postmaster) failed!!
Jul 30 15:02:32 mail pop3d: error: No such file or directory
Jul 30 15:02:32 mail pop3d: LOGIN FAILED, user=postmaster@extmail.org, ip=[127.0.0.1]
Jul 30 15:02:32 mail pop3d: authentication error: No such file or directory
解决:手动新建邮箱文件夹
mkdir -p /home/mailusers/extmail.org/postmaster/Maildir/cur