summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-10-25 15:32:37 +0200
committerAlejandro Colomar <alx@kernel.org>2023-11-13 13:06:04 +0100
commit8a6a618b719f98fc4815faae5d58ede6f24e6395 (patch)
tree248a457000e232b75428f1ba455960262741c507
parent757ca3b39eaee9c3c5b462c160b66e334cafa7c4 (diff)
send.c: Allow crypto operations in batch and mailx modes.crypto
This is useful for signing patches with git-send-email(1). Here's a working configuration for that: In <~/.gitconfig>, add this section: [sendemail] sendmailcmd = mutt -H - && true After this patch, all patches sent with git-send-mail(1) will be signed (and even encrypted, if we have the public keys of all recipients and have enabled encryption when possible). This is breaking behavior, so it needs some more justification than just the above. This wasn't possible at all with mutt, and is a quite basic operation. With current mutt(1), you'd need to do trickery with mailboxes to be able to open patches with mutt in interactive mode and sign/encrypt them. One could say don't use git-send-email(1), but then you still need to open mutt(1) interactively for sending signed mail. It is very useful to be able to send a long series of patches or any other mail without interaction, and have it all signed. The reason for not enabling this was for allowing running mutt(1) in cron jobs, or other cases where the keyring can't be unlocked. This would still be possible after this patch, although it would need a change in the configuration. Users should have a different configuration for such cron jobs that doesn't ask mutt(1) to use PGP. Link: <https://github.com/neomutt/neomutt/issues/1471> Link: <https://github.com/neomutt/neomutt/pull/1476> Link: <https://lore.kernel.org/git/xmqqh6ltuqvq.fsf@gitster.g/T/> Co-developed-by: Jenya Sovetkin <e.sovetkin@gmail.com> Cc: <neomutt-devel@neomutt.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--send.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/send.c b/send.c
index 21ecf041..c98773fc 100644
--- a/send.c
+++ b/send.c
@@ -2248,13 +2248,11 @@ static int send_message_resume_first_edit (SEND_CONTEXT *sctx)
* 2) pgp: header field was present during message editing with $edit_headers (sctx->msg->security != 0)
* 3) we are resending a message
* 4) we are recalling a postponed message (don't override the user's saved settings)
- * 5) we are in mailx mode
- * 6) we are in batch mode
*
* This is done after allowing the user to edit the message so that security
* settings can be configured with send2-hook and $edit_headers.
*/
- if (WithCrypto && (sctx->msg->security == 0) && !(sctx->flags & (SENDBATCH | SENDMAILX | SENDPOSTPONED | SENDRESEND)))
+ if (WithCrypto && (sctx->msg->security == 0) && !(sctx->flags & (SENDPOSTPONED | SENDRESEND)))
{
if (
#ifdef USE_AUTOCRYPT