mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 687b3ddc0df89d48af5d20cb37fa2feb19a6c537
parent df7cd7249c04cfe116aba64258b512c897fd9ef4
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Fri, 26 May 2017 15:57:56 +0200

add mgpg

Diffstat:
contrib/mgpg | 20++++++++++++++++++++
1 file changed, 20 insertions(+), 0 deletions(-)

diff --git a/contrib/mgpg b/contrib/mgpg @@ -0,0 +1,20 @@ +#!/bin/sh -e + +tmp=$(mktemp) +trap "rm -f '$tmp'" INT TERM EXIT + +{ + echo "Content-Type: $PIPE_CONTENTTYPE" + echo + cat +} > "$tmp" + +n=$(mshow -t "$tmp" | awk -F: ' + /: application\/pgp-encrypted/ {supported = 1} + /: application\/octet-stream/ {if (supported) print $1}') + +if [ "$n" ]; then + mshow -O "$tmp" "$n" | gpg -d 2>&1 + exit 64 +fi +exit 63