Spaces in foldernames for the -f cli flag

Sebastian Spaeth Sebastian at
Tue Apr 5 10:27:04 BST 2011

On Mon, 4 Apr 2011 22:59:49 -0600, Will Styler <william.styler at> wrote:
> I cannot get the other two ("Deleted Messages" and "Sent Message") to
> sync with this command, no matter how I escape them.  I've tried quotes,
> brackets and slashes, backslashes, plain... I'm at the end of my rope.  

no wonder, see below:
> So, any suggestions on how I can ask offlineimap to check these other
> folders alongside INBOX from the CLI?

> /opt/local/bin/offlineimap -o -u Noninteractive.Quiet -f INBOX,[Deleted\
> Messages],[Sent\ Messages] >/dev/null

Mmmh, specifying folders on the command line seems to strip away *all*
spaces (which does not make sense in my opinion). This logic has never
been changed so far, so it always behaved like that.
            foldernames = options.folders.replace(" ", "").split(",")

Wouldn't it make more sense, to strip just spaces around the commas of a
list? Such as:

-            foldernames = map(strip, options.folders.split(","))
+            map(lambda s: s.strip(), options.folders.split(","))

? I think that change would make sense, but should be documented in the

The other option (which should currently work without code change), is to override the
config option in the form:

-k "Repository_LocalFOO:folderfilter= lambda f: f in ['INBOX','[Deleted Messages]','[Sent Messages]']"

Does that work?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the OfflineIMAP-project mailing list