免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3762 | 回复: 1
打印 上一主题 下一主题

[Mail] authlib认证失败,希望高手指点谢谢 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-24 15:52 |只看该作者 |倒序浏览
#telnet 127.0.0.1 110
+OK Hello there.
USER test@jump.com
+OK Password required.
PASS test
-ERR Temporary problem, please try again later


yixia以下是log信息:
Dec 24 15:40:44 jump postfix/local[3674]: warning: connect #3 to subsystem private//usr/bin/procmail: No such file or directory
Dec 24 15:40:46 jump pop3d: Connection, ip=[10.0.5.225]
Dec 24 15:40:54 jump postfix/local[3674]: warning: connect #4 to subsystem private//usr/bin/procmail: No such file or directory
Dec 24 15:41:04 jump authdaemond: received auth request, service=pop3, authtype=login
Dec 24 15:41:04 jump authdaemond: authmysql: trying this module
Dec 24 15:41:04 jump authdaemond: SQL query: SELECT username, password, "", '503', '503', home, "", "", name, "" FROM mailbox WHERE username = "test@jump.com"
Dec 24 15:41:04 jump authdaemond: mysql_query failed, reconnecting: Unknown column 'home' in 'field list'
Dec 24 15:41:04 jump authdaemond: mysql_query failed second time, giving up: Unknown column 'home' in 'field list'
Dec 24 15:41:04 jump authdaemond: authmysql: TEMPFAIL - no more modules will be tried
Dec 24 15:41:04 jump pop3d: LOGIN FAILED, [email=user=test@jump.com]user=test@jump.com[/email], ip=[10.0.5.225]
Dec 24 15:41:04 jump pop3d: authentication error: Input/output error
Dec 24 15:41:04 jump postfix/local[3674]: warning: connect #5 to subsystem private//usr/bin/procmail: No such file or directory


以下是 authmysqlrc 文件:
##NAME: LOCATION:0
#
# The server name, userid, and password used to log in.
MYSQL_SERVER            localhost
MYSQL_USERNAME          postfix
MYSQL_PASSWORD          postfix
##NAME: SSLINFO:0
#
# The SSL information.
#
# To use SSL-encrypted connections, define the following variables (available
# in MySQL 4.0, or higher):
#
#
# MYSQL_SSL_KEY        /path/to/file
# MYSQL_SSL_CERT       /path/to/file
# MYSQL_SSL_CACERT     /path/to/file
# MYSQL_SSL_CAPATH     /path/to/file
# MYSQL_SSL_CIPHERS    ALL:!DES
##NAME: MYSQL_SOCKET:0
#
# MYSQL_SOCKET can be used with MySQL version 3.22 or later, it specifies the
# filesystem pipe used for the connection
#
MYSQL_SOCKET            /tmp/mysql.sock
##NAME: MYSQL_PORT:0
#
# MYSQL_PORT can be used with MySQL version 3.22 or later to specify a port to
# connect to.
MYSQL_PORT              0
##NAME: MYSQL_OPT:0
#
# Leave MYSQL_OPT as 0, unless you know what you're doing.
MYSQL_OPT               0
##NAME: MYSQL_DATABASE:0
#
# The name of the MySQL database we will open:
MYSQL_DATABASE          postfix
#NAME: MYSQL_CHARACTER_SET:0
#
# This is optional. MYSQL_CHARACTER_SET installs a character set. This option
# can be used with  MySQL version 4.1 or later. MySQL supports 70+ collations
# for 30+ character sets. See MySQL documentations for more detalis.
#
# MYSQL_CHARACTER_SET latin1
##NAME: MYSQL_USER_TABLE:0
#
# The name of the table containing your user data.  See README.authmysqlrc
# for the required fields in this table.
MYSQL_USER_TABLE   mailbox
##NAME: MYSQL_CRYPT_PWFIELD:0
#
# Either MYSQL_CRYPT_PWFIELD or MYSQL_CLEAR_PWFIELD must be defined.  Both
# are OK too. crypted passwords go into MYSQL_CRYPT_PWFIELD, cleartext
# passwords go into MYSQL_CLEAR_PWFIELD.  Cleartext passwords allow
# CRAM-MD5 authentication to be implemented.
MYSQL_CRYPT_PWFIELD     password
##NAME: MYSQL_CLEAR_PWFIELD:0
#
#
# MYSQL_CLEAR_PWFIELD   clear
##NAME: MYSQL_DEFAULT_DOMAIN:0
#
# If DEFAULT_DOMAIN is defined, and someone tries to log in as 'user',
# we will look up [email=]'user@DEFAULT_DOMAIN'[/email] instead.
#
#
DEFAULT_DOMAIN          jump.net.cn
##NAME: MYSQL_UID_FIELD:0
#
# Other fields in the mysql table:
#
# MYSQL_UID_FIELD - contains the numerical userid of the account
#
MYSQL_UID_FIELD         '503'
##NAME: MYSQL_GID_FIELD:0
#
# Numerical groupid of the account
MYSQL_GID_FIELD         '503'
##NAME: MYSQL_LOGIN_FIELD:0
#
# The login id, default is id.  Basically the query is:
#
#  SELECT MYSQL_UID_FIELD, MYSQL_GID_FIELD, ... WHERE id='loginid'
#
MYSQL_LOGIN_FIELD       username
##NAME: MYSQL_HOME_FIELD:0
#
#MYSQL_HOME_FIELD       concat('/home/mailbox/',maildir)
MYSQL_HOME_FIELD       '/home/mailbox'
##NAME: MYSQL_NAME_FIELD:0
#
# The user's name (optional)
MYSQL_NAME_FIELD        name
# This is an optional field, and can be used to specify an arbitrary
# location of the maildir for the account, which normally defaults to
# $HOME/Maildir (where $HOME is read from MYSQL_HOME_FIELD).
#
# You still need to provide a MYSQL_HOME_FIELD, even if you uncomment this
# out.
#
# MYSQL_MAILDIR_FIELD   concat('/home/mailbox/',maildir)
  MYSQL_MAILDIR_FIELD   maildir
