1

I'm trying to connect Courier to MySQL on a RHEL6. I've installed the Courier using RPMs and not the repositories (which I think is the root of my problems). Anyway, here are the packages I've installed:

$ rpm -qa | grep courier
courier-imap-4.10.0.20120202-7.3.i686
courier-authlib-userdb-0.63.1.20111230-4.4.i686
courier-authlib-mysql-0.63.1.20111230-4.4.i686
courier-authlib-pipe-0.63.1.20111230-4.4.i686
courier-authlib-0.63.1.20111230-4.4.i686

As I've got some experience installing the same on my Ubuntu machine, so I turned to following configuration files in order to set my MySQL credentials:

/etc/courier/authdaemonrc
/etc/courier/authmysqlrc

But it seems to me that the /etc/init.d/courier-authlib script is not using these configurations. The evidence to proof my claim is the entries in /var/log/maillog:

Jun  1 14:09:56 mail imapd: Connection, ip=[::ffff:127.0.0.1]
Jun  1 14:09:56 mail authdaemond: failed to connect to mysql server (server=mysql.example.com, userid=admin): Unknown MySQL server host 'mysql.example.com' (1)
Jun  1 14:09:56 mail imapd: LOGIN FAILED, user=someuser@somedomain.com, ip=[::ffff:127.0.0.1]
Jun  1 14:09:56 mail imapd: authentication error: Input/output error

It's in the case that I've set MySQL address to localhost! Does anyone know how can I set / find configuration files for this daemon?

Mehran
  • 519
  • 1
  • 5
  • 20

1 Answers1

2

I am assuming that your rpm similiar with this one. This rpm will extract several files, including example of config-file.

Content of RPM :
/etc/authlib
/etc/authlib/authdaemonrc.dist
/etc/authlib/authldaprc.dist
/etc/authlib/authmysqlrc.dist
/etc/authlib/authpgsqlrc.dist
/etc/rc.d/init.d/courier-authlib
/usr/lib/courier-authlib
/usr/lib/courier-authlib/libauthcustom.la
/usr/lib/courier-authlib/libauthcustom.so
/usr/lib/courier-authlib/libauthcustom.so.0
/usr/lib/courier-authlib/libauthpam.la
/usr/lib/courier-authlib/libauthpam.so
/usr/lib/courier-authlib/libauthpam.so.0
/usr/lib/courier-authlib/libcourierauth.la
....

Therefore you can place the configuration file authdaemonrc and authmysqlrc to directory /etc/authlib.

Sidenote

When you install via rpm and you don't familiar with it, you can extract the rpm first with command (source)

rpm2cpio courier-authlib-0.63.1.20111230-4.4.i686.rpm | cpio -idmv`

This will help you to determine where your config file should have placed. Other ways you can use sites like above to determined what file(s) in that rpm

masegaloeh
  • 18,236
  • 10
  • 57
  • 106