add mbnc to bounce messages

pull/82/head
Leah Neukirchen 6 years ago
parent a6243d7a2f
commit 88a87a361a

@ -60,6 +60,7 @@ install: FRC all
install -m0755 $(ALL) $(SCRIPT) $(DESTDIR)$(BINDIR)
ln -sf mless $(DESTDIR)$(BINDIR)/mnext
ln -sf mless $(DESTDIR)$(BINDIR)/mprev
ln -sf mcom $(DESTDIR)$(BINDIR)/mbnc
ln -sf mcom $(DESTDIR)$(BINDIR)/mfwd
ln -sf mcom $(DESTDIR)$(BINDIR)/mrep
install -m0644 man/*.1 $(DESTDIR)$(MANDIR)/man1

@ -13,6 +13,7 @@ DESCRIPTION
mblaze consists of these Unix tools that each do one job:
maddr(1) extract addresses from mail
magrep(1) find mails matching a pattern
mbnc(1) bounces mail
mcom(1) compose and send mail
mdeliver(1) deliver messages or import mailboxes
mdirs(1) find Maildir folders
@ -126,6 +127,6 @@ LICENSE
To the extent possible under law, the creator of this work has waived all
copyright and related or neighboring rights to this work.
http://creativecommons.org/publicdomain/zero/1.0/
http://creativecommons.org/publicdomain/zero/1.0/
Void Linux June 30, 2017 Void Linux
Void Linux January 6, 2018 Void Linux

@ -1,4 +1,4 @@
.Dd June 30, 2017
.Dd January 6, 2018
.Dt MBLAZE 7
.Os
.Sh NAME
@ -20,6 +20,8 @@ consists of these Unix tools that each do one job:
extract addresses from mail
.It Xr magrep 1
find mails matching a pattern
.It Xr mbnc 1
bounces mail
.It Xr mcom 1
compose and send mail
.It Xr mdeliver 1

@ -0,0 +1 @@
.so man1/mcom.1

@ -1,11 +1,12 @@
.Dd July 22, 2016
.Dd January 6, 2017
.Dt MCOM 1
.Os
.Sh NAME
.Nm mcom ,
.Nm mfwd ,
.Nm mbnc ,
.Nm mrep
.Nd compose, forward, reply to, and send mail
.Nd compose, forward, bounce, reply to, and send mail
.Sh SYNOPSIS
.Nm mcom
.Op Ar recipients\ ...
@ -14,6 +15,8 @@
.Nm mfwd
.Op Fl r
.Op Ar msgs\ ...
.Nm mbnc
.Ar msg
.Nm mrep
.Ar msg
.Sh DESCRIPTION
@ -40,6 +43,15 @@ to forward as
.Xr mshow 1
rendered plain text, using RFC934 message encapsulation.
.Pp
.Nm mbnc
behaves like
.Nm mcom
but creates the draft from the original
.Ar msg
(including headers)
and adds a Resent-To header, to which the message will
be bounced directly.
.Pp
.Nm mrep
behaves like
.Nm mcom

@ -0,0 +1 @@
mcom

38
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

Loading…
Cancel
Save