搭建postfix报错集合

出错提示:
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
//////////////////////////////////////////////////////////////////////////////////////mysql

出错提示(在/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支持。linux


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/authmysqlrcweb

##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.cnsql


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/authmysqlrcapache

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/。api

///////////////////////////////////////////////////////////////////
若是碰到:
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 startapp

若是中止失败,报错:Error: auth(default): dovecot-auth: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directorydom

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

#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

相关文章
相关标签/搜索