[Debian Stable] Postfix-Courier-MySQL authenticatie

Pagina: 1
Acties:
  • 664 views sinds 30-01-2008
  • Reageer

  • medendo
  • Registratie: Januari 2003
  • Laatst online: 11-01 15:39
Ik heb m'n eigen mailserver opgezet en heb deze howto gevolgd:
Volgens DNS report kan ik nu ook mail ontvangen, alleen ik kan niet inloggen. Ik krijg de hele tijd password incorrect


code:
1
2
3
4
5
6
7
8
9
10
11
12
acme:/home/medendo# telnet localhost pop3
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK Hello there.
user postmaster
+OK Password required.
pass ********
-ERR Login failed.
quit
+OK Better luck next time.
Connection closed by foreign host.


Het password tik ik echt wel goed in, ik kan in mysql er gewoon mee inloggen.

Uit de syslog:

code:
1
2
3
4
5
6
7
8
9
10
11
Jan 14 15:30:36 acme authdaemond.plain: Unknown module 'authmysql' skipped
Jan 14 15:31:14 acme last message repeated 2 times
Jan 14 15:31:14 acme last message repeated 3 times
Jan 14 15:33:44 acme courierpop3login: Connection, ip=[::ffff:127.0.0.1]
Jan 14 15:33:56 acme courierpop3login: LOGOUT, ip=[::ffff:127.0.0.1]
Jan 14 15:33:57 acme courierpop3login: Connection, ip=[::ffff:127.0.0.1]
Jan 14 15:34:19 acme authdaemond.plain: received auth request, service=pop3, authtype=login
Jan 14 15:34:19 acme authdaemond.plain: Unknown module 'authmysql' skipped
Jan 14 15:34:19 acme authdaemond.plain: FAIL, all modules rejected
Jan 14 15:34:24 acme courierpop3login: LOGIN FAILED, ip=[::ffff:127.0.0.1]
Jan 14 15:34:35 acme courierpop3login: LOGOUT, ip=[::ffff:127.0.0.1]


Volgens mij zit het hem hierin: authdaemond.plain: Unknown module 'authmysql' skipped
Waarom wordt de authmysql geskipped? Mis ik libraries? Is er iets fout geinstalleerd?

Rechten:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
acme:/etc/courier# ls -l
total 68
-rw-rw----  1 daemon daemon  2707 2006-01-13 19:16 authdaemonrc
-rw-r--r--  1 root   root     433 2006-01-13 17:06 authmysqlrc
-rw-r--r--  1 root   root    8132 2005-11-20 18:22 authmysqlrc.dpkg-new
-rw-r--r--  1 root   root   12629 2005-11-20 18:22 imapd
-rw-------  1 daemon daemon   336 2005-11-20 18:22 imapd.cnf
-rw-------  1 root   root    2142 2006-01-11 02:50 imapd.pem
-rw-r--r--  1 root   root    6097 2005-11-20 18:22 imapd-ssl
-rw-r--r--  1 root   root    3812 2005-11-20 18:22 pop3d
-rw-------  1 daemon daemon   336 2005-11-20 18:22 pop3d.cnf
-rw-------  1 root   root    2146 2006-01-11 02:50 pop3d.pem
-rw-r--r--  1 root   root    5708 2005-11-20 18:22 pop3d-ssl


/etc/courier/authmysqlrc
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD ********
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
#MYSQL_NAME_FIELD
MYSQL_QUOTA_FIELD quota


/etc/courier/authdaemonrc
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $
#
# Copyright 2000-2001 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:0
#
# 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: authcustom authcram authuserdb authldap authpgsql authmysql authpam

authmodulelist="authmysql"
DEBUG_LOGIN=2
##NAME: authmodulelistorig:1
#
# This setting is used by Courier's webadmin module, and should be left
# alone

authmodulelistorig="authcustom authcram authuserdb authldap authpgsql authmysql authpam"

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

##NAME: version:0
#
# When you have multiple versions of authdaemond.* installed, authdaemond
# just picks the first one it finds.  Set "version" to override that.
# For example:  version=authdaemond.plain

version=""

##NAME: authdaemonvar:0
#
# 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=/var/run/courier/authdaemon


/etc/postfix/main.cf
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

smtpd_banner = $myhostname ESMTP $mail_name
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

myhostname = mail.medendo.nl
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = acme.medendo.nl, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
home_mailbox = Maildir/

virtual_maps = hash:/etc/postfix/virtusertable

mydestination = mail.medendo.nl, localhost, localhost.localdomain
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
transport_maps = mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings



Volgens mij heb ik toch echt alles goed staan, misschien mis ik iets. Ik zoek nu al 2 dagen met google maar word er niet veel wijzer van.
Wat doe ik fout?

  • ralfbosz
  • Registratie: December 2000
  • Laatst online: 07-02 21:03

ralfbosz

xm create bosz -c

