>>>>> "Michael" == Michael Monnerie <[email protected]> 
>>>>> writes:

Michael> How did you make dbmail run such a query? Looks like via a
Michael> search, but I guess that never worked and would be a bug
Michael> then. So please, how can I reproduce that query?

That block is in mailbox_search() (and the query is essentially the same
in both master and dbmail_2_2) and is for a "text" search.  So, in an
imap session, after SELECTing a folder, something like:

     C->S: 37331 SEARCH TEXT "multipart/encrypted"

should trigger the dbmail-imapd bug.

(I chose multipart/encrypted only to be similar the the search the OP's
client made.)

I tried that in a 'dbmail-imapd -n -v' session and got the same error:

dbmail-imapd[10679]: Debug:[sql] dbpgsql.c,db_query(+273): [SELECT
m.message_idnr, v.headervalue, k.messageblk FROM dbmail_messageblks k
JOIN dbmail_physmessage p ON k.physmessage_id=p.id JOIN dbmail_messages
m ON m.physmessage_id=p.id JOIN dbmail_headervalue v ON
v.physmessage_id=p.id WHERE m.mailbox_idnr=1 AND m.status in (0,1)
HAVING SUBSTRING(v.headervalue,0,255) ILIKE '%''multipart/encrypted''%'
OR k.messageblk ILIKE '%''multipart/encrypted''%']

dbmail-imapd[10679]: Error:[sql] dbpgsql.c,db_query(+281): query failed
[SELECT m.message_idnr, v.headervalue, k.messageblk FROM
dbmail_messageblks k JOIN dbmail_physmessage p ON k.physmessage_id=p.id
JOIN dbmail_messages m ON m.physmessage_id=p.id JOIN dbmail_headervalue
v ON v.physmessage_id=p.id WHERE m.mailbox_idnr=1 AND m.status in (0,1)
HAVING SUBSTRING(v.headervalue,0,255) ILIKE '%''multipart/encrypted''%'
OR k.messageblk ILIKE '%''multipart/encrypted''%'] : [ERROR: operator
does not exist: bytea ~~* unknown

LINE 1: ...ILIKE '%''multipart/encrypted''%' OR k.messageblk ILIKE '%''...
                                                             ^

HINT:  No operator matches the given name and argument type(s).
       You might need to add explicit type casts.
]


I don't know whether it is possible to do full text searches on a BYTEA
w/o retrieving the whole thing; perhaps one of the extensions might add
a function which can do it?

-JimC
-- 
James Cloos <[email protected]>         OpenPGP: 1024D/ED7DAEA6
_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to