From 88a87a361a5eb8675fbe8f9628c9b230c40dba3e Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sat, 6 Jan 2018 19:17:49 +0100 Subject: add mbnc to bounce messages --- mcom | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'mcom') diff --git a/mcom b/mcom index fb7ec8d..0603cee 100755 --- a/mcom +++ b/mcom @@ -143,6 +143,14 @@ fi done ) fi ;; + *mbnc*) + printf '%s: \n' Resent-To + from=$(mhdr -h local-mailbox "$MBLAZE/profile") + [ "$from" ] && printf 'Resent-From: %s\n' "$from" + msgid | sed 's/^/Resent-/' + printf 'Resent-Date: %s\n' "$(mdate)" + mseq "${@:-.}" | xargs -d'\n' cat + ;; *mrep*) [ "$#" -eq 0 ] && set -- . ng=$(mhdr -h newsgroups "$1") @@ -178,16 +186,20 @@ fi ;; esac - if [ -f "$MBLAZE/signature" ]; then - SIGNATURE="$MBLAZE/signature" - elif [ -f ~/.signature ]; then - SIGNATURE="$HOME/.signature" - fi + case "$0" in + *mbnc*) ;; + *) + if [ -f "$MBLAZE/signature" ]; then + SIGNATURE="$MBLAZE/signature" + elif [ -f ~/.signature ]; then + SIGNATURE="$HOME/.signature" + fi - if [ -n "$SIGNATURE" ]; then - printf '%s\n' '-- ' - cat "$SIGNATURE" - fi + if [ -n "$SIGNATURE" ]; then + printf '%s\n' '-- ' + cat "$SIGNATURE" + fi + esac } >$draft automime= @@ -200,6 +212,14 @@ while :; do *.*) sendmail="mblow";; esac + resent="$(maddr -h resent-to "$draft")" + case "$resent" in + ?*) + sendmail=$(mhdr -h sendmail "$MBLAZE/profile") + sendmail="${sendmail:-sendmail} -- $resent" + ;; + esac + if [ -e $draftmime ]; then if [ $draft -ot $draftmime ] || [ "$automime" -eq 1 ]; then stampdate $draftmime -- cgit 1.4.1