Zet de logging van MySQL eens aan, dat is altijd een stuk verheldener. Best kans dat je gebruiker zich aanmeldt via localhost.localdomain ipv localhost. Of met een heel andere naam.

rm -r *


  • medendo
  • Registratie: Januari 2003
  • Laatst online: 11-01 15:39
MySQL logging aangezet en herstart, poging gedaan tot inloggen en dit is alles wat ik zie:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/usr/sbin/mysqld, Version: 4.0.24_Debian-10sarge1-log, started with:
Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument
060114 16:46:39       1 Connect     debian-sys-maint@localhost on
                      1 Quit
                      2 Connect     debian-sys-maint@localhost on
                      2 Quit
                      3 Connect     debian-sys-maint@localhost on
                      3 Query       show /*!40003 GLOBAL */ variables
                      3 Quit
                      4 Connect     debian-sys-maint@localhost on
                      4 Query       SHOW DATABASES
                      4 Init DB     db_ispconfig
                      4 Query       SHOW TABLES
                      4 Query       CHECK TABLE `del_status`  FAST
                      4 Query       CHECK TABLE `dns_a`  FAST
                      4 Query       CHECK TABLE `dns_cname`  FAST
                      4 Query       CHECK TABLE `dns_dep`  FAST
                      4 Query       CHECK TABLE `dns_isp_dns`  FAST
                      4 Query       CHECK TABLE `dns_mx`  FAST
                      4 Query       CHECK TABLE `dns_nodes`  FAST
                      4 Query       CHECK TABLE `dns_secondary`  FAST
                      4 Query       CHECK TABLE `dns_spf`  FAST
                      4 Query       CHECK TABLE `doctype`  FAST
                      4 Query       CHECK TABLE `groups`  FAST
                      4 Query       CHECK TABLE `help_documents`  FAST
                      4 Query       CHECK TABLE `help_nodes`  FAST
                      4 Query       CHECK TABLE `help_tickets`  FAST
                      4 Query       CHECK TABLE `isp_com`  FAST
                      4 Query       CHECK TABLE `isp_dep`  FAST
                      4 Query       CHECK TABLE `isp_dienste`  FAST
                      4 Query       CHECK TABLE `isp_fakt_artikel`  FAST
                      4 Query       CHECK TABLE `isp_fakt_dep`  FAST
                      4 Query       CHECK TABLE `isp_fakt_nodes`  FAST
                      4 Query       CHECK TABLE `isp_fakt_rechnung`  FAST
                      4 Query       CHECK TABLE `isp_fakt_record`  FAST
                      4 Query       CHECK TABLE `isp_firewall`  FAST
                      4 Query       CHECK TABLE `isp_htaccess`  FAST
                      4 Query       CHECK TABLE `isp_isp_actions`  FAST
                      4 Query       CHECK TABLE `isp_isp_admin`  FAST
                      4 Query       CHECK TABLE `isp_isp_datenbank`  FAST
                      4 Query       CHECK TABLE `isp_isp_domain`  FAST
                      4 Query       CHECK TABLE `isp_isp_kunde`  FAST
                      4 Query       CHECK TABLE `isp_isp_reseller`  FAST
                      4 Query       CHECK TABLE `isp_isp_user`  FAST
                      4 Query       CHECK TABLE `isp_isp_web`  FAST
                      4 Query       CHECK TABLE `isp_isp_web_template`  FAST
                      4 Query       CHECK TABLE `isp_monitor`  FAST
                      4 Query       CHECK TABLE `isp_nodes`  FAST
                      4 Query       CHECK TABLE `isp_server`  FAST
                      4 Query       CHECK TABLE `isp_server_ip`  FAST
                      4 Query       CHECK TABLE `isp_serverstatus`  FAST
                      4 Query       CHECK TABLE `isp_traffic`  FAST
                      4 Query       CHECK TABLE `isp_traffic_ip`  FAST
                      4 Query       CHECK TABLE `listtype`  FAST
                      4 Query       CHECK TABLE `login`  FAST
                      4 Query       CHECK TABLE `multidoc_dep`  FAST
                      4 Query       CHECK TABLE `multidoc_nodes`  FAST
                      4 Query       CHECK TABLE `session`  FAST
                      4 Query       CHECK TABLE `sys_config`  FAST
                      4 Query       CHECK TABLE `sys_dep`  FAST
                      4 Query       CHECK TABLE `sys_modules`  FAST
                      4 Query       CHECK TABLE `sys_news`  FAST
                      4 Query       CHECK TABLE `sys_nodes`  FAST
                      4 Query       CHECK TABLE `sys_user`  FAST
                      4 Query       CHECK TABLE `user_groups`  FAST
                      4 Init DB     mail
                      4 Query       SHOW TABLES
                      4 Query       CHECK TABLE `domains`  FAST
                      4 Query       CHECK TABLE `forwardings`  FAST
                      4 Query       CHECK TABLE `transport`  FAST
                      4 Query       CHECK TABLE `users`  FAST
                      4 Init DB     mysql
                      4 Query       SHOW TABLES
                      4 Query       CHECK TABLE `columns_priv`  FAST
                      4 Query       CHECK TABLE `db`  FAST
                      4 Query       CHECK TABLE `func`  FAST
                      4 Query       CHECK TABLE `host`  FAST
                      4 Query       CHECK TABLE `tables_priv`  FAST
                      4 Query       CHECK TABLE `user`  FAST
                      4 Quit

  • _JGC_
  • Registratie: Juli 2000
  • Nu online
