Hi,
managed to get roundcube working with postgres from the first cvs snapshot last year (took some minor tweaks), noticed a new snapshot so thought I'd check it out again.
I cleaned out all tables/sequences from my old database.
There is one typo in the postgres_initial.sql file on the messages table the session_id should refer to foreign key "sess_id" in the sessions table, not to "session_id" which doesn't exist.
With that done, and changes made to config/db.inc.php and config/main.inc.php
I can log in to roundcube ok, but when rcube_imap.inc is populating the messages table I get lots of errors like
DB Error: unknown error Query: INSERT INTO messages (user_id, del, cache_key, created, idx, uid, subject, "from", "to", cc, date, size, headers) VALUES ('1', 0, 'INBOX.msg', now(), '787', '33125', '[LinuxFailSafe] Re: LinuxFailSafe Digest, Vol 3, Issue 1', 'David Brower ', 'linuxfailsafe@lists.community.tummy.com', FALSE, '2006-02-10 19:48:40', 5381, 'O:14:"iilbasicheader":25:{s:2:"id";s:3:"787";s:3:"uid";s:5:"33125";s:7:"subject";s:56:"[LinuxFailSafe] Re: LinuxFailSafe Digest, Vol 3, Issue 1";s:4:"from";s:38:"Da
I've looked at where this query is built up, is it possible that the substr($this->decode_header((string)$headers->cc, TRUE), 0, 128) is returning "FALSE" instead of an empty string when cc: from header is blank? see the FALSE between the "tummy.com" and the date?
I also tried usign MDB2 instead of DB2 but got errors about prepare() function not existing, I tried to revert it to just use execute() instead of prepare+execute but didn't help.
I know this is still pre-beta, but I thought postgres support was supposed to actually work now?
Andy Burns wrote:
is it possible that the substr($this->decode_header((string)$headers->cc, TRUE), 0, 128) is returning "FALSE" instead of an empty string when cc: from header is blank? see the FALSE between the "tummy.com" and the date?
As a work-around I commented out the substr($this->decode_header((string)$headers->cc, TRUE), 0, 128) and replaced it with "" and that allowed roundcube to work without any errors, I expect it'll get confused on messages I receive as cc: though!
Andy Burns wrote:
Hi,
managed to get roundcube working with postgres from the first cvs snapshot last year (took some minor tweaks), noticed a new snapshot so thought I'd check it out again.
I cleaned out all tables/sequences from my old database.
There is one typo in the postgres_initial.sql file on the messages table the session_id should refer to foreign key "sess_id" in the sessions table, not to "session_id" which doesn't exist.
With that done, and changes made to config/db.inc.php and config/main.inc.php
I can log in to roundcube ok, but when rcube_imap.inc is populating the messages table I get lots of errors like
DB Error: unknown error Query: INSERT INTO messages (user_id, del, cache_key, created, idx, uid, subject, "from", "to", cc, date, size, headers) VALUES ('1', 0, 'INBOX.msg', now(), '787', '33125', '[LinuxFailSafe] Re: LinuxFailSafe Digest, Vol 3, Issue 1', 'David Brower ', 'linuxfailsafe@lists.community.tummy.com', FALSE, '2006-02-10 19:48:40', 5381, 'O:14:"iilbasicheader":25:{s:2:"id";s:3:"787";s:3:"uid";s:5:"33125";s:7:"subject";s:56:"[LinuxFailSafe] Re: LinuxFailSafe Digest, Vol 3, Issue 1";s:4:"from";s:38:"Da
According to the PHP manual, substr() should always return a string. However, I changed the code and added a casting for the return value of $this->decode_header(). This should now fix this problem.
I've looked at where this query is built up, is it possible that the substr($this->decode_header((string)$headers->cc, TRUE), 0, 128) is returning "FALSE" instead of an empty string when cc: from header is blank? see the FALSE between the "tummy.com" and the date?
I also tried usign MDB2 instead of DB2 but got errors about prepare() function not existing, I tried to revert it to just use execute() instead of prepare+execute but didn't help.
MDB2 support is currently broken. There have been some changes to the rcube_db class which haven't been applied to the rcube_mdb2 class.
I know this is still pre-beta, but I thought postgres support was supposed to actually work now?
I is but I'm not very familiar with Postgres but tested it successfully on my machine. Suggestions to for Postgres support are always welcome!
Regards, Thomas
Thomas Bruederli wrote:
According to the PHP manual, substr() should always return a string. However, I changed the code and added a casting for the return value of $this->decode_header(). This should now fix this problem.
Hi, apologies for my first post to this list being a correction but that is not quite right (and further apologies to Thomas who got this as a personal reply before I realised I was using a new mail client and hadn't replied to list).
If the string is empty then substr() will always return FALSE, may I suggest the following as a nicer option?
$foo = empty($headers->cc) ? "" : substr($this->decode_header((string)$headers->cc, TRUE), 0, 128);
It eliminates the relatively expensive substr() when there is no CC header (the majority of email (well mine at least)) at the expense of a cheap empty() call for every message. As I don't have the CVS version installed yet I can't test it nor do I know where this fits in your code so apologies if I turn out to be talking utter crap.
Congratulations on an excellent project, I know nothing about Javascript so am sat in awe of the beautiful interface.
Regards,
Gareth Davies