General informations
- system/distribution (with version): alpine:3.20 (docker)
- offlineimap version (
offlineimap -V): v8.0.0
- Python version: v3.12.7
Configuration file offlineimaprc (requires code modifications, does not work with current versions)
[...]
[Repository local]
customflag_a = NonJunk
customflag_a_1 = nonjunk
customflag_b = Junk
customflag_b_1 = junk
customflag_b_2 = $Junk
[...]
Steps to reproduce the error
When using the customflag_x feature to sync IMAP flags/keywords, they are currently treated to be case-sensitive. It seems the IMAP specification is not very explicit about this, but I've found various discussions, where the conclusion seems to be, that they should be case-insensitive. And indeed I'm finding on my various accounts common keywords in different variants, in particular NonJunk and Junk. I seems the correct behavior would be to map them to the same flag, so case-independent.
In order to achieve this, I'm using a custom version with a very simple patch, allowing a configuration as shown above, effectively allowing additional keywords for the same char. This is o.c. a bad hack. I see two possible solutions here (none-mutual exclusive):
- If it is indeed correct, that IMAP flags/keywords are case-insensitive, they should be handled accordingly. (E.g. by normalization on the IMAP side, or by case-insensitive comparison.)
- One could allow arbitrary aliases as I did, which has the advantage, that it also covers
Junk vs $Junk, but it does not really preserve the original keyword.
This is also related to #85, which unfortunately is not yet implemented it seems. (I personally use offlineimap to create backups of my IMAP accounts, so syncing the IMAP flags/keywords currently is somewhat futile, since I couldn't restore them anyway, at least not for now.) A fix for this should probably keep in mind, how the custom flag would later be restored on the IMAP side.
General informations
offlineimap -V): v8.0.0Configuration file offlineimaprc (requires code modifications, does not work with current versions)
Steps to reproduce the error
When using the
customflag_xfeature to sync IMAP flags/keywords, they are currently treated to be case-sensitive. It seems the IMAP specification is not very explicit about this, but I've found various discussions, where the conclusion seems to be, that they should be case-insensitive. And indeed I'm finding on my various accounts common keywords in different variants, in particularNonJunkandJunk. I seems the correct behavior would be to map them to the same flag, so case-independent.In order to achieve this, I'm using a custom version with a very simple patch, allowing a configuration as shown above, effectively allowing additional keywords for the same char. This is o.c. a bad hack. I see two possible solutions here (none-mutual exclusive):
Junkvs$Junk, but it does not really preserve the original keyword.This is also related to #85, which unfortunately is not yet implemented it seems. (I personally use offlineimap to create backups of my IMAP accounts, so syncing the IMAP flags/keywords currently is somewhat futile, since I couldn't restore them anyway, at least not for now.) A fix for this should probably keep in mind, how the custom flag would later be restored on the IMAP side.