On 01/03/16 02:25, Implausibility wrote:
> Hi.
> 
> I'm rather new to OpenBSD, but I've hit a wall while doing a 'dry-run' to 
> work out the bugs (and get familiar with OpenBSD) and build a new mail server 
> on OpenBSD with Postfix, MySQL/MariaDB, and Courier-authlib.
> 
> I've been following this tutorial, and while dated, I've found it closely 
> matches the features I want in a mail server:  
> http://www.kernel-panic.it/openbsd/mail/
> 
> This is OpenBSD 5.8 on i386 in a VMware partition.
> 
Some hints below.

> In short, I can't seem to authenticate through Courier-authlib.  The messages 
> I get consistently are:
[...]
# grep -v \#  authdaemonrc authmysqlrc pop3d-ssl pop3d.cnf    
authdaemonrc:authmodulelist="authmysql"
authdaemonrc:authmodulelistorig="authuserdb authpwd authpgsql authldap 
authmysql authsqlite authpipe"
authdaemonrc:daemons=10
authdaemonrc:authdaemonvar=/var/run/courier-auth
authdaemonrc:DEBUG_LOGIN=3
DEBUG_LOGIN=3 is not a proper value, DEBUG_LOGIN=2 is the maximum value allowed.

> authmysqlrc:MYSQL_SERVER                localhost
> authmysqlrc:MYSQL_USERNAME              vmail
> authmysqlrc:MYSQL_PASSWORD              bugue
> authmysqlrc:MYSQL_PORT          3306
> authmysqlrc:MYSQL_OPT           0
> authmysqlrc:MYSQL_DATABASE              mail
> authmysqlrc:MYSQL_USER_TABLE    users 
> authmysqlrc:MYSQL_CRYPT_PWFIELD password
> authmysqlrc:DEFAULT_DOMAIN              127.0.0.1  
> authmysqlrc:MYSQL_UID_FIELD             uid
> authmysqlrc:MYSQL_GID_FIELD             gid
> authmysqlrc:MYSQL_LOGIN_FIELD   login
> authmysqlrc:MYSQL_HOME_FIELD    home
> authmysqlrc:MYSQL_NAME_FIELD    name
> authmysqlrc:MYSQL_MAILDIR_FIELD maildir
> authmysqlrc:MYSQL_QUOTA_FIELD   quota
[...]
> I'm not using 'localhost', as that allows use of the socket file at 
> /var/run/mysql/mysql.sock, which is outside the postfix jail.  (Ask me how 
> long it took to find that one.)
> 
if you use 'localhost' in MYSQL_SERVER parameter, courier-authdaemond will try 
to access the unix socket, if you use '127.0.0.1' courier-authdaemond will try 
to connect to mysql via tcp/ip.
If connection to MySQL fails you should have this line in maillog:
------------------------
Jan  8 19:07:01 bigio authdaemond: failed to connect to mysql server 
(server=127.0.0.1, userid=admin): Can't connect to MySQL server on '127.0.0.1' 
(61 "Connection refused")
------------------------

 Cheers
  Giovanni

Reply via email to