1

I would like to reduce the size of my mail archive by deleting text/html parts of multipart/alternative messages.

I can do this individually in mutt by opening each message, but it gets tedious. Is there a way to do it in bulk?

Any or all three of these would be useful:

  1. automatically strip text/html from multipart/alternative messages via procmail (the problem is not how to match these messages in procmailrc, but how to automatically remove only the text/html part);
  2. bulk delete text/html from multipart/alternative messages in a maildir;
  3. delete text/html parts from tagged multipart/alternative messages in mutt.
András Korn
  • 340
  • 1
  • 8
  • Procmail by itself can only *match* messages; you need a separate utility to rewrite the messages, ideally one with proper MIME support, which Procmail also lacks. https://superuser.com/questions/406125/utility-for-extracting-mime-attachments asks a slightly different question, but at least has some hopefully useful pointers to related tools. It would not be too hard to write a filter in a language like Python, if you are up for it. – tripleee Feb 07 '21 at 13:07
  • Thanks; what I had in mind with procmail was filtering the messages through some tool that determines whether the text/plain bit plausibly contains the same thing as the text/html bit (as opposed to, say, just a generic "your email client doesn't display HTML, please use a different one" message), and if yes, deletes the text/html part. I don't need it to be foolproof, just to work most of the time. I saw the linked question but it doesn't obviously help me. Writing my own filter in Python would definitely be overkill. – András Korn Feb 07 '21 at 14:05
  • Again, if you ask "how can I write a Procmail rule to identi|y messages with the following features" we could definitely help you with that; but this question doesn't seem to be asking that (and is vaguely probably too broad / unspecific anyway). – tripleee Feb 07 '21 at 14:15
  • I have no problem writing a procmail rule that identifies messages that are multipart/alternative and have a text/html part. What I'm looking for is a way to *remove* that part. Some program procmail could filter the message through to accomplish this. I'll rephrase the question to make it clearer. – András Korn Feb 07 '21 at 17:38
  • 1
    If you change your mind about writing a dedicated script, here is a rough first cut: https://gist.github.com/tripleee/862acc9f239c1bd6f610d22ef341d7d0 – tripleee Feb 09 '21 at 11:52

1 Answers1

-1

If your using Gmail there should be an empty square to the left of each notification, and if you click it you will select that notification, and by selecting multiple notifications at a time, and then hitting the delete key, you should be able to bulk delete :)

  • I think you misunderstood the question. It's not about gmail or notifications, but about removing MIME parts with the mime-type of text/html from email messages programmatically, either as they arrive, or afterwards, from messages stored in maildirs. – András Korn Feb 07 '21 at 22:58