IMAP x Gmail => labels?
Asked Answered
H

6

10

Any experiences on a way to get gmail labels (or even filters ?) from an imap connection ? Can't find a clue... thx for any infos about it.

Henbane answered 13/12, 2009 at 20:24 Comment(0)
P
3

I have created a IMAP proxy (Net::Gmail::IMAP::Label) that filters the connection and adds the Gmail labels to the mail headers under X-Label. If your client can display that field next to the subject, it will look similar to the Gmail web interface.

Palla answered 22/3, 2013 at 14:43 Comment(0)
I
7

Alternatively, if you are using IMAP programmatically, you can use the gmail imap extensions to access this information:

http://code.google.com/apis/gmail/imap/#x-gm-labels

a010 FETCH 1:4 (X-GM-LABELS)
* 1 FETCH (X-GM-LABELS (\Inbox \Sent Important "Muy Importante"))
* 2 FETCH (X-GM-LABELS (foo))
* 3 FETCH (X-GM-LABELS ())
* 4 FETCH (X-GM-LABELS (\Drafts))
a010 OK FETCH (Success)

Just to add to this, if you are using JavaMail, with 1.5.1, they have some support for these gmail extensions: https://javamail.java.net/nonav/docs/api/com/sun/mail/gimap/package-summary.html

Introrse answered 19/1, 2012 at 19:35 Comment(0)
H
6

Labels can be seen as IMAP folders.

Hemihedral answered 13/12, 2009 at 20:48 Comment(0)
F
4

Yes, you can do this. You need to enable IMAP of course, obviously - you then need to configure labels on a per-label basis to select 'imap' for the ones that you want to export. If you don't, then you'll just get the default ones, like INBOX and All Mail.

Furculum answered 13/12, 2009 at 20:31 Comment(0)
P
3

I have created a IMAP proxy (Net::Gmail::IMAP::Label) that filters the connection and adds the Gmail labels to the mail headers under X-Label. If your client can display that field next to the subject, it will look similar to the Gmail web interface.

Palla answered 22/3, 2013 at 14:43 Comment(0)
G
1

There is definetly no way to get Gmail filter-rules from IMAP. But Gmail has an import/export feature for that.

Labels can be seen as IMAP folders. The latest thunderbird release does that in fact.

Gannes answered 13/12, 2009 at 20:28 Comment(0)
S
0

Gmail labels appear is folders in IMAP. If you can get a list of the folders that a message appears in, you can infer what the labels are.

Stoss answered 13/12, 2009 at 20:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.