A NOTE has been added to this issue. ====================================================================== http://www.dbmail.org/mantis/view.php?id=290 ====================================================================== Reported By: moje Assigned To: ====================================================================== Project: DBMail Issue ID: 290 Category: Database layer Reproducibility: always Severity: block Priority: normal Status: new ====================================================================== Date Submitted: 04-Jan-06 19:44 CET Last Modified: 04-Jan-06 22:21 CET ====================================================================== Summary: Unable to create INBOX (or trash and next ...) if USER is not in dbmail_users (using LDAP auth) Description: errormsg: dbpgsql.c, db_query: Error executing query [INSERT INTO dbmail_mailboxes (name, owner_idnr,seen_flag, answered_flag, deleted_flag, flagged_flag, recent_flag, draft_flag, permission) VALUES ('Trash', '500', 1, 1, 1, 1, 1, 1, 2)] : [ERROR: insert or update on table "dbmail_mailboxes" violates foreign key constraint "dbmail_mailboxes_owner_idnr_fkey" DETAIL: Key (owner_idnr)=(500) is not present in table "dbmail_users". ]
Recomendation: Create user in dbmail_users if auth is success, but user don't exists. ====================================================================== ---------------------------------------------------------------------- aaron - 04-Jan-06 21:00 ---------------------------------------------------------------------- Please set trace_syslog = 5 and post more of the output. I'm looking for db.c,db_user_find_create: user_idnr [500] If we don't see that, then I'll instrument some more code and have you test again. ---------------------------------------------------------------------- moje - 04-Jan-06 21:20 ---------------------------------------------------------------------- i have trace_syslog on level 5. problem is in file db.c, function db_createmailbox() if LDAP auth is in use, no users are in dbmail_users and default constraint is don't allow create mailboxes for users which are not in dbmail_users. Current solution is exit from db_createmailbox(). better may be create user and than create mailbox. ---------------------------------------------------------------------- aaron - 04-Jan-06 21:31 ---------------------------------------------------------------------- In db_createmailbox, you will see this section: if (auth_requires_shadow_user()) { ... } For auth ldap, this function returns true. The code inside creates the shadow user. Please post the additional logs so that I can see if that code is running. ---------------------------------------------------------------------- moje - 04-Jan-06 22:13 ---------------------------------------------------------------------- Sorry, but can't use svn trunk. it's close to impossible to build incomplete build tree on my test machine. I have 2.1.3 version only :-(. ---------------------------------------------------------------------- aaron - 04-Jan-06 22:21 ---------------------------------------------------------------------- I *highly* recommend SVN trunk over 2.1.3. There are a number of known bugs that have been fixed, and I don't believe that anything is totally broken in trunk right now. If you have build problems, post to the mailing list and we'll help you out! Issue History Date Modified Username Field Change ====================================================================== 04-Jan-06 19:44 moje New Issue 04-Jan-06 21:00 aaron Note Added: 0000968 04-Jan-06 21:20 moje Note Added: 0000972 04-Jan-06 21:31 aaron Note Added: 0000973 04-Jan-06 22:13 moje Note Added: 0000974 04-Jan-06 22:21 aaron Note Added: 0000975 ======================================================================