April,

Your query is clean enough. Only thing I can think of is the is_header field. Is it properly filled? That field is a recent addition. Actually using it in queries requires that you make sure it is set alright. In recent dbmail code it *is* used, but only for new messages. Existing messages in the database have to be updated.

For mysql the shell-script to generate the update queries is:

#!/bin/sh

mysql --skip-column-names -B -e "select dbmail_messageblk_idnr from messageblks 
group by physmessage_id" dbmail |\
awk 'BEGIN { printf("\nupdate dbmail_messageblks set is_header=1 where messageblk_idnr in ("); } { if(NR % 200 == 0) { printf("\nupdate dbmail_messageblks set is_header=1 where messageblk_idnr in ("); i=0; } else { printf("%s,",$1); }}' |\
        sed 's/,$/);/'




April Lorenzen wrote:
I am using postgres. Using pgadmin III, looking at the table "mailboxes" -
I can see the very unique name of a mailbox I just imported 1000 messages
into - and its mailbox_idnr is 37.

My query must be wrong because I get no records returned:

        SELECT messageblk,dbmail_messageblks.physmessage_id
        FROM dbmail_messageblks,dbmail_messages
        where mailbox_idnr=37
        and dbmail_messageblks.physmessage_id=dbmail_messages.message_idnr
        and is_header=1
        LIMIT 100;

There is a certain mailbox_idnr --- "3" - which does give results. Sorry,
I am obviously working in the dark here and not having a clear
understanding of how to retrieve a set of records representing the headers
for a particular folder aka mailbox_idnr.

_______________________________________________
Dbmail mailing list
Dbmail@dbmail.org
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