Hi, I think I found out what's happening. I’ve made several further tests, and got to the point that the following lines with the commented line and without make difference:
|. select INBOX.Trash . select INBOX . uid search undeleted . uid copy 2418 "INBOX.Somefolder" #. select INBOX . uid store 2418 +FLAGS (\Deleted) . close |If you re-select mailbox between copying and setting deleted flag, then courier-imap will move message to Trash on expunge/close. If you do not have such a break between copy and store, then close/expunge won’t move it to Trash. Maybe it’s that courier-imap knows that this is the solution on IMAP for moving and ignores moving to Trash even if it’s IMAP_MOVE_EXPUNGE_TO_TRASH option is set (but just if it detects copy and store right after each other). I'm just guessing. After I ensured about this I checked the application, and it seems to accomplish moving in the way of putting copy and store right after each other, and indeed it does not produce messages landing in Trash. The thing is that what I noticed at first that messages are moving to Trash was about saving Drafts (I change message contents, then append message to Drafts again, set deleted flag for old one and finally close). But this is not copy any move, so maybe here we do not have an exception (as for move) from the expunge moves to Trash rule. So my question is, would there be any exception from "deleted flagged messages going to Trash on close" rule if we speak about changing draft contents and appending it again to Drafts folder. Is there any way to make old draft messages (message versions in fact) not to go to Trash (if I wouldn't like to change server settings)? In fact even Thunderbird makes old draft versions land in Trash with these server settings, so maybe I should not have much hope... Gergely Fábián Gergely írta: > Hi, > > I'm trying to develop an application that moves messages from one folder > to another. > It tries to achieve this with these commands: > > . UID COPY 2496 "INBOX.Somefolder" > . OK [COPYUID 1229336836 2496 16] COPY completed. > . UID STORE 2496 +Flags (\Deleted) > * 22 FETCH (UID 2496 FLAGS (\Answered \Seen \Deleted)) > . OK STORE completed. > . HKC49d249368532f CLOSE > . OK mailbox closed. > > The problem I have is this: closing/expunging the folder sometimes > makes those messages that were just marked as deleted > to appear in Trash (as recent), other time it does not. > I investigated how Thunderbird does it (catching tcp packages) > and it seemed to be the same (but for Thunderbird messages never > appear in Trash after closing the mailbox). > I tried several times today earlier and then each time the originals > (marked deleted) > landed for close in Trash. > I asked our sysadmins and they said IMAP_MOVE_EXPUNGE_TO_TRASH is set to 1. > But then why it's not happening for Thunderbird? > Later on I tried once more, and it was not happening any more... > I copy below two IMAP sessions where in the first closing the mailbox is > resulting > in deleted message showing up in Trash, in the other not any more (and > then I was again > unable to reproduce it). Between there were some other actions that I > was trying. > Maybe those caused the messages not going any more to Trash? > Maybe I made something really silly, but if IMAP_MOVE_EXPUNGE_TO_TRASH > is enabled > then why I'm able to make such test cases where they are not going to Trash? > Did I switch on something that disables this for a session or a given > amount of time?? > I don't know much about IMAP, so I'd appreciate any clarification. > As far as I remember I had switched on Thunderbird just where there are > such comments > in the log below. > > Thank you so much, > > Gergely Fabian > P.S. Just remembered: I was trying also on Friday with pure telnet then > deleted flagged messages were not getting to Trash. > On Monday they were getting to Trash... Today first they were then again > not... No idea what's going on. > > ------------------------------------------------------------------------------ _______________________________________________ Courier-imap mailing list [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap
