From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84022 Path: news.gmane.org!not-for-mail From: Leonidas Tsampros Newsgroups: gmane.emacs.gnus.general 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 Message-ID: <87eh4r2250.fsf@kepler.lan> References: <87li239vze.fsf@gmail.com> Reply-To: ltsampros@upnet.gr NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388587515 28056 80.91.229.3 (1 Jan 2014 14:45:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jan 2014 14:45:15 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32274@lists.math.uh.edu Wed Jan 01 15:45:21 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VyN2s-0007XH-Re for ding-account@gmane.org; Wed, 01 Jan 2014 15:45:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1VyN1m-0007bc-IS; Wed, 01 Jan 2014 08:44:10 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1VyN1k-0007bN-91 for ding@lists.math.uh.edu; Wed, 01 Jan 2014 08:44:08 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1VyN1h-0001Cy-Ud for ding@lists.math.uh.edu; Wed, 01 Jan 2014 08:44:07 -0600 Original-Received: from mail-ea0-f173.google.com ([209.85.215.173]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1VyN1g-0007jt-72 for ding@gnus.org; Wed, 01 Jan 2014 15:44:04 +0100 Original-Received: by mail-ea0-f173.google.com with SMTP id o10so5908940eaj.32 for ; Wed, 01 Jan 2014 06:43:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:references:reply-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=ORKo8UgwYFn22z9xjQu3dFdtwI4EMQ+iKe+d/BkAr1E=; b=HeYSUDHpbLqICa2iZMMT6bIKZpiV0sMr483dRVbHGprjQDKkNJXKoE/S2Fu4t9sMOB qqqAgAmdZOz+IX4iCGBizN+S8hwB1QxgpCDelIrzK1Xm8qK/lW6n9s/0t+fmMZu9QInc 3dcBsbGwWZEYw11dWvhqifOpfONnMo24hCRUs9nW7FMS9nQCMJr9ygWFJJTVFyJ2IZIz i8hFcTG6EimSxViiyAWqlDzDQ/NJ694VPmRdAFiVCfkEp3YJ22bWtpXdFOgsYU/DIiGV RRRYD8fDVEtxd+cWI7SDwNam12NBtmjzabu27s8nNyG4uFwvmsjc8izFXXs7bQlNVVr9 F4Kg== X-Received: by 10.14.2.73 with SMTP id 49mr64842010eee.15.1388587438673; Wed, 01 Jan 2014 06:43:58 -0800 (PST) Original-Received: from kepler.lan (adsl-126.109.242.68.tellas.gr. [109.242.68.126]) by mx.google.com with ESMTPSA id o47sm127586187eem.21.2014.01.01.06.43.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 01 Jan 2014 06:43:57 -0800 (PST) In-Reply-To: <87li239vze.fsf@gmail.com> (Trevor Murphy's message of "Tue, 08 Oct 2013 19:35:49 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Spam-Score: -2.9 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84022 Archived-At: Trevor Murphy 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