Mark Crispin wrote:

On Sun, 26 Oct 2003, Lars Hallberg wrote:


Do this mean I have to remove the X-UID header when moving mail between
mailfolders?



If you use the c-client library to move messages (e.g. mail_copy()) all of
these details are taken care of for you. Why aren't you doing this?



Becose I'm sorting mail with procmail / foremail.


No, you should not copy X-UID headers.



OK


What bad things will happen otherwise?



Either you will write useless junk headers, or you will screw up the UID
regime and cause c-client to purge it and recreate a completely new UID
regime, causing your POP3 users to complain bitterly that all these
messages got downloaded again.



This means fireing upp mutt over the mailbox directly and move mail is harmfull to? So basicly - everyone complaining about seeing the pseudo message is potentialy doing something bad?


But I don't need to care about POP, this is imap over ssl exlusivly. How harmfull is recreated UID:s for IMAP (if I shuld remove them all)?

Is it better or worse that *all* X-UID headers are removed (also for
mail that return to the original folder)?



You can't return messages. All you can do is add new messages.



I move the folder, and filter the mailes, some goes back to the old folder but any new delivery during the formail - procmail run vill come in between. This is bad if I understan You corectly. I belive I can fix it!


Right now, mail is moved to other folders with the X-UID header, and
while resorting - new mail without any X-UID header can be inserted
betwin messages with X-UID header. Scary stuff...



You can't resort messages in the mailbox or insert messages in the middle
with c-client managed mailboxes. This is a permanent restriction since it
is required behavior in IMAP.



OK, so I shuld make sure that:


* Mail that stays in the same folder keep ther UID and order.

* That every new mail end up last (or that the mailfolder is locked during the processing).

* That mail that move to other folders have ther X-UID removed.

* Anything more?

somthing like this

.lock mbox
mv mbox mbox.old
sort mbox.old > mbox.new (with formail & procmail, removing every X-UID on mail not going to mbox.new,
and that pseudo message and X-UID is preserved in mbox.new)
mv mbox.new mbox
rm mbox.old
release .lock


One of the points of this whole sorting is to keep mbox small - so this lock vill be reasnoble short!

For other folders this is harder, but in this specific case I can prety safely asume that they will not get any new mail during the sort. After all, ther is no point in moving mail manually to folders that is automaticly sorted. If I move mail manually it will be to folders that is not automaticly sorted - or to mbox to be automaticly sorted to the right place. I just have to make sure the sorting of mbox don't happens while another sort is going on. Can do that!

But it realy looks like I'm using the wrong tools :-) Still, I belewe I will get away with it!

Thanks for Your reply!

/LaH


Reply via email to