dbmail-2.1 supports searching specific headers.

for 2.0 searching headers *is* implemented in imap, but not naturally supported
by the database schema. You *can* also query the messageblks table directly
using """where header=1""" but both the imap and query methods are expensive
<understatement>.

in dbmail-2.1 this header information has been properly normalized and
search/sort is very cheap, even on very large mailboxes:

select id from dbmail_physmessage p
        left join dbmail_subjectfield s using p.id=s.physmessage_id
        where s.subjectfield like '%12345%';

or restricted to a mailbox:

select p.id from dbmail_physmessage p
        left join dbmail_messages m on m.physmessage_id=p.id
        left join dbmail_mailboxes b on m.mailbox_idnr=b.mailbox_idnr
        left join dbmail_subjectfield s on p.id=s.physmessage_id
where s.subjectfield like '%12345%'
        and b.mailbox_idnr=1;

Roe wrote:
> Hello,
> 
> I need some help. I am trying to do a mysql query that would return
> emails with a specific subject. i.e. the email subject has order number
> "12345" in it. Any help would be appreciated thanks.
> 
> Roe
> _______________________________________________
> Dbmail mailing list
> [email protected]
> https://mailman.fastxs.nl/mailman/listinfo/dbmail
> 


-- 
  ________________________________________________________________
  Paul Stevens                                  mailto:[EMAIL PROTECTED]
  NET FACILITIES GROUP                     PGP: finger [EMAIL PROTECTED]
  The Netherlands________________________________http://www.nfg.nl

Reply via email to