> > Larry Low wrote: > > > > > My mistake. Now I know something is wrong. I misunderstood what > > > UNSEEN meant when you select a mailbox. This was the output of the > > > SELECT indicating 36 is the first unseen message. The SEARCH > returns > > > no 36 and I am fairly sure there were no messages marked as deleted > > > with a status of 0 in the database. > > > > > > /fairly/ sure? Why not do a > > > > x fetch 1:* (flags) > > > > and /be/ sure. > > > > It's perfectly valid for message 36 to be unseen *and* deleted. > > The status field in the messages table is not really relevant here. > > That > > field is never updated by the imap code - only by the pop3 and > > maintenance code. > > Whether a message is returned by 'search not seen' is only determined > > by > > the seen_flag field. > > I think I narrowed the 36:50 messages down to two users being logged > in. I had to dig back further on my captures to find the IMAP session > of the other user. > > This does not explain the STORE failing on 73:87 as these messages were > not marked as deleted by the other session. I had a debug level 4 on > during this time and the STOREs that failed outputted.. > > dbmail/imap4d[21007]: Info:[imap] imap4.c,IMAPClientHandler(+187): > COMMAND: [A200 STORE 87 -FLAGS (\Seen)] > dbmail/imap4d[21007]: Info:[imap] imap4.c,IMAPClientHandler(+298): > Executing command store... > dbmail/imap4d[21007]: Info:[imap] imap4.c,IMAPClientHandler(+317): > Finished command store [1] > > I have been working on data I couldn't openly reproduce so I apologize > for not being able to confirm certain things.
I see the problem now. The messages got expunged after the SELECT and SEARCH so the indexes of the messages changed so message 87 became message 72 within the same session causing the stores to be performed on the wrong messages. Below is IMAP conversation showing the actions are performed in the same session and without closing the inbox till the end. A3 LIST "" INBOX * LIST (\hasnochildren) "/" "INBOX" A3 OK LIST completed A4 SELECT INBOX * 87 EXISTS * 1 RECENT * FLAGS (\Seen \Answered \Deleted \Flagged \Draft) * OK [PERMANENTFLAGS (\Seen \Answered \Deleted \Flagged \Draft)] * OK [UIDNEXT 604193] Predicted next UID * OK [UIDVALIDITY 11957] UID value * OK [UNSEEN 36] first unseen message A4 OK [READ-WRITE] SELECT completed A5 SEARCH UNDELETED ALL * SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 A5 OK SEARCH completed A6 FETCH 1:35,51:87 (ENVELOPE INTERNALDATE RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS (Importance Sensitivity)]) ... fetch output ... some more fetches ... store +/- FLAGS performed on message 51-72 without problems A171 STORE 73 -FLAGS (\Deleted) A171 BAD invalid message range specified A172 STORE 73 -FLAGS (\Seen) A172 BAD invalid message range specified ... same store fails on 74-87 ... store +/- FLAGS performed on message 1-35 A271 CLOSE A271 OK CLOSE completed A272 NOOP A272 OK NOOP completed A273 LOGOUT * BYE dbmail imap server kisses you goodbye A273 OK completed A274 LOGOUT > > > > > > > > > A4 SELECT INBOX > > > * 87 EXISTS > > > * 1 RECENT > > > * FLAGS (\Seen \Answered \Deleted \Flagged \Draft) > > > * OK [PERMANENTFLAGS (\Seen \Answered \Deleted \Flagged \Draft)] > > > * OK [UIDNEXT 604193] Predicted next UID > > > * OK [UIDVALIDITY 11957] UID value > > > * OK [UNSEEN 36] first unseen message > > > A4 OK [READ-WRITE] SELECT completed > > > A5 SEARCH UNDELETED ALL > > > * SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 > 23 > > > 24 25 26 27 28 29 30 31 32 33 34 35 51 52 53 54 55 56 57 58 59 60 > 61 > > > 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 > 84 > > > 85 86 87 > > > > What are you trying to achieve here? > > > > > > -- > > ________________________________________________________________ > > Paul Stevens paul at nfg.nl > > NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31 > > The Netherlands________________________________http://www.nfg.nl > > _______________________________________________ > > DBmail mailing list > > [email protected] > > https://mailman.fastxs.nl/mailman/listinfo/dbmail _______________________________________________ DBmail mailing list [email protected] https://mailman.fastxs.nl/mailman/listinfo/dbmail