##NAME: MYSQL_DEFAULTDELIVERY:0
#
# Courier mail server only: optional field specifies custom mail delivery
# instructions for this account (if defined) -- essentially overrides
# DEFAULTDELIVERY from ${sysconfdir}/courierd
#
# MYSQL_DEFAULTDELIVERY defaultdelivery
##NAME: MYSQL_QUOTA_FIELD:0
#
# Define MYSQL_QUOTA_FIELD to be the name of the field that can optionally
# specify a maildir quota.  See README.maildirquota for more information
#
# MYSQL_QUOTA_FIELD     quota
  MYSQL_QUOTA_FIELD     concat(quota,'S')
##NAME: MYSQL_AUXOPTIONS:0
#
# Auxiliary options.  The MYSQL_AUXOPTIONS field should be a char field that
# contains a single string consisting of comma-separated "ATTRIBUTE=NAME"
# pairs.  These names are additional attributes that define various per-account
# "options", as given in INSTALL's description of the "Account OPTIONS"
# setting.
#
# MYSQL_AUXOPTIONS_FIELD        auxoptions
#
# You might want to try something like this, if you'd like to use a bunch
# of individual fields, instead of a single text blob:
#
#
# This will let you define fields called "disableimap", etc, with the end result
# being something that the OPTIONS parser understands.

##NAME: MYSQL_WHERE_CLAUSE:0
#
# This is optional, MYSQL_WHERE_CLAUSE can be basically set to an arbitrary
# fixed string that is appended to the WHERE clause of our query
#
# MYSQL_WHERE_CLAUSE    server='mailhost.example.com'
  MYSQL_WHERE_CLAUSE    active='1'
