Gnus development mailing list
 help / color / mirror / Atom feed
* Why can't I see X-GM-LABELS as an extra header when talking to Gmail over IMAP?
@ 2013-10-08 23:35 Trevor Murphy
  2013-12-26 17:13 ` Lars Ingebrigtsen
  2014-01-01 14:43 ` Leonidas Tsampros
  0 siblings, 2 replies; 3+ messages in thread
From: Trevor Murphy @ 2013-10-08 23:35 UTC (permalink / raw)
  To: ding

I'm trying to ask this question "the smart way", but unfortunately 
I'm out of my depths.   I'm following some instructions that I've 
modified according to my best guesses from the latest Gmail API. 
Links:

http://blog.devnode.pl/blog/2012/03/30/gnus/
https://developers.google.com/gmail/imap_extensions?csw=1#access_to_gmail_labels_x-gm-labels 
Specifically, in my .emacs, I have:  (setq nnmail-extra-headers 
'(To Newsgroups Cc X-GM-LABELS))
(defun tmm:gnus-get-gmail-label (header)
  (gnus-extra-header 'X-GM-LABELS header))
(defalias 'gnus-user-format-function-X 'tmm:gnus-get-gmail-label)
(setq gnus-summary-line-format "%U%R%z %-6,6d: %(%[%-23,23f%]%) 
%-30,30uX %B%s
")
 
The "%-30,30uX" part gives me a nice 30-space wide gap of nothing 
in my summary buffer.  (I have 30 spaces in there just so I can 
see what I'm doing.  I'll make it more reasonable once I get this 
down.)   I would prefer to see ... something reminiscent of the 
Gmail labels I see in the web interface.  End goal is to just pull 
up the first label, but at this point I'd be happy to see all / 
any of them.   I'm baffled why I see nothing.  I used 
`edebug-on-entry' on `nnimail-retrieve-headers' and saw that Gnus 
/ nnimap.el was sending the following command:
 
"UID FETCH 12163:12638 (UID RFC822.SIZE BODYSTRUCTURE 
BODY.PEEK[HEADER.FIELDS (Subject From Date Message-Id References 
In-Reply-To Xref To Newsgroups Cc X-GM-LABELS)])"
 
When I switched to the buffer Gnus was using to negotiate the 
protocol, I noticed that Gmail wasn't returning any X-GM-LABELS 
header in its responses.  All the other headers showed up as 
appropriate.
 
This made me worry that, for whatever reason, Gmail didn't feel 
like supporting its labels extension today.  But when I dug into 
the `nnimap-object' I saw that it had the following capabilities:

("IMAP4REV1" "UNSELECT" "IDLE" "NAMESPACE" "QUOTA" "ID" "XLIST" 
"CHILDREN" "X-GM-EXT-1" "UIDPLUS" "COMPRESS=DEFLATE" "ENABLE" 
"MOVE" "CONDSTORE" "ESEARCH")
 
Which includes "X-GM-EXT-1".

Is there anything else I can do to figure out what's up?  Have 
other folks worked around this issue somehow?  Any pointers would 
be much appreciated.

--
Trevor Murphy
GnuPG Key: 0xCB06EAAF




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why can't I see X-GM-LABELS as an extra header when talking to Gmail over IMAP?
  2013-10-08 23:35 Why can't I see X-GM-LABELS as an extra header when talking to Gmail over IMAP? Trevor Murphy
@ 2013-12-26 17:13 ` Lars Ingebrigtsen
  2014-01-01 14:43 ` Leonidas Tsampros
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2013-12-26 17:13 UTC (permalink / raw)
  To: ding

Trevor Murphy <trevor.m.murphy@gmail.com> writes:

> "UID FETCH 12163:12638 (UID RFC822.SIZE BODYSTRUCTURE
> BODY.PEEK[HEADER.FIELDS (Subject From Date Message-Id References
> In-Reply-To Xref To Newsgroups Cc X-GM-LABELS)])"
>
> When I switched to the buffer Gnus was using to negotiate the
> protocol, I noticed that Gmail wasn't returning any X-GM-LABELS header
> in its responses.  All the other headers showed up as appropriate.

Is it possible that Gmail just doesn't support returning the X-GM-LABELS
header when returning just the headers?  I don't know anything about
that header...

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why can't I see X-GM-LABELS as an extra header when talking to Gmail over IMAP?
  2013-10-08 23:35 Why can't I see X-GM-LABELS as an extra header when talking to Gmail over IMAP? Trevor Murphy
  2013-12-26 17:13 ` Lars Ingebrigtsen
@ 2014-01-01 14:43 ` Leonidas Tsampros
  1 sibling, 0 replies; 3+ messages in thread
From: Leonidas Tsampros @ 2014-01-01 14:43 UTC (permalink / raw)
  To: ding

Trevor Murphy <trevor.m.murphy@gmail.com> writes:
> I'm trying to ask this question "the smart way", but unfortunately I'm
> out of my depths.   I'm following some instructions that I've modified
> according to my best guesses from the latest Gmail API. Links:
>
> http://blog.devnode.pl/blog/2012/03/30/gnus/
> https://developers.google.com/gmail/imap_extensions?csw=1#access_to_gmail_labels_x-gm-labels
> Specifically, in my .emacs, I have:  (setq nnmail-extra-headers '(To
> Newsgroups Cc X-GM-LABELS))
> (defun tmm:gnus-get-gmail-label (header)
>  (gnus-extra-header 'X-GM-LABELS header))
> (defalias 'gnus-user-format-function-X 'tmm:gnus-get-gmail-label)
> (setq gnus-summary-line-format "%U%R%z %-6,6d: %(%[%-23,23f%]%)
> %-30,30uX %B%s
> ")
>
> The "%-30,30uX" part gives me a nice 30-space wide gap of nothing in my
> summary buffer.  (I have 30 spaces in there just so I can see what I'm
> doing.  I'll make it more reasonable once I get this down.)   I would
> prefer to see ... something reminiscent of the Gmail labels I see in the
> web interface.  End goal is to just pull up the first label, but at this
> point I'd be happy to see all / any of them.   I'm baffled why I see
> nothing.  I used `edebug-on-entry' on `nnimail-retrieve-headers' and saw
> that Gnus / nnimap.el was sending the following command:
>
> "UID FETCH 12163:12638 (UID RFC822.SIZE BODYSTRUCTURE
> BODY.PEEK[HEADER.FIELDS (Subject From Date Message-Id References
> In-Reply-To Xref To Newsgroups Cc X-GM-LABELS)])"
>
> When I switched to the buffer Gnus was using to negotiate the protocol,
> I noticed that Gmail wasn't returning any X-GM-LABELS header in its
> responses.  All the other headers showed up as appropriate.
>
> This made me worry that, for whatever reason, Gmail didn't feel like
> supporting its labels extension today.  But when I dug into the
> nnimap-object' I saw that it had the following capabilities:
>
> ("IMAP4REV1" "UNSELECT" "IDLE" "NAMESPACE" "QUOTA" "ID" "XLIST"
> "CHILDREN" "X-GM-EXT-1" "UIDPLUS" "COMPRESS=DEFLATE" "ENABLE" "MOVE"
> "CONDSTORE" "ESEARCH")
>
> Which includes "X-GM-EXT-1".
>
> Is there anything else I can do to figure out what's up?  Have other
> folks worked around this issue somehow?  Any pointers would be much
> appreciated.
>
> --
> Trevor Murphy
> GnuPG Key: 0xCB06EAAF


Hello,

check this link out: https://developers.google.com/gmail/imap_extensions

It seems that you have to issue the command like this:

a010 FETCH 1:4 (X-GM-LABELS)

I sent the following command and it worked:
"UID FETCH 1:1 (UID RFC822.SIZE
X-GM-LABELS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Subject From Date
Message-Id References In-Reply-To Xref To Newsgroups Cc)])"

So it seems that the labels are not part of the email's body which makes
sense since labels are just an extension on the server and do not modify
the original message.

BR//
Leonidas







^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-01 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-08 23:35 Why can't I see X-GM-LABELS as an extra header when talking to Gmail over IMAP? Trevor Murphy
2013-12-26 17:13 ` Lars Ingebrigtsen
2014-01-01 14:43 ` Leonidas Tsampros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).