|
|
@ -36,23 +36,49 @@ sendmail=$(mhdr -h sendmail "$MBLAZE/profile")
|
|
|
|
sendmail_args=$(mhdr -h sendmail-args "$MBLAZE/profile")
|
|
|
|
sendmail_args=$(mhdr -h sendmail-args "$MBLAZE/profile")
|
|
|
|
sendmail="${sendmail:-sendmail} ${sendmail_args:--t}"
|
|
|
|
sendmail="${sendmail:-sendmail} ${sendmail_args:--t}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resume=
|
|
|
|
|
|
|
|
case "$0" in
|
|
|
|
|
|
|
|
*mcom*)
|
|
|
|
|
|
|
|
if [ "$1" = -r ]; then
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
resume=1
|
|
|
|
|
|
|
|
if [ "$#" -gt 0 ]; then
|
|
|
|
|
|
|
|
echo "used dreaft $1"
|
|
|
|
|
|
|
|
draft="$1"
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
outbox=$(mhdr -h outbox "$MBLAZE/profile")
|
|
|
|
outbox=$(mhdr -h outbox "$MBLAZE/profile")
|
|
|
|
if [ -z "$outbox" ]; then
|
|
|
|
if [ -z "$outbox" ]; then
|
|
|
|
i=0
|
|
|
|
if [ -z "$resume" ]; then
|
|
|
|
while [ -f "snd.$i" ]; do
|
|
|
|
i=0
|
|
|
|
i=$((i+1))
|
|
|
|
while [ -f "snd.$i" ]; do
|
|
|
|
done
|
|
|
|
i=$((i+1))
|
|
|
|
draft="./snd.$i"
|
|
|
|
done
|
|
|
|
|
|
|
|
draft="./snd.$i"
|
|
|
|
|
|
|
|
elif [ -z "$draft" ]; then
|
|
|
|
|
|
|
|
draft=$(ls -1t ./snd.*[0-9] | sed 1q)
|
|
|
|
|
|
|
|
fi
|
|
|
|
draftmime="./snd.$i.mime"
|
|
|
|
draftmime="./snd.$i.mime"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
draft="$(true | mdeliver -v -c -XD "$outbox")"
|
|
|
|
if [ -z "$resume" ]; then
|
|
|
|
if [ -z "$draft" ]; then
|
|
|
|
draft="$(true | mdeliver -v -c -XD "$outbox")"
|
|
|
|
printf '%s\n' "$0: failed to create draft in outbox $outbox." 1>&2
|
|
|
|
if [ -z "$draft" ]; then
|
|
|
|
exit 1
|
|
|
|
printf '%s\n' "$0: failed to create draft in outbox $outbox." 1>&2
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
elif [ -z "$draft" ]; then
|
|
|
|
|
|
|
|
draft=$(mlist -D "$outbox" | msort -r -M | sed 1q)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
draftmime="$(printf '%s\n' "$draft" | sed 's,\(.*\)/cur/,\1/tmp/mime-,')"
|
|
|
|
draftmime="$(printf '%s\n' "$draft" | sed 's,\(.*\)/cur/,\1/tmp/mime-,')"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $draft
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ -z "$resume" ] &&
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case "$0" in
|
|
|
|
case "$0" in
|
|
|
|
*mcom*)
|
|
|
|
*mcom*)
|
|
|
|