Courier-Imap + Mysql

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
dherkhon
Posts: 25
Joined: 2003-10-20 17:43

Courier-Imap + Mysql

Post by dherkhon » 2004-01-03 20:34

Hallo

Folgendes Problem:

Ich habe exim + courier-imap + f-prot am laufen.Mail senden klappt gut aber abholen per courier-imap geht nicht.

Das ist meine authmysqlrc:

Code: Select all

##VERSION: $Id: authmysqlrc,v 1.14 2003/05/09 18:15:15 mrsam Exp $
#
# Copyright 2000 Double Precision, Inc.  See COPYING for
# distribution information.
#
# Do not alter lines that begin with ##, they are used when upgrading
# this configuration.
#
# authmysqlrc created from authmysqlrc.dist by sysconftool
#
# DO NOT INSTALL THIS FILE with world read permissions.  This file
# might contain the MySQL admin password!
#
# Each line in this file must follow the following format:
#
# field[spaces|tabs]value
#
# That is, the name of the field, followed by spaces or tabs, followed by
# field value.  Trailing spaces are prohibited.


##NAME: LOCATION:0
#
# The server name, userid, and password used to log in.

MYSQL_SERVER		localhost
MYSQL_USERNAME		exim
MYSQL_PASSWORD		"passwort"

##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		/var/run/mysqld/mysqld.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		exim

##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	users

##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	password_clear

##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		"domain.tld"

##NAME: MYSQL_UID_FIELD:0
#
# Other fields in the mysql table:
#
# MYSQL_UID_FIELD - contains the numerical userid of the account
#
MYSQL_UID_FIELD		uid

##NAME: MYSQL_GID_FIELD:0
#
# Numerical groupid of the account

MYSQL_GID_FIELD		gid

##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	email

##NAME: MYSQL_HOME_FIELD:0
#

MYSQL_HOME_FIELD	home

##NAME: MYSQL_NAME_FIELD:0
#
# The user's name (optional)

MYSQL_NAME_FIELD	name

##NAME: MYSQL_MAILDIR_FIELD:0
#
# 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	directory

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

##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'

##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
#
# The username field should include the domain (see example below).
#
# Enabling this option causes ignorance of any other field-related
# options, excluding default domain.
#
# 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:
#	 	$(local_part), $(domain), $(service)
#
# 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, '@', popbox.domain_name),			
#			CONCAT('{MD5}', popbox.password_hash),		
#			popbox.clearpw,					
#			domain.uid,					
#			domain.gid,					
#			CONCAT(domain.path, '/', popbox.mbox_name),	
#			'',						
#			domain.quota,					
#			'',						
#			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)'
#

Beim abrufen der mails bekomm ich ein "Login Failed" .

Im mysql query Log steht das hier:

Code: Select all

040103 20:28:06	     18 Connect     exim@localhost on 
		     18 Init DB     exim
		     18 Query       SELECT email, password, "", uid, gid, home, directory, "", name FROM users WHERE email = "webmaster@"domain.tld""

Wie man sieht klappt die verbindung von courier-imap nach mysql.Nur wo liegt da der fehler ?

Hier noch was aus dem syslog

Code: Select all

Jan  3 20:30:23 server1932015*** imapd: Connection, ip=[80.129.30.158]
Jan  3 20:30:28 server1932015*** imapd: LOGIN FAILED, ip=[80.129.30.158]
Jan  3 20:30:31 server1932015*** imapd: DISCONNECTED, ip=[80.129.30.158], headers=0, body=0

dherkhon
Posts: 25
Joined: 2003-10-20 17:43

Re: Courier-Imap + Mysql

Post by dherkhon » 2004-01-04 16:41

Hier noch die debug meldung von courier-imap

Jan 4 16:37:11 server1932015*** imapd: Connection, ip=[217.86.5.***]
Jan 4 16:37:11 server1932015*** imapd: LOGIN: DEBUG: ip=[217.86.5.***], command=CAPABILITY
Jan 4 16:37:11 server1932015*** imapd: LOGIN: DEBUG: ip=[217.86.5.***], command=LOGIN
Jan 4 16:37:11 server1932015*** imapd: LOGIN: DEBUG: ip=[217.86.5.***], username=webmaster@domain.tld
Jan 4 16:37:11 server1932015*** imapd: LOGIN: DEBUG: ip=[217.86.5.***], password=********
Jan 4 16:37:16 server1932015*** imapd: LOGIN FAILED, ip=[217.86.5.***]
Jan 4 16:37:19 server1932015*** imapd: DISCONNECTED, ip=[217.86.5.***], headers=0, body=0

dherkhon
Posts: 25
Joined: 2003-10-20 17:43

Re: Courier-Imap + Mysql

Post by dherkhon » 2004-01-05 04:26

Hat sich erledigt

Ein Downgrade von mysql 4.x auf 3.x war die lösung...

komische sache aber es geht :)