Feature #2

Download attachments on demand

Added by Vladimir Smolyar almost 11 years ago. Updated about 1 month ago.

In Progress
Target version:
Start date:
Due date:
% Done:


Estimated time:


Below follows actually the quote of my message to Sylpheed mailing list which hasn't ever got any response.

I would like to suggest a slightly changed way of e-mails with attachments treatment.
The problems is: it often happens that a person receives an e-mail with some files attached and wants just to read the text message in such letter rather than downloading it with all the files attached. In my case the current Sylpheed behaviour (downloading all the attachments when I click on the message to see the text) is very inconvenient since I have a very slow connection and have to pay for the amount of traffic I used.
It would be very very nice if you introduced an option to download the attachments only on demand. For example, when I click "Save as..." for some of the attached files.
It doesn't seem as a hard-to-implement feature, but it could make life much more comfortable for a lot of people I believe.

Thank you.


Updated by Hiroyuki Yamamoto over 10 years ago

  • Status changed from New to In Progress
  • Assignee set to Hiroyuki Yamamoto

I suppose you mentions IMAP messages.
I will add an option to download only text part and a feature to download attachments
on demand in the future release.


Updated by Andrey Gursky almost 10 years ago

Without such a feature it is impossible to use sylpheed on low-bandwidth networks. Assuming sylpheed is a light-weight client, this feature is essential.
It would be excited if you add it!

Thank you,


Updated by Genghis Khan about 7 years ago

I use Linux, and when I see a spam message with an .exe file, I know I have nothing to do with it. I would love to just delete such messages without downloading their attachments.


Updated by Andrey Gursky over 6 years ago

Hiroyuki Yamamoto wrote:

I will add an option to download only text part and a feature to download attachments
on demand in the future release.

are you working on it?



Updated by Andrey Gursky over 6 years ago

Few years ago I gave up with sylpheed. Now the question is again to give up or not to give up. I would switch to claws-mail, but they have the same problem [1], though recently one figured out, that libetpan supports this already, but not claws-mail itself. Would it be easier to integrate it there? Or should I give a chance trojita. Maybe it supports this out-of-the-box...

Ok, I've looked into the code. And I would propose the following:
- In imap_get_uncached_messages / imap_get_uncached_messages_func (libsylph/imap.c) fetch also BODYSTRUCTURE. This gives us full information of mail parts (and attachments' filenames). The headers should be written to the cache file.
- In imap_cmd_fetch (libsylph/imap.c) fetch not BODY.PEEK[] but BODY.PEEK[#num1.#num2], where #num1 and so on are the IDs from BODYSTRUCTURE, which are either text/plain or text/html. Append the result to the cache (the headers are already there).
- Once user clicks on the attachment and it is not yet in the cache, a question should arise to confirm the downloads. This part will be fetched, the content of the saved cached loaded and parsed and the content of the attachment should be inserted in the raw message, as it would be downloaded as whole. Then save the cache file. Ideally, once user downloads all attachments, the cache file should look exactly as it is now.

I see plugin/attachment_tool/attachment_tool.c can already manipulate the cache file. Perhaps it could be extended with additional "add" operation?



Updated by Andrey Gursky over 5 years ago

Meanwhile I've implemented a hack to fix this: for now without dealing with BODYSTRUCTURE. There are 2 known issues:
  1. Messages consisting of only attachments without text BODY at all will be downloaded.
  2. MS Exchange IMAP Server seems to not support BODY.PEEK[1.HEADER], I need due to multipart messages. Any clue, is it a bug or there is better replacement?

If you have suggestion, where to place an option for enable/disable attachment downloading, which can be accessed in imap.c, I would add it.


Updated by Andrey Gursky over 5 years ago

Updated URL of the corresponding bug report for Claws Mail: (don't download attachments when opening mail for reading)


Updated by Andrey Gursky over 5 years ago

The option to enable/disable attachments download would be only useful, if we add a function to redownload a selected message. Once only text part has been saved, Sylpheed treats this email as downloaded. When you decide you want also attachments, you'd need to enable attachments download and force Sylpheed to redownload the message.


Updated by replica watches 5 months ago began the watchmaker Maurice Barouh in the 1940s, and attention unique Replica Watches are designed customer particular attitude and The internationally designed watches and looking for and elegant to to work casual sporty watch wear around <STRONG>Fake Michele Watches</STRONG> have what are for.</p>

Also available in: Atom PDF