mu4e: Add a mime-type-check when importing a pgp-key from an attachment
This commit is contained in:
committed by
Dirk-Jan C. Binnema
parent
81e0c49084
commit
090ff42c50
@ -1457,8 +1457,11 @@ If PIPECMD is nil, ask user for it."
|
|||||||
"Import MSG's attachment ATTACHNUM into the gpg-keyring."
|
"Import MSG's attachment ATTACHNUM into the gpg-keyring."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((att (mu4e~view-get-attach msg attachnum))
|
(let* ((att (mu4e~view-get-attach msg attachnum))
|
||||||
(index (plist-get att :index)))
|
(index (plist-get att :index))
|
||||||
(mu4e~view-temp-action (mu4e-message-field msg :docid) index 'gpg)))
|
(mime-type (plist-get att :mime-type)))
|
||||||
|
(if (string= "application/pgp-keys" mime-type)
|
||||||
|
(mu4e~view-temp-action (mu4e-message-field msg :docid) index 'gpg)
|
||||||
|
(mu4e-error "Invalid mime-type for a pgp-key: `%s'" mime-type))))
|
||||||
|
|
||||||
(defun mu4e-view-attachment-action (&optional msg)
|
(defun mu4e-view-attachment-action (&optional msg)
|
||||||
"Ask user what to do with attachments in MSG
|
"Ask user what to do with attachments in MSG
|
||||||
|
|||||||
Reference in New Issue
Block a user