Yes, looks like you are right: direct deletion of mail attachments is not supported. I just tested this by pointing the mail attachment in SD Explorer and choosing the right click pop up menu item "Delete mail attachment ". This causes and
"Error deleting mail attachment "name": -10000".
But there is a way to do this by clicking the ‘Remove Attachments’ menu item with System Events (this was a suggestion from Reddit AppleScript subreddit):
tell application "Mail"
set selected messages of message viewer 1 to message 1 of mailbox "XX" of account id "XX"
tell application "System Events" to click menu item "Remove Attachments" of menu 1 of menu bar item "Message" of menu bar 1 of process "Mail"
And thinking about what it would mean to delete a mail attachment, it doesn’t make sense to me in practical terms, unless it is an attachment to an unsent, outgoing draft.
Deleting big mail attachments is a quick way to free some space (on local disk and on an IMAP server: the attachments are deleted from the server as well).
Does this actually allow a message in, say, the Inbox to be “replaced” with an edited version that has had its attachment(s) removed ?
Remove Attachment menu item just replaces the existing mail attachment with text file “Mail attachment.txt” with a following contents:
"<BR><BR>[The attachment <attachment name> has been manually removed]<BR><BR>". So, it is the same message with all the attachments replaced by small text-file placeholders.