I'm seeing some errors logged (seems to be related to an ActiveSync
client accessing via SOGo with Archiveopteryx as the IMAP backend) :

2014-07-03 07:45:44 PDT ERROR:  table name "m" specified more than once
2014-07-03 07:45:44 PDT STATEMENT:  select mm.uid, m.idate, mm.modseq,
mm.message from mailbox_messages mm join messages m on (mm.message=m.id)
join messages m on (m.id=mm.message) where mm.mailbox=$1 and not
mm.deleted and m.idate>=$2 order by m.idate desc, mm.uid

Now, digging through the code, I got to imap/handlers/sort.cpp which
seems to be responsible for the re-use and the error.

I made a small change and rebuilt and that seemed to resolve the issue
(it was logged frequently before and stopped right away after putting
this change live) :

diff -wu aox-master/imap/handlers/sort.cpp jim/imap/handlers/sort.cpp
--- aox-master/imap/handlers/sort.cpp   2014-06-03 13:15:21.000000000 +0000
+++ jim/imap/handlers/sort.cpp  2014-07-03 14:58:50.756613000 +0000
@@ -210,8 +210,8 @@
 {
     switch ( c->t ) {
     case Arrival:
-        addJoin( t, "join messages m on (m.id=mm.message) ",
-                 "m.idate", c->reverse );
+        addJoin( t, "join messages mardt on (mardt.id=mm.message) ",
+                 "mardt.idate", c->reverse );
         break;
     case Cc:
         addJoin( t,


It looks like there was something similar done in server/selector.cpp
around line 1846 in the latest Git files - this looked like another
possible place this could happen so I presume someone
spotted/experienced the problem and did a fix.

I've also switched to the current Git release because I see lots of errors :

Jul  3 16:17:18 messaging Archiveopteryx: 29924/2/13 Unknown command.
Line: "22 getannotation \"*\" \"/comment\" \"value.priv\""
Jul  3 16:17:18 messaging Archiveopteryx: 29924/2/13 Unknown command.
Line: "23 setannotation \"INBOX\" \"/comment\" (\"value.priv\"
\"messaging__net_75a3_1965aee5_58\")"
Jul  3 16:17:31 messaging Archiveopteryx: 29924/2/13 Unknown command.
Line: "25 setannotation \"Trash\" \"/comment\" (\"value.priv\"
\"messaging__net_75a3_1965aee5_59\")"
Jul  3 16:17:46 messaging Archiveopteryx: 29924/2/13 Unknown command.
Line: "27 setannotation \"Sent\" \"/comment\" (\"value.priv\"
\"messaging__net_75a3_1965aee5_5a\")"
Jul  3 16:18:02 messaging Archiveopteryx: 29924/2/13 Unknown command.
Line: "29 setannotation \"Drafts\" \"/comment\" (\"value.priv\"
\"messaging__net_75a3_1965aee5_5b\")"

being logged.  Any ideas or suggestions are welcome ?

Thanks
Jim

Reply via email to