6 messages in net.sourceforge.lists.courier-usersRe: [courier-users] Authmysql trouble...
FromSent OnAttachments
Simone NanniMay 23, 2006 9:05 am 
Jay LeeMay 23, 2006 10:02 am 
ma...@intron.acMay 23, 2006 10:36 am 
moussMay 28, 2006 2:01 pm 
ma...@intron.acMay 28, 2006 11:11 pm 
moussMay 29, 2006 6:17 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] Authmysql trouble...Actions...
From:ma...@intron.ac (ma@intron.ac)
Date:May 28, 2006 11:11:37 pm
List:net.sourceforge.lists.courier-users

mouss wrote:

ma@intron.ac wrote:

I have the same sense. What Simone wrote into authmysqlrc would take effect in SQL command as:

SELECT '/usr/local/virtual','1001','1001' FROM mailbox WHERE ...

Obviously, your data table hasn't fields "'/usr/local/virtual'" and "'1001'".

This actually works. This is a valid mysql statement. SELECT 'foo'; returns 'foo'.

You are quite right and I misunderstood them. But since Mr.Sam names those options "XXX_FIELD", it's better to write field names here for clearer meaning.

I suggess you to:

1. Add a field "home" into your table "mailbox". 2. Write the three lines as followed:

MYSQL_HOME_FIELD home MYSQL_UID_FIELD uid MYSQL_GID_FIELD gid

He doesn't need to add unnecessary columns.

Actually, only a field "home" is enough, which implies every user's maildir as "$HOME/Maildir". No need to specify "maildir" respectively.

no, his home is constant. he thus needs to define a maildir field, either in his sql table or use something like

MYSQL_MAILDIR_FIELD concat(domain, '/', username, '/') (I'm not sure what's in his 'username' field though...).

If home is constant, other problems will arise. The file etc/maildirfilterconfig should be modified. Alias files $HOME/.courier-* may not exist, then. I believe that per-user home is better.

Besides debugging method introduced by Jay, you may also run MySQL server in debug mode. In this case, MySQL server will log all submitted SQL commands in trace file. See the section "Creating Trace Files" (F.1.2 or E.1.2) in MySQL Reference Manual.

P.S. To secure your MySQL server, you may run it with "--skip-networking" to disable TCP port at all. In authmysqlrc, you may use "MYSQL_SOCKET" to specify MySQL server's UNIX domain socket entry instead of "MYSQL_SERVER" for "127.0.0.1".

127.0.0.1 may help in chrotted environments. also, some systems have a broken implementation of unix sockets.

Unix domain socket has a much higher efficiency than TCP on loopback network. Actually the most popular free OSs, GNU/Linux and *BSD have implemented it well.

If chrooted environment such as FreeBSD's JAIL is required to be applied, the socket-bound file may be put into the chrooted environment. Actually, MySQL client program always knows username and password to access MySQL server, which means the MySQL server outside JAIL is as dangerous as the MySQL client inside JAIL. Only to put the whole MySQL server into JAIL is a complete solution.

------------------------------------------------------------------------ From Beijing, China