Gnus development mailing list
 help / color / mirror / Atom feed
From: Leonidas Tsampros <ltsampros@upnet.gr>
To: ding@gnus.org
Subject: gmail and X-GM-EXT1 extensions
Date: Sat, 20 Apr 2013 12:35:01 +0300	[thread overview]
Message-ID: <874nf1k0je.fsf@kepler.lan> (raw)

Hello,

long time no see :)

TLDR: My Gmail inbox is full even after splitting mail. Here is why.

Due to some not so recent events, I eventually had to move 95% of my
email setup to gmail.

My current setup is that all email arrives at gmail in a specific folder
and with the help of nnimap-inbox, I fancy-split all the mails that
arrive there. The series of commands that I see in my *imap log* buffer
is the following:

12206 LIST "" "*"
12207 SELECT "ltsampros@upnet.gr"
12208 UID FETCH 1:* FLAGS
12209 UID FETCH 30246:30254,30256:30259 (UID BODY.PEEK[HEADER])
12210 UID COPY 30247,30250:30251,30253,30256,30258 "mail.gnu.emacs.devel"
12211 UID COPY 30246,30248:30249,30252,30254,30257,30259 "mail.gnu.emacs.orgmode"
12212 UID STORE 30246:30254,30256:30259 +FLAGS.SILENT (\Deleted)
12213 UID EXPUNGE 30246:30254,30256:30259

which is working.

However, we all know that Gmail IMAP is a weird monster. My problem is
that all these messages are appearing in the "Inbox" folder on Gmail's
interface ,even after the COPY and EXPUNGE, which means now that my
inbox is filled with very very very many emails and that *irritates* me.

So, I started digging by selecting a random mailbox created by
nnimap-split-incoming:

UID SELECT mail.gnu.emacs.devel
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen gnus-save gnus-forward $has_cal)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen gnus-save gnus-forward $has_cal \*)] Flags permitted.
* OK [UIDVALIDITY 129] UIDs valid.
* 3032 EXISTS
* 0 RECENT
* OK [UIDNEXT 11812] Predicted next UID.
UID OK [READ-WRITE] mail.gnu.emacs.devel selected. (Success)

I think this is pretty much normal. But let's fetch flags of the last
email in this folder:

UID FETCH 3032 FLAGS
* 3032 FETCH (FLAGS ())

Again it does seem normal, however this mail in Gmail's web interface is
STILL listed with the following labels "Inbox" and
"mail.gnu.emacs.devel".

After an enlightening moment of google-funess, I arrived at this URL:

https://developers.google.com/google-apps/gmail/imap_extensions?hl=el#access_to_gmail_labels_x-gm-labels

Which pretty much explains the situation:

UID FETCH 3032 (FLAGS X-GM-LABELS)
* 3032 FETCH (X-GM-LABELS ("\\Inbox") FLAGS ())

Again, gmail confuses me a bit since I would expect this email to have two
labels ("\\inbox" and "mail.gnu.emacs.devel") since these two are
displayed on the web interface but let's accept that the gmail interface
interprets the folder created by nnimap-split-incomings COPY as a
label.

So, how do we remove this fraking \\Inbox X-GM-LABEL which messes up and
clatters our web interface?

Simple:

UID STORE 3032 -X-GM-LABELS ("\\Inbox")
* 3032 FETCH (X-GM-LABELS ())
UID OK Success

And now the million dollar question:

Is there an easy way to run this command before the expunge during
nnimap-split-incoming?

Best Regards,
Leonidas Tsampros



             reply	other threads:[~2013-04-20  9:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-20  9:35 Leonidas Tsampros [this message]
2013-04-21 23:06 ` [PATCH] " Leonidas Tsampros
2013-06-06 15:09   ` Ted Zlatanov
2013-06-09 18:53     ` Leonidas Tsampros
2013-06-10  3:30       ` Ted Zlatanov
2013-06-10  5:46         ` Leonidas Tsampros
2013-06-10  6:28           ` Ted Zlatanov
2013-07-18  4:11             ` Leonidas Tsampros
2013-08-01 15:27               ` Lars Magne Ingebrigtsen
2013-08-01 16:22                 ` Leonidas Tsampros
2013-08-01 16:35                   ` Lars Magne Ingebrigtsen

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=874nf1k0je.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).