##NAME: MYSQL_SELECT_CLAUSE:0
#
# (EXPERIMENTAL)
# This is optional, MYSQL_SELECT_CLAUSE can be set when you have a database,
# which is structuraly different from proposed. The fixed string will
# be used to do a SELECT operation on database, which should return fields
# in order specified bellow:
#
# username, cryptpw, clearpw, uid, gid, home, maildir, quota, fullname, options
#
# The username field should include the domain (see example below).
#
# Enabling this option causes ignorance of any other field-related
# options, excluding default do main.
#
# There are two variables, which you can use. Substitution will be made
# for them, so you can put entered username (local part) and domain name
# in the right place of your query. These variables are:
# If a $(domain) is empty (not given by the remote user) the default domain
# name is used in its place.
#
# $(service) will expand out to the service being authenticated: imap, imaps,
# pop3 or pop3s.  Courier mail server only: service will also expand out to
# "courier", when searching for local mail account's location.  In this case,
# if the "maildir" field is not empty it will be used in place of
# DEFAULTDELIVERY.  Courier mail server will also use esmtp when doing
# authenticated ESMTP.
#
# This example is a little bit modified adaptation of vmail-sql
# database scheme:
#
# MYSQL_SELECT_CLAUSE   SELECT CONCAT(popbox.local_part, [email=]'@'[/email], popbox.domain_name),                      \
#                       CONCAT('{MD5}', popbox.password_hash),          \
#                       popbox.clearpw,                                 \
#                       domain.uid,                                     \
#                       domain.gid,                                     \
#                       CONCAT(domain.path, '/', popbox.mbox_name),     \
#                       '',                                             \
#                       domain.quota,                                   \
#                       '',                                             \
#                       CONCAT("disableimap=",disableimap,",disablepop3=",    \
#                              disablepop3,",disablewebmail=",disablewebmail, \
#                              ",sharedgroup=",sharedgroup)             \
#                       FROM popbox, domain                             \
#                       WHERE popbox.local_part = '$(local_part)'       \
#                       AND popbox.domain_name = '$(domain)'            \
#                       AND popbox.domain_name = domain.domain_name

##NAME: MYSQL_ENUMERATE_CLAUSE:1
#
# {EXPERIMENTAL}
# Optional custom SQL query used to enumerate accounts for authenumerate,
# in order to compile a list of accounts for shared folders.  The query
# should return the following fields: name, uid, gid, homedir, maildir, options
#
# Example:
# MYSQL_ENUMERATE_CLAUSE        SELECT CONCAT(popbox.local_part, [email=]'@'[/email], popbox.domain_name),
\
#                       domain.uid,                                     \
#                       domain.gid,                                     \
#                       CONCAT(domain.path, '/', popbox.mbox_name),     \
#                       '',                                             \
#                       CONCAT('sharedgroup=', sharedgroup)             \
#                       FROM popbox, domain                             \
#                       WHERE popbox.local_part = '$(local_part)'       \
#                       AND popbox.domain_name = '$(domain)'            \
#                       AND popbox.domain_name = domain.domain_name

##NAME: MYSQL_CHPASS_CLAUSE:0
#
# (EXPERIMENTAL)
# This is optional, MYSQL_CHPASS_CLAUSE can be set when you have a database,
# which is structuraly different from proposed. The fixed string will
# be used to do an UPDATE operation on database. In other words, it is
# used, when changing password.
#
# There are four variables, which you can use. Substitution will be made
# for them, so you can put entered username (local part) and domain name
# in the right place of your query. There variables are:
#       $(local_part) , $(domain) , $(newpass) , $(newpass_crypt)
#
# If a $(domain) is empty (not given by the remote user) the default domain
# name is used in its place.
# $(newpass) contains plain password
# $(newpass_crypt) contains its crypted form
#
# MYSQL_CHPASS_CLAUSE   UPDATE  popbox                                  \
#                       SET     clearpw='$(newpass)',                   \
#                               password_hash='$(newpass_crypt)'        \
#                       WHERE   local_part='$(local_part)'              \
#                       AND     domain_name='$(domain)'
#

以下是authdaemonrc


