Hello all,

I'm having a bit of trouble with Courier-POP and MySQL.

This is a tipical case: Postfix + MySQL + Courier-POP. Postfix works
fine leaving mail in their corresponding maildirs. That means that
there's a way of doing it that works (I've got a user with enough
permisions in the database etc.).

The problem is this:

pepe@espai1:~$ telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Hello there.
user imauser
+OK Password required.
pass thisismypasswd
-ERR Login failed.
quit
+OK Better luck next time.
Connection closed by foreign host.
pepe@espai1:~$ 


That's exactly what happend when I type imauser@<my domain>, too.


The same user is capable of receiving mail. The password was correctly
typed. Here's the line in /var/log/mysql.log:



[...]  3 Connect     Access denied for user: 'postfix    @localhost' \
(Using password: YES)





And from /var/log/mail.log:



Jan 22 23:58:44 espai1 courierpop3login: Connection, \
ip=[::ffff:127.0.0.1]
Jan 22 23:58:57 espai1 courierpop3login: LOGIN FAILED, \
ip=[::ffff:127.0.0.1]
Jan 22 23:59:12 espai1 courierpop3login: Disconnected, \
ip=[::ffff:127.0.0.1]





I can't understand why this happens. It seems to me that the root of the
problem is in 'postfix    @localhost' not being equal to
'postfix@localhost' when trying to access the database. In fact, I can
do it by hand:



pepe@espai1:~$ mysql -h localhost -P 3306 -u postfix -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 3.23.49-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mail;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+----------------+
| Tables_in_mail |
+----------------+
| alias          |
| relocated      |
| transport      |
| users          |
| virtual        |
+----------------+
5 rows in set (0.01 sec)

mysql> quit
Bye
pepe@espai1:~$ 




As you can see, the user 'postfix' can access the tables it needs. I
already knew that, since Postfix delivers the incoming mails correctly.

Here's what mysql.log says this time:

... 10 Connect     postfix@localhost on 
<and the lines corresponding to the commands I've introduced>





Where and why are the blanks in 'postfix    @localhost' produced? That's
the problem, isn't it? Any idea about how to solve this? Any "definitive
guide" covering this?   :)





I'm using an updated Debian GNU/Linux 3.0. The versions of the programs
are:

pepe@espai1:~$ dpkg -s mysql-server
...
Version: 3.23.49-8.2


pepe@espai1:~$ dpkg -s courier-base
...
Version: 0.37.3-2.3

Same for courier-authdaemon, courier-pop and courier-authmysql.




And here come four config files:




/etc/courier/pop3d

prefix=/usr
exec_prefix=/usr
sbindir="/usr/sbin"
PIDFILE=/var/run/courier/pop3d.pid
MAXDAEMONS=40
MAXPERIP=4
AUTHMODULES="authdaemon"
AUTHMODULES_ORIG="authdaemon"
POP3AUTH="LOGIN CRAM-MD5 CRAM-SHA1"
POP3AUTH_ORIG="LOGIN CRAM-MD5 CRAM-SHA1"
POP3AUTH_TLS=""
POP3AUTH_TLS_ORIG="LOGIN PLAIN"
PORT=110
ADDRESS=0
TCPDOPTS="-nodnslookup -noidentlookup"
POP3DSTART=YES





/etc/courier/authdaemonrc

authmodulelist="authmysql"
authmodulelistorig="authcustom authcram authuserdb authldap authmysql authpam"
daemons=5
version="authdaemond.mysql"
authdaemonvar=/var/run/courier/authdaemon





/etc/courier/authmysqlrc

MYSQL_SERVER            localhost
MYSQL_USERNAME      postfix     
MYSQL_PASSWORD          <clear password>
#MYSQL_SOCKET           /var/run/mysql/mysql.sock
MYSQL_PORT              3306
MYSQL_OPT           0
MYSQL_DATABASE          mail
MYSQL_USER_TABLE        users
MYSQL_CLEAR_PWFIELD     clear
DEFAULT_DOMAIN          <my domain>
MYSQL_UID_FIELD         uid
MYSQL_GID_FIELD         gid
MYSQL_LOGIN_FIELD       email
MYSQL_HOME_FIELD        homedir
MYSQL_NAME_FIELD        name
MYSQL_QUOTA_FIELD       quota





/etc/courier/authmodulelist

authdaemon






I've been advised to migrate to LDAP. It is feasible since I've just
begun with MySQL, but time is begining to become valuable and I'd still
like to give MySQL a chance.

Any ideas?



Thanks a lot,


Pepe.

-- 
Jos� Marcos Chalm�s Garc�a - Public key ID: 0x6FDE933B
www.polinux.upv.es - www.debian.org - www.gnu.org - www.bsd.org - ...
I use free software | Utilitze programari lliure | Uso software libre
---------------------------------------------------------------------



-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to