The following issue has been RESOLVED. ====================================================================== http://www.dbmail.org/mantis/view.php?id=369 ====================================================================== Reported By: cmayo Assigned To: aaron ====================================================================== Project: DBMail Issue ID: 369 Category: PIPE delivery (dbmail-smtp) Reproducibility: always Severity: minor Priority: normal Status: resolved target: Resolution: fixed Fixed in Version: 2.0 branch ====================================================================== Date Submitted: 20-Jun-06 20:13 CEST Last Modified: 25-Jun-06 20:21 CEST ====================================================================== Summary: Blank emails cause huge rfcsize Description: A problem with my ISP's mail server generated blank emails that dbmail calculates huge rfcsize values for that don't fit in dbmail_physmessage, syslog messages:
Jun 18 19:45:34 dbmail/smtp[25366]: dbpgsql.c, db_query: Error executing query [UPDATE dbmail_physmessage SET messagesize = '265', rfcsize = '13254448676894499075' WHERE id = '156779'] : [ERROR: value "13254448676894499075" is out of range for type bigint ] Jun 18 19:45:34 dbmail/smtp[25366]: db.c,db_physmessage_set_sizes: error setting messagesize and rfcsize for physmessage [156779] Jun 18 19:45:34 dbmail/smtp[25366]: db.c,db_update_message: error updating physmessage [156779]. The database might be inconsistent. Run dbmail-util Example message attached, one of four may not be the exact one that generated this error (I have some of the characters in the email address - this is a spam free account! - let me know if this is a problem) I am running dbmail 2.0.10 on Postgresql 8.1.4. ====================================================================== Relationships ID Summary ---------------------------------------------------------------------- related to 0000294 Server doesn't work properly with messa... ====================================================================== ---------------------------------------------------------------------- aaron - 20-Jun-06 21:00 ---------------------------------------------------------------------- I think that this is fixed in dbmail_2_0_branch. Would you mind testing that? ---------------------------------------------------------------------- cmayo - 24-Jun-06 12:37 ---------------------------------------------------------------------- I've tried with dbmail-2.1.6, using dbmail-smtp -m chris < rfcsize_problem.eml. It processes the message, calculates an rfcsize of 359, and then deletes it: Jun 24 11:28:13 dbmail/smtp[18851]: dbmail-message.c,dbmail_message_cache_subjectfield: no subject field value [2] Jun 24 11:28:13 dbmail/smtp[18851]: pipe.c, insert_messages: temporary msgidnr is [2] Jun 24 11:28:13 dbmail/smtp[18851]: dbpgsql.c,db_query: executing query [SELECT physmessage_id FROM dbmail_messages WHERE message_idnr = '2'] Jun 24 11:28:13 dbmail/smtp[18851]: dbpgsql.c,db_query: executing query [DELETE FROM dbmail_messages WHERE message_idnr = '2'] Jun 24 11:28:13 dbmail/smtp[18851]: dbpgsql.c,db_query: executing query [SELECT message_idnr FROM dbmail_messages WHERE physmessage_id = '2'] Jun 24 11:28:13 dbmail/smtp[18851]: dbpgsql.c,db_query: executing query [DELETE FROM dbmail_physmessage WHERE id = '2'] Jun 24 11:28:13 dbmail/smtp[18851]: dbpgsql.c,db_query: executing query [DELETE FROM dbmail_messageblks WHERE physmessage_id = '2'] Jun 24 11:28:13 dbmail/smtp[18851]: pipe.c, insert_messages: temporary message deleted from database. Done. Jun 24 11:28:13 dbmail/smtp[18851]: dbpgsql.c,db_query: executing query [COMMIT] ---------------------------------------------------------------------- aaron - 24-Jun-06 17:32 ---------------------------------------------------------------------- Trunk is not affected by this issue. Please test dbmail_2_0_branch: svn checkout https://svn.ic-s.nl/svn/dbmail/branches/dbmail_2_0_branch/dbmail Thanks! ---------------------------------------------------------------------- cmayo - 24-Jun-06 19:50 ---------------------------------------------------------------------- Tried with dbmail_2_0_branch r2187 and still see the same problem: dbmail/smtp[22405]: dbpgsql.c, db_query: Error executing query [UPDATE dbmail_physmessage SET messagesize = '265', rfcsize = '13254237570661916931' WHERE id = '157319'] : [ERROR: value "13254237570661916931" is out of range for type bigint ] ---------------------------------------------------------------------- aaron - 25-Jun-06 01:59 ---------------------------------------------------------------------- I traced the calls back from the query, and I think I've found where the value was set (or not set, as might have been the issue). Let me know if this patch resolves the issue. ---------------------------------------------------------------------- cmayo - 25-Jun-06 14:11 ---------------------------------------------------------------------- The patch seems to do the trick; log below. Many thanks for a great application! Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [INSERT INTO dbmail_physmessage (messagesize, internal_date) VALUES ('0', CURRENT_TIMESTAMP)] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [SELECT currval('dbmail_physmessage_id_seq')] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [INSERT INTO dbmail_messages(mailbox_idnr, physmessage_id, unique_id,recent_flag, status) VALUES ('113', '157359', '0532b937ad0d431e61501369a44cc5ae', '1', '5')] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [SELECT currval('dbmail_message_idnr_seq')] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [SELECT physmessage_id FROM dbmail_messages WHERE message_idnr = '214608'] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [INSERT INTO dbmail_messageblks (is_header, messageblk, blocksize, physmessage_id) VALUES ('1','Envelope-to: [EMAIL PROTECTED] Delivery-date: Sun, 11 Jun 2006 12:46:15 +0100 Received: from localhost ([127.0.0.1]) by pih-mxcore07.plus.net with esmtp (PlusNet MXCore v2.00) id 1FpOOV-0008Am-F8 for [EMAIL PROTECTED]; Sun, 11 Jun 2006 12:46:15 +0100 ', '265', '157359')] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [SELECT currval('dbmail_messageblk_idnr_seq')] Jun 25 12:34:49 dbmail/smtp[5248]: store_message_temp(): allocating [524288] bytes of memory for readblock Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [UPDATE dbmail_messages SET unique_id = '0532b937ad0d431e61501369a44cc5ae', status = '0' WHERE message_idnr = '214608'] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [SELECT physmessage_id FROM dbmail_messages WHERE message_idnr = '214608'] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [UPDATE dbmail_physmessage SET messagesize = '265', rfcsize = '271' WHERE id = '157359'] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [SELECT dbmail_mailboxes.owner_idnr FROM dbmail_mailboxes, dbmail_messages WHERE dbmail_mailboxes.mailbox_idnr = dbmail_messages.mailbox_idnr AND dbmail_messages.message_idnr = '214608']Jun 25 12:34:49 dbmail/smtp[5248]: db.c,db_add_quotum_used: adding 265 to mailsize Jun 25 12:34:49 dbmail/smtp[5248]: db.c.user_idnr_is_delivery_user_idnr: looking up user_idnr for [EMAIL PROTECTED]@__ Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [SELECT user_idnr FROM dbmail_users WHERE userid='[EMAIL PROTECTED]@__'] Jun 25 12:34:49 dbmail/smtp[5248]: pipe.c, insert_messages: temporary msgidnr is [214608] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [SELECT physmessage_id FROM dbmail_messages WHERE message_idnr = '214608'] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [DELETE FROM dbmail_messages WHERE message_idnr = '214608'] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [SELECT message_idnr FROM dbmail_messages WHERE physmessage_id = '157359'] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [DELETE FROM dbmail_physmessage WHERE id = '157359'] Jun 25 12:34:49 dbmail/smtp[5248]: dbpgsql.c,db_query: executing query [DELETE FROM dbmail_messageblks WHERE physmessage_id = '157359'] Jun 25 12:34:49 dbmail/smtp[5248]: insert_messages(): temporary message deleted from database Jun 25 12:34:49 dbmail/smtp[5248]: insert_messages(): End of function ---------------------------------------------------------------------- aaron - 25-Jun-06 20:21 ---------------------------------------------------------------------- Thanks very much for your help testing! Now in SVN. Issue History Date Modified Username Field Change ====================================================================== 20-Jun-06 20:13 cmayo New Issue 20-Jun-06 20:13 cmayo File Added: rfcsize_problem.eml 20-Jun-06 20:14 cmayo Issue Monitored: cmayo 20-Jun-06 20:59 aaron Relationship added related to 0000294 20-Jun-06 21:00 aaron Note Added: 0001253 24-Jun-06 12:37 cmayo Note Added: 0001279 24-Jun-06 17:32 aaron Note Added: 0001280 24-Jun-06 19:50 cmayo Note Added: 0001281 25-Jun-06 01:58 aaron File Added: empty_body_rfcsize.diff 25-Jun-06 01:59 aaron Note Added: 0001282 25-Jun-06 14:11 cmayo Note Added: 0001283 25-Jun-06 20:21 aaron Status new => resolved 25-Jun-06 20:21 aaron Fixed in Version => 2.0 branch 25-Jun-06 20:21 aaron Resolution open => fixed 25-Jun-06 20:21 aaron Assigned To => aaron 25-Jun-06 20:21 aaron Note Added: 0001284 ======================================================================