Gnus development mailing list
 help / color / mirror / Atom feed
From: Jouni K Seppanen <jks@iki.fi>
Subject: Re: downloading attachments on demand
Date: Tue, 11 Apr 2006 23:26:57 +0300	[thread overview]
Message-ID: <29acarvoxa.fsf@james.hut.fi> (raw)
In-Reply-To: <almzesm8eg.fsf@quant8.janestcapital.quant>

Sam Steingold <sds@podval.org> writes:

>> * Lars Magne Ingebrigtsen <ynefv@tahf.bet> [2006-04-11 08:13:26 +0200]:
>> Sam Steingold <sds@podval.org> writes:
>>> Is there a way to open a message without downloading all the attachments?
>>
>> If it's a multipart/mixed message, for instance, then there's
>> probably no way to query the storage back ends for just the textual
>> bits.  At least nntp or pop doesn't support anything like that...
>
> All I care about is IMAP (and it appears that Evolution and Mozilla can
> download just the text parts and the list of attachments, not the
> attachments themselves).

Yes, you can do that with IMAP. I just sent myself a message
containing the word "foo", an attachment consisting of the word "bar",
and my signature. Here's me querying the IMAP server about the
message:

a fetch 3475 bodystructure
* 3475 FETCH (BODYSTRUCTURE (("text" "plain" NIL NIL NIL "8bit" 5 1 NIL NIL NIL)("text" "plain" NIL NIL NIL "8bit" 3 0 NIL ("attachment" NIL) NIL)("text" "plain" NIL NIL NIL "8bit" 12 2 NIL NIL NIL) "mixed" ("boundary" "=-=-=") NIL NIL))
a OK FETCH completed.

You could almost use the Lisp reader on that... Here's how to get the
first part:

a fetch 3475 body[1]
* 3475 FETCH (BODY[1] {5}
foo
)
* 3475 FETCH (FLAGS (\Seen \Recent))
a OK FETCH completed.

Here's the attachment:

a fetch 3475 body[2]
* 3475 FETCH (BODY[2] {3}
bar)
a OK FETCH completed.

And the final part:

a fetch 3475 body[3]
* 3475 FETCH (BODY[3] {12}
-- 
Jouni
)
a OK FETCH completed.

(This is all documented in RFC 2060.)

From what I understand about the internal workings of Gnus, you'd have
to alter the backend protocol to make use of this. Instead of getting
a buffer filled with a message that it can parse for MIME structure,
the frontend would ask for some sort of a pre-parsed message object,
with stubs for the attachments, and only if the user wants to do
anything with them, would the frontend query the backend for their
contents.

-- 
Jouni




  reply	other threads:[~2006-04-11 20:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-06 20:53 Sam Steingold
2006-04-11  6:13 ` Lars Magne Ingebrigtsen
2006-04-11 15:36   ` Sam Steingold
2006-04-11 20:26     ` Jouni K Seppanen [this message]
2006-04-12  4:38       ` Lars Magne Ingebrigtsen
2006-04-17 15:18         ` Sam Steingold
2006-04-17 15:30           ` Lars Magne Ingebrigtsen
2006-04-18  9:18         ` Simon Josefsson
2006-04-18 16:25           ` Lars Magne Ingebrigtsen
2006-04-18 21:12             ` Simon Josefsson
2006-04-18 20:24           ` Ted Zlatanov
2006-04-18 21:17             ` Simon Josefsson
2006-04-19 18:40               ` Ted Zlatanov

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=29acarvoxa.fsf@james.hut.fi \
    --to=jks@iki.fi \
    /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).