Chinaunix首页 | 论坛 | 博客
  • 博客访问: 146556
  • 博文数量: 52
  • 博客积分: 1447
  • 博客等级: 上尉
  • 技术积分: 505
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-15 15:09
文章分类

全部博文(52)

文章存档

2012年(1)

2011年(51)

分类: LINUX

2011-08-15 13:51:44

#错误1、socket最后面多了一个空格键
root@mail:/var/www/extsuite/extmail# authtest -s login postmaster@extmail.org extmail
Authentication FAILED: Input/output error
 
tail -f /var/log/mail.log
Aug  1 15:10:49 mail authdaemond: failed to connect to mysql server (server=localhost, userid=extmail): Cant connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock ' (2)
仔细一看发现socket最后面多了一个空格键,--!
 
 
#错误2、配置postfix支持mysql后,ehlo demo.domain.tld长时间无响应
tail -f /var/log/mail.log
Aug  1 15:34:22 mail postfix/smtpd[6062]: fatal: dict_open: unsupported dictionary type: mysql:  Is the postfix-mysql package installed?
 
#解决:apt-get install postfix-mysql
 
#错误3、postfix运行于chroot中
#1)、chroot下,sntpd认证失败,
 
/var/spool/postfix/var/run/courier/authdaemon/socket
Aug  2 12:31:31 mail postfix/smtpd[10896]: connect from localhost[127.0.0.1]
Aug  2 12:32:01 mail postfix/smtpd[10896]: warning: SASL authentication failure: cannot connect to Courier authdaemond: No such file or directory
Aug  2 12:32:01 mail postfix/smtpd[10896]: warning: localhost[127.0.0.1]: SASL login authentication failed: generic failure
Aug  2 12:32:32 mail postfix/master[10891]: terminating on signal 15
 
Aug  2 12:33:01 mail authdaemond: Authenticated: clearpasswd=extmail, passwd=$1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0
 
##2)、no chroot下,认证成功:
/var/run/courier/authdaemon/socket
Aug  2 12:32:35 mail postfix/master[11115]: daemon started -- version 2.7.0, configuration /etc/postfix
Aug  2 12:32:38 mail postfix/smtpd[11120]: connect from localhost[127.0.0.1]
Aug  2 12:33:01 mail authdaemond: received auth request, service=smtp, authtype=login
Aug  2 12:33:01 mail authdaemond: authmysql: trying this module
Aug  2 12:33:01 mail authdaemond: authmysqllib: connected. Versions: header 50137, client 50141, server 50141
Aug  2 12:33:01 mail authdaemond: SQL query: SELECT username,password,"",uidnumber,gidnumber,                           CONCAT('/home/vmail/',homedir),                                         CONCAT('/home/vmail/',maildir),                                         quota,                                                                    name                                                                      FROM mailbox                                                              WHERE username = 'postmaster@extmail.org'
Aug  2 12:33:01 mail authdaemond: password matches successfully
Aug  2 12:33:01 mail authdaemond: authmysql: sysusername=, sysuserid=1000, sysgroupid=1000, homedir=/home/vmail/extmail.org/postmaster, address=postmaster@extmail.org, fullname=PostMaster, maildir=/home/vmail/extmail.org/postmaster/Maildir/, quota=104857600S, options=
Aug  2 12:33:01 mail authdaemond: authmysql: clearpasswd=, passwd=$1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0
Aug  2 12:33:01 mail authdaemond: Authenticated: sysusername=, sysuserid=1000, sysgroupid=1000, homedir=/home/vmail/extmail.org/postmaster, address=postmaster@extmail.org, fullname=PostMaster, maildir=/home/vmail/extmail.org/postmaster/Maildir/, quota=104857600S, options=
 
#在ubuntu下面出现 535 5.7.8 Error: authentication failed: generic failure,基本上是因为postfix chroot造成的
#解决:1、关闭postfix的chroot运行模式。2、换成架构四进行安装,ubuntu团队对此架构做了相关的优化
vim /etc/postfix/master.cf
smtp      inet  n       -       n       -       -       smtpd
 
 
#错误4、权限问题
Aug  1 16:01:21 mail postfix/smtpd[6771]: warning: SASL authentication failure: cannot connect to Courier authdaemond: Permission denied
Aug  1 16:01:21 mail postfix/smtpd[6771]: warning: localhost[127.0.0.1]: SASL login authentication failed: generic failure
#解决:
chmod 755 /var/run/courier/authdaemon  
 
 
#错误5:chdir(/home/vmailextmail.org/test) failed
tail -f /var/log/mail.log
Aug  1 16:14:25 mail pop3d: test@extmail.org: chdir(/home/vmailextmail.org/test) failed!!
 
