From patchwork Thu Sep 14 10:43:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: pinoaffe X-Patchwork-Id: 53904 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C349427BBE2; Thu, 14 Sep 2023 11:44:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 86EF727BBE9 for ; Thu, 14 Sep 2023 11:44:24 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgjpL-0001gQ-T0; Thu, 14 Sep 2023 06:44:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qgjpF-0001g9-9T for guix-patches@gnu.org; Thu, 14 Sep 2023 06:43:57 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgjpF-00076z-24 for guix-patches@gnu.org; Thu, 14 Sep 2023 06:43:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qgjpK-0004fc-Nk for guix-patches@gnu.org; Thu, 14 Sep 2023 06:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65976] [PATCH 3/3] gnu: Add mailctl. References: <874jjxhwbi.fsf@gmail.com> In-Reply-To: <874jjxhwbi.fsf@gmail.com> Resent-From: pinoaffe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 Sep 2023 10:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65976 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65976@debbugs.gnu.org Received: via spool by 65976-submit@debbugs.gnu.org id=B65976.169468822317912 (code B ref 65976); Thu, 14 Sep 2023 10:44:02 +0000 Received: (at 65976) by debbugs.gnu.org; 14 Sep 2023 10:43:43 +0000 Received: from localhost ([127.0.0.1]:37774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgjp1-0004eo-64 for submit@debbugs.gnu.org; Thu, 14 Sep 2023 06:43:43 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:60642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgjoy-0004eb-57 for 65976@debbugs.gnu.org; Thu, 14 Sep 2023 06:43:42 -0400 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-522bd411679so944960a12.0 for <65976@debbugs.gnu.org>; Thu, 14 Sep 2023 03:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694688208; x=1695293008; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:user-agent:from:to:cc:subject:date:message-id:reply-to; bh=uMP6uCAagFQ3twfXDOE5/BhSx3uh0STW1n1Mxsf4kNA=; b=Cj8g3N2zjqFk+9Qopnccpbz9r5fpMufoAFJAQscGxJ5me93PqPYm1QXN3zDPH9UHGG 6Ue9I9X3X84eGkdu2DaXQqNEjxl44iO+Xn5Eh7Lwr5S5DBkqM+3q0JMYl1De6cf8RbTi bvQx21qBpyo2OnXbfms2PHleyTxXancWlGsql7aNJTOj06lVl/uNFKo0q8QDtD+2G7Le 0LPK4hq7XBtRzUaM1duX/NoHDNDmT/7wQBYbr3k4R7DW+HrNAYRJochDescxkhSydK5Z vEJ/PrG48y598LMR8eVIxcvziy/jUzWSqqdDIUvH0AhgVGokG5SJGpu69KgngO36jsl1 giHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694688208; x=1695293008; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:user-agent:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uMP6uCAagFQ3twfXDOE5/BhSx3uh0STW1n1Mxsf4kNA=; b=SGzNvJTPuEOcimQ9JeZRSpQ9Gk60r8rXME2FHdtvlhcX52/PfXjFL1Z7WDHWovwW/h tPTe5qUIVQRAg967Nts3UoxIaFR7Ya2bRlixJwkmTpNuStCxPuSkxDA6E6ZEF4VrDfP2 Ww3jIpSupRCtAlggPE0a8ohc3eOT+NS7f1P9sQ6ye20utMBLOjjD/0C0BJGSvKpYLJ3P lOv+tBIZ1jMMUThaYxG3ASr/bD2/xqsrDp/1MvLLI3/BV3ipBWrO2/PG5+FrcYq6/0bu qt11reKC3vCGp7aazMevQJHu7+Kt24UK5RerjjpN8fyebq7xyn03Ls6p1nVPxV3FyPuQ e65A== X-Gm-Message-State: AOJu0Yyb5i75IwZc7b97v7Wfwo/d9bvOPnT5qnFobKXQt4/tUAs1Jv0N W1thTn3zycUnqobwzpPnKlxHg808Ifo= X-Google-Smtp-Source: AGHT+IEObkXIeJVQTqYpEmMdvEQqUgqN1awRx5U1Kqb6DzmdFtZIBzjADRbdHeH09jzgUFaeEK24sw== X-Received: by 2002:a17:907:a056:b0:9a5:ca42:f3a9 with SMTP id gz22-20020a170907a05600b009a5ca42f3a9mr3490920ejc.2.1694688208266; Thu, 14 Sep 2023 03:43:28 -0700 (PDT) Received: from localhost (ip-145-102-29-131.wlan-ext.ru.nl. [145.102.29.131]) by smtp.gmail.com with ESMTPSA id rh1-20020a17090720e100b009ad8ba6976bsm832685ejb.9.2023.09.14.03.43.27 for <65976@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 03:43:28 -0700 (PDT) User-agent: mu4e 1.10.5; emacs 28.2 From: pinoaffe Date: Thu, 14 Sep 2023 12:43:04 +0200 Message-ID: <87v8cdghm8.fsf@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/mail.scm (mailctl): New variable. --- gnu/packages/mail.scm | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index ecaab1c7cd..a64da6a328 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -52,6 +52,7 @@ ;;; Copyright © 2022 jgart ;;; Copyright © 2022 ( ;;; Copyright © 2023 Timo Wilken +;;; Copyright © 2023 pinoaffe ;;; ;;; This file is part of GNU Guix. ;;; @@ -112,6 +113,7 @@ (define-module (gnu packages mail) #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) #:use-module (gnu packages haskell-xyz) + #:use-module (gnu packages haskell-web) #:use-module (gnu packages icu4c) #:use-module (gnu packages kerberos) #:use-module (gnu packages language) @@ -176,6 +178,7 @@ (define-module (gnu packages mail) #:use-module (guix build-system gnu) #:use-module (guix build-system go) #:use-module (guix build-system guile) + #:use-module (guix build-system haskell) #:use-module (guix build-system meson) #:use-module (guix build-system perl) #:use-module (guix build-system pyproject) @@ -1145,6 +1148,59 @@ (define-public offlineimap3 (define-public offlineimap (deprecated-package "offlineimap" offlineimap3)) +(define-public mailctl + (package + (name "mailctl") + (version "0.8.8") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pdobsan/mailctl") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0zj1hcipb4d42rq3xl9qdx0ra94xlz6572y35m7f9bgkc35plnv8")))) + (build-system haskell-build-system) + (home-page "https://github.com/pdobsan/mailctl") + (arguments `(#:phases (modify-phases %standard-phases + ;; The mailctl.cabal file specifies a minimum cabal + ;; version of 3.8 (which is newer than the cabal + ;; packaged in guix), but doesn't use any new + ;; features and it builds with 3.6. + (add-after 'unpack 'patch-cabal-version + (lambda _ + (substitute* "mailctl.cabal" + (("3.8") "3.6"))))))) + (inputs (list ghc-aeson + ghc-hsyslog + ghc-http-conduit + ghc-network-uri + ghc-optparse-applicative + ghc-pretty-simple + ghc-twain + ghc-utf8-string + ghc-warp + ghc-yaml)) + (synopsis "Authorize and renew OAuth2 credentials for IMAP/SMTP clients") + (description "@code{mailctl} provides IMAP/SMTP clients with the +capabilities of renewal and authorization of OAuth2 credentials. + +Many IMAP/SMTP clients, like @code{offlineimap}, @code{msmtp}, @code{fdm}, +@code{isync}, @code{neomutt} or @code{mutt} can use OAuth2 access tokens but +lack the ability to renew and/or authorize OAuth2 credentials. The purpose of +@code{mailctl} is to provide these missing capabilities by acting as a kind of +smart password manager. In particular, access token renewal happens +automatically in the background transparent to the user. + +If an IMAP/SMTP client cannot use an OAuth2 access token itself it may be +\"wrapped\" with @code{fdm} and @code{msmtp} with the help of @code{mailctl}. + +@code{mailctl} also has some functionalities to manage the orchestration of a +mailing system comprised of @code{msmtp}, @code{fdm}, and @code{mutt} or +similar ones.") + (license license:bsd-3))) + (define-public emacs-mew (let ((commit "35772ee0b44dd7e56b0f3899b27fa545b2bc6f03") (revision "1"))