VM

About deleting attachments

Asked by Peter Grandi on 2017-07-22

Is there is a built-in easy way to delete (binary) attachments from a stored message?

The reason: I often get "spam", with potentially dangerous and/or large attachments, and I would like to archive it, for periodic training of the bayesian "spam" detector I use, but I would like to remove them from the message. Ideally there would be a command that takes a regular expression of MIME types and another of file names of attachments to delete from a stored message.

Question information

Language:
English Edit question
Status:
Solved
For:
VM Edit question
Assignee:
Uday Reddy Edit question
Solved by:
Uday Reddy
Solved:
2018-08-27
Last query:
2018-08-27
Last reply:
2018-08-24
Launchpad Janitor (janitor) said : #1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Uday Reddy (reddyuday) said : #2

Looking into it.

Uday Reddy (reddyuday) said : #3

The doc string for `vm-delete-all-attachments':

vm-delete-all-attachments is an interactive autoloaded compiled Lisp
function in `vm-mime.el'.

It is bound to C-c C-d.

(vm-delete-all-attachments &optional COUNT)

Delete all attachments from the next COUNT messages or marked
messages. For the purpose of this function, an "attachment" is
a mime part part which has "attachment" as its disposition or
simply has an associated filename. Any mime types that match
`vm-mime-deleteable-types' but not `vm-mime-deleteable-type-exceptions'
are also included.

Best Uday Reddy (reddyuday) said : #4

To do this for a whole buffer, you can try M-0 prefix command (if it works in your version), or mark all messages (`vm-mark-summay-region') and then use M-n.

Peter Grandi (pg-8) said : #5

Thanks Uday Reddy, that solved my question.