you can try deleting the duplicate records from dbmail cache in mysql DB and the rerun 'dbmail-util -ay'
Here is an example to remove these records: DELETE FROM dbmail_ccfield WHERE physmessage_id='3335'; DELETE FROM dbmail_datefield WHERE physmessage_id='3335'; DELETE FROM dbmail_envelope WHERE physmessage_id='3335'; DELETE FROM dbmail_fromfield WHERE physmessage_id='3335'; DELETE FROM dbmail_headervalue WHERE physmessage_id='3335'; DELETE FROM dbmail_referencesfield WHERE physmessage_id='3335'; DELETE FROM dbmail_replytofield WHERE physmessage_id='3335'; DELETE FROM dbmail_subjectfield WHERE physmessage_id='3335'; DELETE FROM dbmail_tofield WHERE physmessage_id='3335'; ----- Original Message ---- From: Sergey Spiridonov <[email protected]> To: [email protected] Sent: Wed, June 2, 2010 8:13:58 AM Subject: Re: [Dbmail] dbmail/maintenance error: Duplicate entry ... for key 2] [INSERT INTO dbmail_datefield I can reproduce this by running bmail-util -ay: # dbmail-util -ay Repairing DBMAIL messageblocks integrity... Ok. Found [0] unconnected messageblks. Repairing DBMAIL physmessage integrity... Ok. Found [0] unconnected physmessages. Repairing DBMAIL message integrity... Ok. Found [0] unconnected messages. Repairing DBMAIL mailbox integrity... Ok. Found [0] unconnected mailboxes. Repairing DBMAIL for NULL messages... Ok. Found [0] NULL messages. Checking DBMAIL for NULL physmessages... Ok. Found [0] physmessages without messageblocks. Deleting messages with DELETE status... Ok. [0] messages deleted. Repairing DBMAIL for rfcsize field... Ok. Found [0] missing rfcsize values. Repairing DBMAIL for incorrect is_header flags... Ok. Found [0] incorrect is_header flags. Repairing DBMAIL for cached envelopes... Ok. Found [0] missing envelope values. Repairing DBMAIL for cached header values... Ok. Found [3] un-cached physmessages. Jun 02 17:14:23 jupiter dbmail-util[18603]: Error:[sql] dbmysql.c,db_query(+290): [Duplicate entry '7503-1970-01-01 00:00:00' for key 2] [INSERT INTO dbmail_datefield (physmessage_id, datefield) VALUES (7503,'1970-01-01 00:00:00')] Jun 02 17:14:23 jupiter dbmail-util[18603]: Error:[message] dbmail-message.c,insert_field_cache(+1105): insert datefield failed [INSERT INTO dbmail_datefield (physmessage_id, datefield) VALUES (7503,'1970-01-01 00:00:00')] ...Jun 02 17:14:23 jupiter dbmail-util[18603]: Error:[sql] dbmysql.c,db_query(+290): [Duplicate entry '7446-1970-01-01 00:00:00' for key 2] [INSERT INTO dbmail_datefield (physmessage_id, datefield) VALUES (7446,'1970-01-01 00:00:00')] Jun 02 17:14:23 jupiter dbmail-util[18603]: Error:[message] dbmail-message.c,insert_field_cache(+1105): insert datefield failed [INSERT INTO dbmail_datefield (physmessage_id, datefield) VALUES (7446,'1970-01-01 00:00:00')] ...Jun 02 17:14:23 jupiter dbmail-util[18603]: Error:[sql] dbmysql.c,db_query(+290): [Duplicate entry '3335-1970-01-01 00:00:00' for key 2] [INSERT INTO dbmail_datefield (physmessage_id, datefield) VALUES (3335,'1970-01-01 00:00:00')] Jun 02 17:14:23 jupiter dbmail-util[18603]: Error:[message] dbmail-message.c,insert_field_cache(+1105): insert datefield failed [INSERT INTO dbmail_datefield (physmessage_id, datefield) VALUES (3335,'1970-01-01 00:00:00')] ... Setting DELETE status for deleted messages... Ok. [0] messages set for deletion. Re-calculating used quota for all users... Ok. Used quota updated for all users. Removing aliases with nonexistent delivery userid's... Ok. Found [0] dangling aliases. Vacuuming and optimizing database... Ok. Database cleaned up. Maintenance done. Errors were found and fixed. We suggest running dbmail-util again to confirm that all errors were repaired. -- Best regards, Sergey Spiridonov _______________________________________________ DBmail mailing list [email protected] http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail _______________________________________________ DBmail mailing list [email protected] http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail
