From b063294dafba965644b6cb5d38c576c4304fd12e Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Fri, 3 Jul 2020 17:48:39 +0200 Subject: mcom: use - instead of /dev/stdin --- mcom | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/mcom b/mcom index 693d5c4..a1a1f90 100755 --- a/mcom +++ b/mcom @@ -229,7 +229,7 @@ case "$0" in ;; esac -hdrs="$(printf '%s\n' "${hdrs#$NL}" | mhdr /dev/stdin)" +hdrs="$(printf '%s\n' "${hdrs#$NL}" | mhdr -)" outbox=$(mhdr -h outbox "$MBLAZE/profile") if [ -z "$outbox" ]; then @@ -266,37 +266,37 @@ fi case "$0" in *mcom*) { - printf '%s' "$hdrs" | mhdr -M -h to /dev/stdin | + printf '%s' "$hdrs" | mhdr -M -h to - | commajoin | sed 's/^/To: /' - printf '%s' "$hdrs" | mhdr -M -h cc /dev/stdin | + printf '%s' "$hdrs" | mhdr -M -h cc - | commajoin | sed 's/^/Cc: /' - printf '%s' "$hdrs" | mhdr -M -h bcc /dev/stdin | + printf '%s' "$hdrs" | mhdr -M -h bcc - | commajoin | sed 's/^/Bcc: /' printf '%s\n' "$hdrs" | awk '{ print }' | - msed "/to/d; /cc/d; /bcc/d; /body/d" /dev/stdin - } | msed "/cc/a//; /bcc/a//; /subject/a//; /from/a/$default_from/" /dev/stdin | sed '/^$/d' + msed "/to/d; /cc/d; /bcc/d; /body/d" - + } | msed "/cc/a//; /bcc/a//; /subject/a//; /from/a/$default_from/" - | sed '/^$/d' msgid museragent cat "$MBLAZE/headers" 2>/dev/null printf '\n' ( IFS=$NL - cat -- /dev/null $(printf '%s' "$hdrs" | mhdr -M -h body /dev/stdin) + cat -- /dev/null $(printf '%s' "$hdrs" | mhdr -M -h body -) ) printf '\n' ;; *mfwd*) { - printf '%s' "$hdrs" | mhdr -M -h to /dev/stdin | + printf '%s' "$hdrs" | mhdr -M -h to - | commajoin | sed 's/^/To: /' - printf '%s' "$hdrs" | mhdr -M -h cc /dev/stdin | + printf '%s' "$hdrs" | mhdr -M -h cc - | commajoin | sed 's/^/Cc: /' - printf '%s' "$hdrs" | mhdr -M -h bcc /dev/stdin | + printf '%s' "$hdrs" | mhdr -M -h bcc - | commajoin | sed 's/^/Bcc: /' COLUMNS=10000 mscan -f 'Subject: Fwd: [%f] %s' "$@" 2>/dev/null | sed 1q printf '%s\n' "$hdrs" | awk '{ print }' | - msed "/to/d; /cc/d; /bcc/d" /dev/stdin - } | msed "/cc/a//; /bcc/a//; /from/a/$default_from/" /dev/stdin | sed '/^$/d' + msed "/to/d; /cc/d; /bcc/d" - + } | msed "/cc/a//; /bcc/a//; /from/a/$default_from/" - | sed '/^$/d' msgid museragent cat "$MBLAZE/headers" 2>/dev/null @@ -324,14 +324,14 @@ fi fi { - printf '%s' "$hdrs" | mhdr -M -h resent-to /dev/stdin | + printf '%s' "$hdrs" | mhdr -M -h resent-to - | commajoin | sed 's/^/Resent-To: /' - printf '%s' "$hdrs" | mhdr -M -h resent-cc /dev/stdin | + printf '%s' "$hdrs" | mhdr -M -h resent-cc - | commajoin | sed 's/^/Resent-Cc: /' printf '%s\n' "$hdrs" | awk '{ print }' | - msed "/resent-to/d; /resent-cc/d" /dev/stdin + msed "/resent-to/d; /resent-cc/d" - } | - msed "/resent-to/a//; /resent-from/a/$default_from/" /dev/stdin | sed '/^$/d' + msed "/resent-to/a//; /resent-from/a/$default_from/" - | sed '/^$/d' msgid | sed 's/^/Resent-/' printf 'Resent-Date: %s\n' "$(mdate)" ( @@ -359,11 +359,11 @@ fi ouniq |commajoin)" printf 'Bcc: \n' printf '%s\n' "$hdrs" | awk '{ print }' | - msed "/body/d" /dev/stdin + msed "/body/d" - fi | sed '/^$/d' printf 'Subject: Re: %s\n' "$(COLUMNS=10000 mscan -f '%S' "$1")" if ! printf '%s\n' "$hdrs" | awk '{ print }' | - mhdr -h from: /dev/stdin >/dev/null; then + mhdr -h from: - >/dev/null; then addr=$(maddr -a -h to:cc:bcc: "$1" | replyfrom | head -n1) [ -n "$addr" ] && from=$(maddr -h reply-from "$MBLAZE/profile" | grep -Fi "<$addr>" | head -n1) [ -n "$addr" ] && [ -z "$from" ] && from=$(maddr -h alternate-mailboxes "$MBLAZE/profile" | grep -Fi "<$addr>" | head -n1) @@ -390,7 +390,7 @@ fi fi ( IFS=$NL - cat -- /dev/null $(printf '%s' "$hdrs" | mhdr -M -h body /dev/stdin) + cat -- /dev/null $(printf '%s' "$hdrs" | mhdr -M -h body -) ) printf '\n' ;; -- cgit 1.4.1