[Users] IMAP folders subscriptions with Gmail account

Jean Ackle jdalinux at yahoo.com.br
Wed Oct 30 15:37:35 CET 2013

This dates a good while back but then again... it was my question...

I haven't actually found the definitive sollution to this (I think there is none as Google Mail and IMAP folders are not direct matches, namelly regarding Gmail Labels beingĀ  "translated" to IMAP folders).

Still, if there seemingly is no way to avoid downloading several e-mail messages from Gmail to an IMAP account in Claws, I did  however find an easy way to get rid of the multiple copies stored in my harddisk. With limitations.
The sollution is: Hardlinks.

I did some testing with the following two setups:
- DEFT 8 Linux 64bit (my two other distros crashed, or more preciselly, I crashed them... I'm keeping my wild guesses off this DEFT 8 setup... Not to the point really.).
-- With Linux kernel 3.5 (mentioned for the sake of filesystems handling quirks I might not be aware of);
-- With Python 2.7.3 (you'll understand why I mention it later in this message).
- Windows XP Pro SP3 32bit
-- With Python 2.7.5 (latest stable on the 2.x series), both with and without pywin32 by Mark Hammond;
-- With Python 3.3.2 (latest stable), both with and without pywin32.

The limited testing I did shows:
- I can create perfectly working hardlinks from DEFT8 in both ext4 and NTFS partitions using the standard 'ln' command. The inode numbers revealed by 'ls -i' will match.
- Those unix-like hardlinks will work seemingly flawlessly when dealing with them in Windows XP. They will indeed display the count of hardlinks shown by the FlexHex program mentioned and downloadable from the article on http://www.flexhex.com/docs/articles/hard-links.phtml#hardlinks (2nd paragraph).
- Hardlinks created in the NTFS, when removed, either in Linux or Windows, will both remove only that one link, leaving the other links and their contents untouched.
- Running 'chkdsk' on Windows shows no filesystem corruption.

I also found a very nice utility: hardlink.py ( http://code.google.com/p/hardlinkpy/ ), which searches a directory for copies of the same file and turns them into hardlinks Perfect for my purpose!
Although... It does work fine when run from Linux, with the same results mentioned above on either ext4 or NTFS alike. But when run from Windows XP, it fails to detect the copies and instead states them as having been already linked before (not true). This happens with all four combinations of Python and the pywin32 I detailed above for my Windows XP.

The "NTFS Hard Links, Directory Junctions, and Windows Shortcuts" article mentioned above (the one from where you can also get the FlexHex utility) lets you download another utility that creates hardlinks in Windows XP and onwards (although Windows 7 includes 'mklink', which does the same). These work just as well as the Linux 'ln' command.
Thus, the problem with hardlink.py not doing its job properly when run on Windows might be fixable/worked-around.

If the problem of hardlink.py not working from Windows XP could be solved, then I could have a go at trying to implement a Claws-Mail Python action (with hardlink.py included in the code or called by it) that I could run from either the Linux or Windows versions of Claws-Mail to keep my locally stored Gmail account free of multiple copies of the same contents at any time.
Also... I know basically nothing of Python and I am not a programmer, but with time...

If anyone has any insights into this or any alternatives they might suggest, they'll be most welcome.

Jean-D. Ackle

> On Tuesday, July 2, 2013 11:52 AM, Jean-D. Ackle <jdalinux at yahoo.com.br> wrote:
> > Hello everyone,
> I have a Gmail account setup on Claws Mail.
> I have the INBOX folder subscribed to and several IMAP Folders (= Gmail labels) 
> too.
> Claws has been downloading all mail for hours now (intended) but, so to speak, 
> in duplicates, triplicates or more...
> In short, in case it's not clear yet:
> ++ I have messages in the INBOX only which I want downloaded for offline use.
> ++ I have messages in INBOX and some other folder(s) / label(s) which I also 
> want availabe for offline use.
> Is
> there a way to set Claws up so that the messages don't get downloaded 
> two or more times (and don't occupy the corresponding multiple copies' 
> disk space either) while still having them all available for offline 
> use?
> Thanks in advance
> _______________________________________________
> Users mailing list
> Users at lists.claws-mail.org
> http://lists.claws-mail.org/cgi-bin/mailman/listinfo/users

More information about the Users mailing list