all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 275ea6d04cb372c47ebe5a2ef0c5bddaa300dfb6 1502 bytes (raw)
name: gnu/packages/patches/msmtpq-add-enqueue-option.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
From a1be5a9b5ebaa3941f4cb08f99482bccf52a3082 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@trop.in>
Date: Fri, 9 Jul 2021 08:30:00 +0300
Subject: [PATCH] msmtpq: Add --enqueue option

---
 scripts/msmtpq/msmtpq | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/scripts/msmtpq/msmtpq b/scripts/msmtpq/msmtpq
index fbf38f9..0f127f0 100755
--- a/scripts/msmtpq/msmtpq
+++ b/scripts/msmtpq/msmtpq
@@ -520,11 +520,22 @@ if [ ! "$1" = '--q-mgmt' ] ; then    # msmtpq - sendmail mode
   # write mail body text to queue .mail file
   cat > "${FQP}.mail" || \
     log -e "$?" "creating mail body file [ ${FQP}.mail ] : failed" # test for error
+  # remove first argument, when --engueue provided
+  if [ "$1" = '--enqueue' ] ; then
+    enqueue=t
+    shift
+  fi
   # write msmtp command line to queue .msmtp file
   echo "$@" > "${FQP}.msmtp" || \
     log -e "$?" "creating msmtp cmd line file { $* }"\
                 "           to [ ${ID}.msmtp ] : failed" # test for error
-  send_mail "$@"                     # send the mail if possible, queue it if not
+
+  if [ -n "$enqueue" ] ; then
+    enqueue_mail "$@"                # always enqueue the mail
+  else
+    send_mail "$@"                   # send the mail if possible, queue it if not
+  fi
+
   lock_queue -u                      # unlock here
 else                                 # msmtp-queue - queue management mode
   shift                              # trim off first (--q-mgmt) arg
-- 
2.32.0


debug log:

solving 275ea6d04c ...
found 275ea6d04c in https://yhetil.org/guix/877dhzzstl.fsf@trop.in/

applying [1/1] https://yhetil.org/guix/877dhzzstl.fsf@trop.in/
diff --git a/gnu/packages/patches/msmtpq-add-enqueue-option.patch b/gnu/packages/patches/msmtpq-add-enqueue-option.patch
new file mode 100644
index 0000000000..275ea6d04c

1:44: trailing whitespace.
-- 
Checking patch gnu/packages/patches/msmtpq-add-enqueue-option.patch...
1:46: new blank line at EOF.
+
Applied patch gnu/packages/patches/msmtpq-add-enqueue-option.patch cleanly.
warning: 2 lines add whitespace errors.

index at:
100644 275ea6d04cb372c47ebe5a2ef0c5bddaa300dfb6	gnu/packages/patches/msmtpq-add-enqueue-option.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.