Gnus development mailing list
 help / color / mirror / Atom feed
From: Leonidas Tsampros <ltsampros@upnet.gr>
To: ding@gnus.org
Subject: Re: Why can't I see X-GM-LABELS as an extra header when talking to Gmail over IMAP?
Date: Wed, 01 Jan 2014 16:43:55 +0200	[thread overview]
Message-ID: <87eh4r2250.fsf@kepler.lan> (raw)
In-Reply-To: <87li239vze.fsf@gmail.com> (Trevor Murphy's message of "Tue, 08 Oct 2013 19:35:49 -0400")

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







      parent reply	other threads:[~2014-01-01 14:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08 23:35 Trevor Murphy
2013-12-26 17:13 ` Lars Ingebrigtsen
2014-01-01 14:43 ` Leonidas Tsampros [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eh4r2250.fsf@kepler.lan \
    --to=ltsampros@upnet.gr \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).