From: nmeum <nmeum@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [ISSUE] Handling of encrypted PGP/MIME multipart messages
Date: Sat, 16 May 2020 21:53:38 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-175@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1678 bytes --]
New issue by nmeum on mblaze repository
https://github.com/leahneukirchen/mblaze/issues/175
Description:
I recently noticed that `contrib/mpgp` doesn't seem to handle encrypted PGP/MIME multipart messages well. For instance, consider an encrypted PGP/MIME messages which consists of text + attachments (e.g. tarballs). Since `mpgp` is a filter it does not seem to be possible to extract attachments from such a message (e.g. through `mshow -x`) or at least, I didn't manage to do so.
In case anybody else is encountering this issue, I wrote myself the following script (`mshowpgp`) which I use instead of `mpgp`:
```shell
#!/bin/sh
# Decryptes current mblaze (PGP/MIME) message.
set -e
# See ENVIRONMENT section in mseq(1).
MBLAZE="${MBLAZE:-$HOME/.mblaze}"
MAILCUR="${MAILCUR:-$MBLAZE/cur}"
n=$(mshow -t | awk -F: '
/: application\/pgp-encrypted/ {supported = 1}
/: application\/octet-stream/ {if (supported) { print $1; exit }}')
if [ "$n" ]; then
mshow -n -O "$MAILCUR" "$n" | gpg --decrypt | mshow -n /dev/stdin "$@"
exit 0
else
echo "Current mblaze message is not PGP/MIME encrypted" 1>&2
exit 1
fi
```
If the current message is PGP/MIME encrypted its attachments can be extracted using `mshowpgp -x` as usual. The script also illustrates some shortcomings of `mshow`:
1. There doesn't seem to be any portable way of reading messages from standard input (iirc `/dev/stdin` is not specified by POSIX).
2. If `mshow -x` or `mshow -O` is used it does not seem to be possible to use the current message without explicitly specifying its path.
If there is any way to extract attachments with the `mpgp` filter please let me know.
next reply other threads:[~2020-05-16 19:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-16 19:53 nmeum [this message]
2020-05-16 20:03 ` leahneukirchen
2020-05-16 20:05 ` leahneukirchen
2020-05-17 8:34 ` [ISSUE] [CLOSED] " nmeum
2020-05-23 13:35 ` leahneukirchen
2020-05-23 15:10 ` nmeum
2023-02-12 13:13 ` xelxebar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-175@inbox.vuxu.org \
--to=nmeum@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).