From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/77872 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Bj=C3=B8rn_Mork?= Newsgroups: gmane.emacs.gnus.general Subject: nnimap downloads full message while splitting Date: Thu, 17 Mar 2011 15:14:02 +0100 Organization: m Message-ID: <877hbxomvp.fsf@nemi.mork.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1300371487 17002 80.91.229.12 (17 Mar 2011 14:18:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Mar 2011 14:18:07 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M26190@lists.math.uh.edu Thu Mar 17 15:18:03 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q0E1U-0006tv-1C for ding-account@gmane.org; Thu, 17 Mar 2011 15:17:56 +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 1Q0E0o-0000Lo-BR; Thu, 17 Mar 2011 09:17:14 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Q0E0m-0000LV-5n for ding@lists.math.uh.edu; Thu, 17 Mar 2011 09:17:12 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Q0E0k-0005Ad-KV for ding@lists.math.uh.edu; Thu, 17 Mar 2011 09:17:12 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Q0E0j-0003sY-TV for ding@gnus.org; Thu, 17 Mar 2011 15:17:09 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q0E0i-0006R6-N4 for ding@gnus.org; Thu, 17 Mar 2011 15:17:08 +0100 Original-Received: from 193.160.199.2 ([193.160.199.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Mar 2011 15:17:08 +0100 Original-Received: from bjorn by 193.160.199.2 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Mar 2011 15:17:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 104 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 193.160.199.2 User-Agent: Gnus/5.110014 (No Gnus v0.14) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:9e4IjFFORvB/tTYQYl86D0FHdOo= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:77872 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit One issue that has annoyed me for quite a while, is the large amount of data nnimap needs to download every time I do 'g'. So I looked at the *imap-log* and found 13:40:29 11913 LIST "" "*" 13:40:31 11914 SELECT "INBOX" 13:40:32 11915 UID FETCH 1:* FLAGS 13:40:34 11916 UID FETCH 254986,255345,260617,261796,278644,278651,278659,278693,279436,279440,279627,280724,280727,280845,280847,280964,289681,290732,291103,292263,292277,294090,294688,295152,295802,295814,295831,295842,295943,296193,296201,296208,296287,296307:296308,296318,296863,296866,296930,296940,297782,298610,298649,298827,299314,299321,299968,299994,300594,300786,301132,302623:302624,302629,302641,302704,302908,303061,303193,303313,303504,303508,304227,304521,305071,305355:305356,305411,305414:305415,305525,306413,306428,306437,306447,306449,306457,306649,306727,307813,308448,308453,308553,308558,308562:308563,309365,310001,310289,310292,311762,311768,311774,311809,311813,311863,311914:311915,311918,311921,311944,311968,311977,311985,311991,312472,312618,312620,312629,312815,31285 0,312957,313150:313151 (UID BODY.PEEK[HEADER] BODY.PEEK[1]) 13:40:57 11917 UID COPY 313150:313151 "INBOX.lister.system" 13:40:59 11918 UID STORE 313150:313151 +FLAGS.SILENT (\Deleted) 13:40:59 11919 UID EXPUNGE 313150:313151 [etc] which doesn't look right at all. One problem is of course the number of old messages which nnimap wants to inspect over and over again. Probably my own fault, since I tend to leave a number of unread messages in my INBOX for later processing. But my main problem with the above is the "BODY.PEEK[1]". For me, this is almost the same as "BODY.PEEK[]" since most of the messages I receive consist of a single body part. Yes, I'm lucky. But that means that every 'g' will download the same set of unread messages over and over again, instead of just fetching the headers. Looking at nnimap.el, I see: (defun nnimap-fetch-inbox (articles) (erase-buffer) (nnimap-wait-for-response (nnimap-send-command "UID FETCH %s %s" (nnimap-article-ranges articles) (format "(UID %s%s)" (format (if (nnimap-ver4-p) "BODY.PEEK[HEADER] BODY.PEEK" "RFC822.PEEK")) (if nnimap-split-download-body-default "[]" "[1]"))) t)) Which doesn't look right at all. Looks like nnimap-split-download-body-default selects between downloading one part or all parts. Ah, I got it. This is due to the attempt to support both nnimap-ver4-p and others. It will actually work for the non nnimap-ver4-p servers. I'm attaching a patch which fixes this for me. Bjørn --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-nnimap.el-nnimap-fetch-inbox-Respect-nnimap-split-do.patch >From 8f956e18f39a6481e52e7c44ea2a9e6c9d52eeb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Thu, 17 Mar 2011 15:04:54 +0100 Subject: [PATCH] * nnimap.el (nnimap-fetch-inbox): Respect nnimap-split-download-body-default --- lisp/nnimap.el | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 11c521f..d44ec2e 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -1767,11 +1767,13 @@ textual parts.") (format "(UID %s%s)" (format (if (nnimap-ver4-p) - "BODY.PEEK[HEADER] BODY.PEEK" + "BODY.PEEK" "RFC822.PEEK")) (if nnimap-split-download-body-default "[]" - "[1]"))) + (if (nnimap-ver4-p) + "[HEADER]" + "[1]")))) t)) (defun nnimap-split-incoming-mail () -- 1.7.2.3 --=-=-=--