Opened 7 years ago
Closed 6 years ago
#1484030 closed Bugs (worksforme)
db error when invalid (from) email address missing
| Reported by: | heathinc | Owned by: | till |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.1-rc2 |
| Component: | Database | Version: | 0.1-rc1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
There is a database error when i receive spam mail that is missing a email (from) address, date, and subject. The following error message is below and is when you see the list of emails you have.
DB Error in /home/MYUSERNAME/public_html/cube/program/include/rcube_db.inc (479): DB Error: constraint violation Query: INSERT INTO messages (user_id, del, cache_key, created, idx, uid, subject, from, to, cc, date, size, headers) VALUES ('2', 0, 'INBOX.msg', now(), '5', '154', , , 'mail@…', , FROM_UNIXTIME(-1), 729, 'O:14:\"iilbasicheader\":25:{s:2:\"id\";s:1:\"5\";s:3:\"uid\";s:3:\"154\";s:7:\"subject\";s:0:\"\";s:4:\"from\";N;s:2:\"to\";s:21:\"mail@MYDOMAIN.com\";s:2:\"cc\";s:0:\"\";s:7:\"replyto\";s:0:\"\";s:11:\"in_reply_to\";s:0:\"\";s:4:\"date\";N;s:9:\"messageID\";N;s:4:\"size\";s:3:\"729\
This next error is when you are viewing the actual message with no from address, subject, and time.
DB Error in /home/heathws/public_html/cube/program/include/rcube_db.inc (479): DB Error: constraint violation Query: INSERT INTO messages (user_id, del, cache_key, created, idx, uid, subject, from, to, cc, date, size, headers) VALUES ('2', 0, 'INBOX.msg', now(), '5', '154', , , 'mail@…', , FROM_UNIXTIME(-1), 729, 'O:14:\"iilbasicheader\":25:{s:2:\"id\";s:1:\"5\";s:3:\"uid\";s:3:\"154\";s:7:\"subject\";s:0:\"\";s:4:\"from\";N;s:2:\"to\";s:21:\"mail@heathhosting.com\";s:2:\"cc\";s:0:\"\";s:7:\"replyto\";s:0:\"\";s:11:\"in_reply_to\";s:0:\"\";s:4:\"date\";N;s:9:\"messageID\";N;s:4:\"size\";s:3:\"729\
DB Error in /home/heathws/public_html/cube/program/include/rcube_db.inc (479): DB Error: constraint violation Query: INSERT INTO messages (user_id, del, cache_key, created, idx, uid, subject, from, to, cc, date, size, headers) VALUES ('2', 0, 'INBOX.msg', now(), '5', '154', , , 'mail@…', , FROM_UNIXTIME(-1), 729, 'O:14:\"iilbasicheader\":25:{s:2:\"id\";s:1:\"5\";s:3:\"uid\";s:3:\"154\";s:7:\"subject\";s:0:\"\";s:4:\"from\";N;s:2:\"to\";s:21:\"mail@heathhosting.com\";s:2:\"cc\";s:0:\"\";s:7:\"replyto\";s:0:\"\";s:11:\"in_reply_to\";s:0:\"\";s:4:\"date\";N;s:9:\"messageID\";N;s:4:\"size\";s:3:\"729\
Just for reference, when i pull the email list up in horde it says "invalid email"
Regards,
Chris H
Change History (5)
comment:1 Changed 6 years ago by till
comment:2 Changed 6 years ago by till
- Milestone set to 0.1-rc2
- Owner set to till
- Status changed from new to assigned
comment:3 Changed 6 years ago by jpingle
Instead of just using null/empty fields, would it be better to insert a dummy value such as "(none provided)", "(empty)"? Alternately, they could be stored in the DB as null/empty, but never displayed to the user as such.
This would be in line with what happens when a normal mail client sends a message sans-subject, it usually sticks in "(no subject)"
comment:4 Changed 6 years ago by oleole
I believe its best to make the database as flexible as possible, in order to avoid similar problems from broken emails.
Since most spam emails are automatically generated via some sort of script that tries to obfuscate the email as much as possible, it sometimes results in a very broken email that doesn't follow the RFC spec. These emails are very common unfortunately.
I believe the database columns should remain empty and instead allow RoundCube to display a translatable string of text to the user ("empty", "no subject", etc). That way its easy to change the values and easy to translate them or even make them empty in some cases were we don't want a strong to be displayed.
comment:5 Changed 6 years ago by thomasb
- Resolution set to worksforme
- Status changed from assigned to closed
Should work since we're casting all values to strings (in rcube_imap) and theses should be quoted correctly by PEAR::DB/MDB2. Cannot reproduce this neither with the DB nor with the MDB2 package.

I am thinking...
a) we need to fix the index
b) allow null values for some columns