[tpm] downloading 'filtered' gmail via imap

Fulko Hew fulko.hew at gmail.com
Wed Jan 23 07:27:39 PST 2013


I developed a simple utility that allows me to download
some of my gmail into seperate files on my filesystem
using Net::IMAP::Simple.  I can select the 'mailbox'
and download everything in it.

The trouble is that when you $imap_sess->select($mailbox);
in Gmail 'mailbox' ==' 'tag', so it actually selects all
messages with that 'tag' instead.  But deleted messages
are not really 'moved' to another mailbox, or are marked
(in IMAP terms) as 'deleted', they simply receive another
tag called 'Trash'.
 if your messages have a tag on them, AND
you delete them; they will also receive the tag 'Trash'.

So when I select the mailbox (aka. tag) 'mybox',
I will get all those messages, but all the 'deleted' ones
(with the additional 'Trash' tag, also get selected
because they have both tags: 'mybox' AND 'Trash'.

Can anyone suggest a simple mechanism for 'mybox' and not 'Trash'?

(I tried getting the UIDs, and performing a exclusionary
masking process between the two sets, but the unique IDs
I was seeing didn't seem overly unique.)

TIA
Fulko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20130123/c0f1e70b/attachment.html>


More information about the toronto-pm mailing list