##VERSION: $Id: authdaemonrc.in,v 1.13 2005/10/05 00:07:32 mrsam Exp $
#
# Copyright 2000-2005 Double Precision, Inc.  See COPYING for
# distribution information.
#
# authdaemonrc created from authdaemonrc.dist by sysconftool
#
# Do not alter lines that begin with ##, they are used when upgrading
# this configuration.
#
# This file configures authdaemond, the resident authentication daemon.
#
# Comments in this file are ignored.  Although this file is intended to
# be sourced as a shell script, authdaemond parses it manually, so
# the acceptable syntax is a bit limited.  Multiline variable contents,
# with the \ continuation character, are not allowed.  Everything must
# fit on one line.  Do not use any additional whitespace for indentation,
# or anything else.
##NAME: authmodulelist:2
#
# The authentication modules that are linked into authdaemond.  The
# default list is installed.  You may selectively disable modules simply
# by removing them from the following list.  The available modules you
# can use are: authuserdb authpam authldap authmysql authcustom authpipe
#authmodulelist="authuserdb authpam authldap authmysql authcustom authpipe"
authmodulelist="authmysql"
##NAME: authmodulelistorig:3
#
# This setting is used by Courier's webadmin module, and should be left
# alone
#authmodulelistorig="authuserdb authpam authldap authmysql authcustom authpipe"
authmodulelistorig="authmysql"
##NAME: daemons:0
#
# The number of daemon processes that are started.  authdaemon is typically
# installed where authentication modules are relatively expensive: such
# as authldap, or authmysql, so it's better to have a number of them running.
# PLEASE NOTE:  Some platforms may experience a problem if there's more than
# one daemon.  Specifically, SystemV derived platforms that use TLI with
# socket emulation.  I'm suspicious of TLI's ability to handle multiple
# processes accepting connections on the same filesystem domain socket.
#
# You may need to increase daemons if as your system load increases.  Symptoms
# include sporadic authentication failures.  If you start getting
# authentication failures, increase daemons.  However, the default of 5
# SHOULD be sufficient.  Bumping up daemon count is only a short-term
# solution.  The permanent solution is to add more resources: RAM, faster
# disks, faster CPUs...
daemons=10
##NAME: authdaemonvar:2
#
# authdaemonvar is here, but is not used directly by authdaemond.  It's
# used by various configuration and build scripts, so don't touch it!
authdaemonvar=/usr/local/var/spool/authdaemon
##NAME: DEBUG_LOGIN:0
#
# Dump additional diagnostics to syslog
#
# DEBUG_LOGIN=0   - turn off debugging
# DEBUG_LOGIN=1   - turn on debugging
# DEBUG_LOGIN=2   - turn on debugging + log passwords too
#
# ** YES ** - DEBUG_LOGIN=2 places passwords into syslog.
#
# Note that most information is sent to syslog at level 'debug', so
# you may need to modify your /etc/syslog.conf to be able to see it.
DEBUG_LOGIN=2
##NAME: DEFAULTOPTIONS:0
#
# A comma-separated list of option=value pairs. Each option is applied
# to an account if the account does not have its own specific value for
# that option. So for example, you can set
#   DEFAULTOPTIONS="disablewebmail=1,disableimap=1"
# and then enable webmail and/or imap on individual accounts by setting
# disablewebmail=0 and/or disableimap=0 on the account.
DEFAULTOPTIONS=""
##NAME: LOGGEROPTS:0
#
# courierlogger(1) options, e.g. to set syslog facility
#
LOGGEROPTS=""
##NAME: LDAP_TLS_OPTIONS:0
#
# Options documented in ldap.conf(5) can be set here, prefixed with 'LDAP'.
# Examples:
#
#LDAPTLS_CACERT=/path/to/cacert.pem
#LDAPTLS_REQCERT=demand
#LDAPTLS_CERT=/path/to/clientcert.pem
#LDAPTLS_KEY=/path/to/clientkey.pem

望高手指点

论坛徽章:
0
2 [报告]
发表于 2007-12-25 13:07 |只看该作者
日志不是写得很清楚吗:

Dec 24 15:41:04 jump authdaemond: mysql_query failed, reconnecting: Unknown column 'home' in 'field list'

你的mysql表的字段到底是什么?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP