dot

packages and services management
Log | Files | Refs | README

commit 03f432dea35d16391d90c4b60a68684afdbe704d
parent 244b45f27a0bf957167833281bb12c0dd17a557a
Author: Josuah Demangeon <mail@josuah.net>
Date:   Thu,  6 Dec 2018 22:14:14 +0100

bin/mail-*: lengthier names and more mutualized code

Diffstat:
Dbin/mail-com | 17-----------------
Abin/mail-compose | 14++++++++++++++
Mbin/mail-gpg-encrypt | 2+-
Dbin/mail-rep | 48------------------------------------------------
Abin/mail-reply | 40++++++++++++++++++++++++++++++++++++++++
Mbin/mail-write | 18++++++++++++------
Ms6/tor/x/conf/PIDFile | 2+-
7 files changed, 68 insertions(+), 73 deletions(-)

diff --git a/bin/mail-com b/bin/mail-com @@ -1,17 +0,0 @@ -#!/usr/bin/env execlineb - -backtick -n USER { whoami } -importas USER USER -backtick -n HOME { homeof $USER } -importas HOME HOME -importas -D ${HOME}/.mblaze MBLAZE MBLAZE - -backtick -n From { mhdr -h local-mailbox ${MBLAZE}/profile } -backtick -n To { pipeline { dollarat -n -d "," } sed "s/, */, /g" } -backtick -n Message-Id { mgenmid } -backtick -n Date { mdate } - -backtick -n x { mail-write } -importas draft x - -mail-draft ${draft} diff --git a/bin/mail-compose b/bin/mail-compose @@ -0,0 +1,14 @@ +#!/usr/bin/env execlineb + +backtick -n USER { whoami } +importas USER USER +backtick -n HOME { homeof $USER } +importas HOME HOME +importas -D ${HOME}/.mblaze MBLAZE MBLAZE + +backtick -n To { pipeline { dollarat -n -d "," } sed "s/, */, /g" } + +backtick -n x { mail-write } +importas draft x + +mail-draft ${draft} diff --git a/bin/mail-gpg-encrypt b/bin/mail-gpg-encrypt @@ -23,7 +23,7 @@ importas -s -d "\n" recipients x if { redirfd -w 1 "${tmp}/encrypted.asc" pipeline { sed "1,/^$/ d" "${draft}" } - gpg -a -e -r${recipients} + gpg -ae -r${recipients} } redirfd -w 1 "${draft}.mime" diff --git a/bin/mail-rep b/bin/mail-rep @@ -1,48 +0,0 @@ -#!/usr/bin/env execlineb - -backtick -n USER { whoami } -importas USER USER -backtick -n HOME { homeof $USER } -importas HOME HOME -importas -D ${HOME}/.mblaze MBLAZE MBLAZE - -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 } -importas me x - -backtick -n Cc { - pipeline { mhdr -d -h cc ${mail} } - grep -Fv ${me} -} - -backtick -n x { - pipeline { mhdr -d -h From ${mail} } - grep -Fv ${me} -} - -importas From x -backtick -n -D ${From} To { - pipeline { mhdr -d -h reply-to ${mail} } - grep -Fv ${me} -} - -backtick -n From { mhdr -h local-mailbox ${MBLAZE}/profile } -backtick -n Subject { mscan -f %S ${mail} } -backtick -n Message-Id { mhdr -d -h message-id ${mail} } -backtick -n Date { mdate } -export Body ${mail} - -backtick -n x { mail-write } -importas draft x - -if { - redirfd -c 1 ${draft} - if { echo "${From}:" } - pipeline { mshow -R ${mail} } - sed "s/^/> /; s/ *$//" -} - -mail-draft ${draft} diff --git a/bin/mail-reply b/bin/mail-reply @@ -0,0 +1,40 @@ +#!/usr/bin/env execlineb + +backtick -n USER { whoami } +importas USER USER +backtick -n HOME { homeof $USER } +importas HOME HOME +importas -D ${HOME}/.mblaze MBLAZE MBLAZE + +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 } +importas me x + +backtick -n -D ${From} To { + pipeline { mhdr -d -h reply-to ${mail} } + grep -Fv ${me} +} + +backtick -n Cc { + pipeline { mhdr -d -h cc ${mail} } + grep -Fv ${me} +} + +backtick -n From { mhdr -h local-mailbox ${MBLAZE}/profile } +backtick -n Subject { mscan -f %S ${mail} } +export Body ${mail} + +backtick -n x { mail-write } +importas draft x + +if { + redirfd -c 1 ${draft} + if { echo ${From}: } + pipeline { mshow -R ${mail} } + sed "s/^/> /; s/ *$//" +} + +mail-draft ${draft} diff --git a/bin/mail-write b/bin/mail-write @@ -4,20 +4,26 @@ backtick -n USER { whoami } importas USER USER backtick -n HOME { homeof $USER } importas HOME HOME -importas -D "${HOME}/.mblaze" MBLAZE MBLAZE +importas -D ${HOME}/.mblaze MBLAZE MBLAZE -backtick -n -D "${HOME}/mail/OUTBOX" x { mhdr -h outbox "${MBLAZE}/profile" } +backtick -n -D ${HOME}/mail/OUTBOX x { mhdr -h outbox ${MBLAZE}/profile } importas outbox x -backtick -n x { pipeline { true } mdeliver -v -XD "${outbox}" } +backtick -n x { pipeline { true } mdeliver -v -XD ${outbox} } importas draft x +backtick -n x { mdate } +importas -n Date x + +backtick -n x { mgenmid } +importas -n Message-Id x + +backtick -n x { mhdr -h local-mailbox ${MBLAZE}/profile } +importas -n From x + multisubstitute { importas -n Bcc Bcc importas -n Cc Cc - importas -n Date Date - importas -n From From - importas -n Message-Id Message-Id importas -n Subject Subject importas -n To To importas -n Body Body diff --git a/s6/tor/x/conf/PIDFile b/s6/tor/x/conf/PIDFile @@ -1 +1 @@ -/var/tor/pid +pid