dot

packages and services management
Log | Files | Refs | README

commit 6f6b5a7f412a4c0ff42a529eabf57cf44bc00af4
parent 108db050c2c07d424fcba6fe6c7eaa9545376f66
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun,  2 Dec 2018 20:29:11 +0100

quote previous message

Diffstat:
Mbin/mail-com | 6++++--
Mbin/mail-rep | 25+++++++++++++++++--------
Mbin/mail-write | 6++----
3 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/bin/mail-com b/bin/mail-com @@ -1,5 +1,4 @@ #!/usr/bin/env execlineb -elgetpositionals backtick -n USER { whoami } importas USER USER @@ -12,4 +11,7 @@ backtick -n To { pipeline { dollarat -n -d "," } sed "s/, */, /g" } backtick -n Message-Id { mgenmid } backtick -n Date { mdate } -mail-write ${@} +backtick -n x { mail-write } +importas draft x + +mail-draft ${draft} diff --git a/bin/mail-rep b/bin/mail-rep @@ -1,6 +1,4 @@ #!/usr/bin/env execlineb -importas -i mail 1 -shift -n 1 backtick -n USER { whoami } importas USER USER @@ -8,7 +6,8 @@ backtick -n HOME { homeof $USER } importas HOME HOME importas -D ${HOME}/.mblaze MBLAZE MBLAZE -backtick -n x { mseq ${mail} } +importas -D . 1 1 +backtick -n x { pipeline { mseq ${1} } tr -d " \t" } importas mail x backtick -n x { maddr -a -h local-mailbox:alternate-mailboxes: ${MBLAZE}/profile } @@ -19,13 +18,13 @@ backtick -n Cc { grep -Fv ${me} } -backtick -n To { - pipeline { mhdr -d -h to ${mail} } +backtick -n x { + pipeline { mhdr -d -h From ${mail} } grep -Fv ${me} } -importas To To -backtick -n -D ${To} To { +importas From x +backtick -n -D ${From} To { pipeline { mhdr -d -h reply-to ${mail} } grep -Fv ${me} } @@ -35,4 +34,14 @@ backtick -n Message-Id { mhdr -d -h message-id ${mail} } backtick -n Date { mdate } export Body ${mail} -mail-write ${recipients} +backtick -n x { mail-write } +importas draft x + +if { + redirfd -c 1 ${draft} + if { echo "${From}:" } + pipeline { mshow -R ${mail} } + sed "1,/^$/ d; s/^/> /; s/ *$//" +} + +mail-draft ${draft} diff --git a/bin/mail-write b/bin/mail-write @@ -9,7 +9,7 @@ importas -D "${HOME}/.mblaze" MBLAZE MBLAZE backtick -n -D "${HOME}/mail/OUTBOX" x { mhdr -h outbox "${MBLAZE}/profile" } importas outbox x -backtick -n x { redirfd -r 0 "/dev/null" mdeliver -v -XD "${outbox}" } +backtick -n x { pipeline { true } mdeliver -v -XD "${outbox}" } importas draft x multisubstitute { @@ -34,8 +34,6 @@ if { if { echo Message-Id: ${Message-Id} } if { museragent } if { echo } - if -t { test "${Body}" } - cat "${Body}" } -mail-draft "${draft}" +printf "%s\n" ${draft}