mcom: add -send

pull/153/head
Leah Neukirchen 5 years ago
parent 6b3cca21fb
commit a6f48fe371

@ -1,4 +1,4 @@
.Dd January 6, 2017 .Dd January 29, 2019
.Dt MCOM 1 .Dt MCOM 1
.Os .Os
.Sh NAME .Sh NAME
@ -97,6 +97,12 @@ when you want to use this feature together with
.Nm mfwd , .Nm mfwd ,
or or
.Nm mbnc . .Nm mbnc .
.Pp
If the flag
.Fl send
is passed,
the message will be sent directly using the data on
the command line, and no editor or edit loop will be run.
.Sh MENU COMMANDS .Sh MENU COMMANDS
.Bl -tag -width 2n .Bl -tag -width 2n
.It Ic s .It Ic s

26
mcom

@ -74,6 +74,8 @@ sendmail_args=$(mhdr -h sendmail-args "$MBLAZE/profile")
sendmail="${sendmail:-sendmail} ${sendmail_args:--t}" sendmail="${sendmail:-sendmail} ${sendmail_args:--t}"
default_from=$(mhdr -h local-mailbox "$MBLAZE/profile") default_from=$(mhdr -h local-mailbox "$MBLAZE/profile")
defaultc=e
hdrs= hdrs=
resume= resume=
noquote= noquote=
@ -104,6 +106,9 @@ case "$0" in
shift shift
fi fi
;; ;;
-send)
defaultc=justsend
shift;;
-??*) -??*)
hdr=${1#-} hdr=${1#-}
shift;; shift;;
@ -127,6 +132,9 @@ case "$0" in
-r) -r)
shift shift
raw=1;; raw=1;;
-send)
defaultc=justsend
shift;;
-??*) -??*)
hdr=${1#-} hdr=${1#-}
shift;; shift;;
@ -148,6 +156,9 @@ case "$0" in
--) --)
shift shift
break;; break;;
-send)
defaultc=justsend
shift;;
-??*) -??*)
hdr=${1#-} hdr=${1#-}
shift;; shift;;
@ -169,6 +180,9 @@ case "$0" in
--) --)
shift shift
break;; break;;
-send)
defaultc=justsend
shift;;
-noquote) -noquote)
noquote=1 noquote=1
shift;; shift;;
@ -349,7 +363,7 @@ fi
} >$draft } >$draft
automime= automime=
c=e c=$defaultc
while :; do while :; do
case "$c" in case "$c" in
s|send) s|send)
@ -436,6 +450,16 @@ while :; do
do_mime do_mime
fi fi
;; ;;
justsend)
stripempty $draft
if mmime -c <$draft && ! needs_multipart $draft; then
automime=
else
automime=1
do_mime
fi
c=send
;;
d|delete) d|delete)
rm -i $draft rm -i $draft
if ! [ -f $draft ]; then if ! [ -f $draft ]; then

Loading…
Cancel
Save