I found the solution hidden in a closed issue on GitHub (thanks to @mankoff):
(defun my-remove-attachment (msg num)
(let* ((attach (mu4e~view-get-attach msg num))
(path (mu4e-msg-field msg :path))
(filename (and attach (plist-get attach :name)))
(cmd (format "altermime --input=%s --remove='%s'" path filename)))
(when (and filename
(format "Are you sure you want to remove '%s'?" filename)))
'("remove-attachment" . my-remove-attachment))
This adds a new "attachment action" in Mu4e. When viewing an email, press
r to select the action defined above, then enter the number of the attachment. The action will ask you for confirmation before deleting the attachment. The header listing the attachments is not updates but when you leave the email and reopen it, the attachment is gone.
The code assumes that the tool altermime is installed. To install it in Ubuntu, do
sudo apt-get install altermime.