Je hebt wel de mysql authmodules geinstalleerd? Als ie al zegt dat ie authmysql niet kan vinden, lijkt het me ook niet zo vreemd dat je geen queries in MySQL tegenkomt. Debian heeft de gewoonte om alles te splitten wat los en vast zit, zo ook je courier authenticatie modules.

  • medendo
  • Registratie: Januari 2003
  • Laatst online: 11-01 15:39
Die staat er gewoon op. Ik heb ook gecheckt op dependencies, maar die waren er ook niet.

  • Gertjan
  • Registratie: Oktober 2001
  • Laatst online: 07-02 20:23

Gertjan

mmmm, beer...

Zie ^. Heb je pakket 'courier-authmysql' geinstalleerd?

  • medendo
  • Registratie: Januari 2003
  • Laatst online: 11-01 15:39
Courier-authmysql staat er gewoon op. Het lijkt heel simpel als je de foutmelding ziet, maar dat blijkt dus niet zo te zijn.
code:
1
authdaemond.plain: Unknown module 'authmysql' skipped


De vraag lijkt mij eerder welk proces zegt dat de authenticatie op deze manier moet verlopen.
Klopt dit wel?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
acme:/home/medendo# cat /usr/lib/courier/authlib/authdaemond
#! /bin/sh

exec_prefix=/usr
sbindir=${exec_prefix}/sbin
DIR=`dirname $0`

AUTHDAEMOND=authdaemond.plain

if test -x $DIR/authdaemond.ldap
then
        AUTHDAEMOND=authdaemond.ldap
fi

if test -x $DIR/authdaemond.mysql
then
        AUTHDAEMOND=authdaemond.mysql
fi

if test -x $DIR/authdaemond.pgsql
then
        AUTHDAEMOND=authdaemond.pgsql
fi

. /etc/courier/authdaemonrc
if test "$version" != ""
then
        AUTHDAEMOND="$version"
fi

export DEBUG_LOGIN
exec ${sbindir}/courierlogger -pid=/var/run/courier/authdaemon/pid -$1 $DIR/$AUTHDAEMOND

  • Scharnout
  • Registratie: November 2000
  • Laatst online: 12-12-2025

Scharnout

Meuk

Misschien moet je in je authdaemonrc dit:
code:
1
version=""

vervangen met
code:
1
version="authdaemond.mysql"

Staat bij mij ook boven:
code:
1
2
3
# When you have multiple versions of authdaemond.* installed, authdaemond
# just picks the first one it finds.  Set "version" to override that.
# For example:  version=authdaemond.plain

And Bob's your uncle ...


  • medendo
  • Registratie: Januari 2003
  • Laatst online: 11-01 15:39
Zoals ik al vermoedde miste ik een aantal libraries. Zit ik dagen te googlen terwijl de manpage zoveel helderheid kan scheppen... 8)7

Echter; het werkt nog steeds niet.
code:
1
2
3
4
5
6
7
8
9
10
Jan 16 19:41:39 acme authdaemond.mysql: received auth request, service=pop3, authtype=login
Jan 16 19:41:39 acme authdaemond.mysql: authmysql: trying this module
Jan 16 19:41:39 acme authdaemond.mysql: SQL query: SELECT email, password, "", 5000, 5000, "/home/vmail", CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_
INDEX(email,'@',1),'/'), quota, "", "" FROM users WHERE email = "postmaster"
Jan 16 19:41:39 acme authdaemond.mysql: zero rows returned
Jan 16 19:41:39 acme authdaemond.mysql: no password available to compare
Jan 16 19:41:39 acme authdaemond.mysql: authmysql: REJECT - try next module
Jan 16 19:41:39 acme authdaemond.mysql: FAIL, all modules rejected
Jan 16 19:41:44 acme courierpop3login: LOGIN FAILED, ip=[::ffff:127.0.0.1]
Jan 16 19:41:48 acme courierpop3login: LOGOUT, ip=[::ffff:127.0.0.1]


Dit lijkt me typisch iets wat ik in de database moet zoeken ... Ik heb nog (helemaal) niet zo'n verstand van MySQL maar ga het weer proberen :)

[ Voor 6% gewijzigd door medendo op 16-01-2006 20:11 . Reden: typo ]


  • medendo
  • Registratie: Januari 2003
  • Laatst online: 11-01 15:39
Het werkte dus al die tijd al. |:(
Inloggen met @domain.tld bij je username doet wonderen 8)7
Pagina: 1