#解决:注意:/home/vmail后面的“/”别写丢了
MYSQL_SELECT_CLAUSE     SELECT username,password,"",uidnumber,gidnumber,\
                        CONCAT('/home/vmail/',homedir),               \
                        CONCAT('/home/vmail/',maildir),               \
                        quota,                                          \
                        name                                            \
                        FROM mailbox                                    \
                        WHERE username = '$(local_part)@$(domain)'
 
 
 
#错误6:Cant connect to local MySQL server through socket
tail -f /var/log/mail.log
Aug  1 16:42:01 mail postfix/trivial-rewrite[7092]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,lock|fold_fix): table lookup problem
Aug  1 16:42:02 mail postfix/smtpd[7082]: warning: problem talking to service rewrite: Success
Aug  1 16:42:02 mail postfix/master[6766]: warning: process /usr/lib/postfix/trivial-rewrite pid 7092 exit status 1
Aug  1 16:42:02 mail postfix/master[6766]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling
Aug  1 16:43:02 mail postfix/trivial-rewrite[7094]: warning: connect to mysql server localhost: Cant connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
#解决、把mysql_virtual_*.cf下的hosts全部改为hosts=127.0.0.1
cd /etc/postfix/
vim mysql_virtual_alias_maps.cf
vim mysql_virtual_domains_maps.cf
vim mysql_virtual_mailbox_maps.cf
vim mysql_virtual_sender_maps.cf
 
 
#错误7:
apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.0.234 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.0.234 for ServerName  do  
#解决:
echo "ServerName localhost" >> /etc/apache2/httpd.conf
 
 
#错误8:sql_select option missing(此错误)对服务器的影响不大,还未发现运行异常,不过可以添加以下排除错误
tail -f /var/log/auth.log #报错
Aug  4 17:50:40 mail postfix/smtpd[1932]: sql_select option missing
Aug  4 17:50:40 mail postfix/smtpd[1932]: auxpropfunc error no mechanism available
Aug  4 17:50:40 mail postfix/smtpd[1932]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql  do
 
#错误9、
# cat /usr/local/lib/sasl2/smtpd.conf
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: extmail
sql_password: extmail
sql_database: extmail
log_level:7
sql_select: SELECT password FROM mailbox WHERE username='%u@%r' and domain='%r'
#将原有的smtpd.conf配置文件添加以上内容(蓝色字体)后,此日志显示消失。
#添加后,执行telnet localhost 25,日志如下,一切正常
tail -f /var/log/auth.log
Aug  4 17:51:44 mail postfix/smtpd[2099]: sql auxprop plugin using mysql engine
 
 
#错误10、fatal: no SASL authentication mechanisms
apt-get remove libsasl2-modules *    #报错,无法正常连接smtp,“fatal: no SASL authentication mechanisms”,说明postfix还是依赖此模块的
smtp--->sasl---->authmysql----->authmysqllib
 
 
#错误11、connect() : No such file or directory
root@mail:/home/zhangyq# testsaslauthd -u zaza@extmail.com -p 123456 -s smtp
connect() : No such file or directory
#说明testsaslauthd没有找到认证的入口,出现这种错误通常是修改了/etc/default/saslauthd中OPTIONS默认的路径造成的
testsaslauthd -u zaza@extmail.org -p 123456 -s smtp -f /var/spool/postfix/var/run/saslauthd/mux   #改变socket路径即可
 
 
#错误12、PAM unable to dlopen(/lib/security/pam_mysql.so)
grep -R pam_mysql /var/log/
/var/log/auth.log:Aug  4 10:29:21 mail saslauthd[2543]: PAM unable to dlopen(/lib/security/pam_mysql.so): /lib/security/pam_mysql.so: cannot open shared object file: No such file or directory
/var/log/auth.log:Aug  4 10:29:21 mail saslauthd[2543]: PAM adding faulty module: /lib/security/pam_mysql.so
#解决
apt-get install libpam-mysql
 
 
#优化1:打开extmail邮件系统的web页面加载很慢
#经过分析,发现是由于页面加载时调用了extmail.net的rpc服务。
#解决:
#1)、修改 /var/www/extsuite/extmail/html/plugins/rpc_init.js文件,去除其中rpc的使用.
 
   1.
      rpc_url_list = [
   2.
      //    "",
   3.
      //    "",
   4.
      //    "",
   5.
      ];
   6.
        
   7.
      rpc_plg_list = [
   8.
      //    "coolweather",
   9.
      //    "etnews",
  10.
      //    "chkupdate",
  11.
      ];
 
#2)、修改/var/www/extsuite/extman/html/plugins/rpc_init.js文件,去除其中rpc的使用。
 
   1.
      rpc_url_list = [
   2.
      //    "",
   3.
      //    "",
   4.
      //    "",
   5.
      ];


转载请标明出处:http://xishi.blog.chinaunix.net
阅读(12479) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~