Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IMAP x Gmail => labels?

Tags:

label

gmail

imap

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.

like image 243
Ben Avatar asked Dec 13 '09 20:12

Ben


2 Answers

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

like image 84
GreenKiwi Avatar answered Oct 20 '22 16:10

GreenKiwi


Labels can be seen as IMAP folders.

like image 40
oleg Avatar answered Oct 20 '22 18:10

oleg