Github messages for mblaze
 help / color / mirror / Atom feed
From: Anachron <Anachron@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] mcom: Add sendhook
Date: Fri, 22 Apr 2022 09:05:16 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-226@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

There is a new pull request by Anachron against master on the mblaze repository

https://github.com/Anachron/mblaze master
https://github.com/leahneukirchen/mblaze/pull/226

mcom: Add sendhook
This allows to execute commands after a mail has been sent.
Requires a modification of $MBLAZE/profile (new header: `sendhook`).

For now commands with spaces are not allowed, as this would complicate the code.

Closes #204

A patch file from https://github.com/leahneukirchen/mblaze/pull/226.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-226.patch --]
[-- Type: text/x-diff, Size: 1106 bytes --]

From c17f5c76eebea170e27add0d23b1f03faa17fffe Mon Sep 17 00:00:00 2001
From: Anachron <gith@cron.world>
Date: Fri, 22 Apr 2022 08:38:36 +0200
Subject: [PATCH] mcom: Add sendhook

---
 mcom | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mcom b/mcom
index d60070e..5bcfdc7 100755
--- a/mcom
+++ b/mcom
@@ -104,6 +104,7 @@ sendmail=$(mhdr -h sendmail "$MBLAZE/profile")
 sendmail_args=$(mhdr -h sendmail-args "$MBLAZE/profile")
 sendmail="${sendmail:-sendmail} ${sendmail_args:--t}"
 default_from=$(mhdr -h local-mailbox "$MBLAZE/profile")
+sendhook=$(mhdr -h sendhook "$MBLAZE/profile")
 
 defaultc=e
 
@@ -440,7 +441,7 @@ while :; do
 				if $sendmail <"$draftmime"; then
 					if [ "$outbox" ]; then
 						mv "$draftmime" "$draft"
-						mflag -d -S "$draft"
+						${sendhook:-mflag -d -S} "$draft"
 					else
 						rm "$draft" "$draftmime"
 					fi
@@ -458,7 +459,7 @@ while :; do
 				stampdate "$draft"
 				if $sendmail <"$draft"; then
 					if [ "$outbox" ]; then
-						mflag -d -S "$draft"
+						${sendhook:-mflag -d -S} "$draft"
 					else
 						rm "$draft"
 					fi

             reply	other threads:[~2022-04-22  7:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  7:05 Anachron [this message]
2023-10-27  8:28 ` [PR PATCH] [Updated] " Anachron
2024-01-01  8:38 ` Anachron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-226@inbox.vuxu.org \
    --to=anachron@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).