[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [imapsync] The --regexflag to keep only flags from a known list of flags


From Gilles LAMIRAL <gilles dot lamiral at laposte dot net>
Subject Re: [imapsync] The --regexflag to keep only flags from a known list of flags
Date Tue, 09 Feb 2010 20:11:30 +0100

Hello Phil,

Wouldn't something like the following regex also accomplish what you
want in a single pass?

Yes!


(Note, I added Recent as I would expect Exchange
to also be OK with this).

Recent must not be set by any client (RFC). So imapsync remove it.

--regexflag 's/.*?(?:(\\(?:Answered|Flagged|Deleted|Seen|Recent|Draft)\s?)|$)/$1/g'

Analysis is left to the reader.

Let me know if I missed something I didn't spend too much time on analysis!

The regex is good in all cases I tried but it produces warnings like:


"Use of uninitialized value $1 in substitution iterator at (eval 94) line 1"

One warning per word not in the flag list. I couldn't avoid the warning
with "no warnings", maybe the eval inhibits this.

--
Au revoir,                               02 99 64 31 77
Gilles Lamiral. France, Chavagne (35310) 06 20 79 76 06