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
.Os
.Sh NAME
@ -97,6 +97,12 @@ when you want to use this feature together with
.Nm mfwd ,
or
.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
.Bl -tag -width 2n
.It Ic s

26
mcom

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

Loading…
Cancel
Save