From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +OKMKXaLmGHe7AAAgWs5BA (envelope-from ) for ; Sat, 20 Nov 2021 06:45:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id oGIjJXaLmGGHcgAAbx9fmQ (envelope-from ) for ; Sat, 20 Nov 2021 05:45:26 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 23AA92D9F9 for ; Sat, 20 Nov 2021 06:45:26 +0100 (CET) Received: from localhost ([::1]:60214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moJBl-00058l-82 for larch@yhetil.org; Sat, 20 Nov 2021 00:45:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moJBP-0004rG-4y for guix-patches@gnu.org; Sat, 20 Nov 2021 00:45:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58039) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moJBO-0005AK-Qz for guix-patches@gnu.org; Sat, 20 Nov 2021 00:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moJBO-0001ZW-He; Sat, 20 Nov 2021 00:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51853] [PATCH v2 2/2] gnu: sendgmail: Don't limit domain name of sender. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: liliana.prikler@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 20 Nov 2021 05:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51853 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51853@debbugs.gnu.org Cc: Liliana Marie Prikler X-Debbugs-Original-Xcc: Liliana Marie Prikler Received: via spool by 51853-submit@debbugs.gnu.org id=B51853.16373870525940 (code B ref 51853); Sat, 20 Nov 2021 05:45:02 +0000 Received: (at 51853) by debbugs.gnu.org; 20 Nov 2021 05:44:12 +0000 Received: from localhost ([127.0.0.1]:41347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moJAZ-0001Xh-HI for submit@debbugs.gnu.org; Sat, 20 Nov 2021 00:44:12 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:42860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moJAR-0001WY-C0 for 51853@debbugs.gnu.org; Sat, 20 Nov 2021 00:44:07 -0500 Received: by mail-qv1-f52.google.com with SMTP id b17so8597477qvl.9 for <51853@debbugs.gnu.org>; Fri, 19 Nov 2021 21:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=J0Zultn0qe0Xj3ri4qYYoM1sS+pFiWAsoy5MM/Rzdq0=; b=YKNr5EE+vr6uwxjIn24yn0CGau1IRTo3SMWN37BgVPCgbfpDRX4etskQbGSgig0tC4 b6NRh9y8zy+qafth5e71F6oNxd4qabk3dyfeBWK4gkrBZvU6a4+wKq9XPx2HEWtLQLOa UGfMtDmcb12tCQYS3rGbsVi/OtiiJfjg+RznNEKUQi2kwI3ZQykHoSQ4o/nUWB88eVfw QkAxaVFX1HW+IBUnG66kLcidTiUJIaUEDYm72vxZvke+40BnN8mR8u87V21hNvEB/w55 JNi8smC8NHZXyBl03SfTjngeRYAFb19QPNMksqMZCf+b4J/o8sbcy6H62c1XK0Aek3zN FXyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J0Zultn0qe0Xj3ri4qYYoM1sS+pFiWAsoy5MM/Rzdq0=; b=cHWGoUJZyKvC5killVsql3i+t+1ze0V7EoQKnrq3gCg9LT6OGkJYmNlqhKxEnaoUCb Xr3Qos7C1nczYpMewTkq80UgkjkcOSdxtd51ardyArZaj3OW3JpDnrYSwIVlV5mXOPhn 03kCE+cNEloHd1E8WYP5jiJTU75qe+WhdJrn8DUqLwFG8EYsddR4wpEguitdXq5iuol/ IrwmJDmJbqjun/oUdLXP3LXz4Wqwe3jScNuZWao4Tjjx6zUSkzfD9cXomX5x4dH+45u0 QReexub/D7p90VU2wWsY/7YXiV7FUo+DFJdxbMfax+3jaR0Jy3AxEU0K3vpMEmkW0yns KgPg== X-Gm-Message-State: AOAM530/eoSn7iZJXkmV8SCuAG7NvyU4CtEsq+Y07+Zd9BLfBz+EQwcv TZTUKSP9BsCXy35MJFmtQi2mXMXtdOutdG4w X-Google-Smtp-Source: ABdhPJwvcpEK+ALhOlTGDdy+jGWLE7MMIKb/REyC4YXLq+ev5pMLjMOyAHXy0OaiVvXj7D1fMTEVzw== X-Received: by 2002:a05:6214:300b:: with SMTP id ke11mr80091092qvb.42.1637387037710; Fri, 19 Nov 2021 21:43:57 -0800 (PST) Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242]) by smtp.gmail.com with ESMTPSA id s12sm992444qtk.61.2021.11.19.21.43.57 for <51853@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Nov 2021 21:43:57 -0800 (PST) From: Philip McGrath Date: Sat, 20 Nov 2021 00:43:53 -0500 Message-Id: <20211120054353.987243-3-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211120054353.987243-1-philip@philipmcgrath.com> References: <077cf4ed09eab394f74bb87600e7442525143a53.camel@gmail.com> <20211120054353.987243-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637387126; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=J0Zultn0qe0Xj3ri4qYYoM1sS+pFiWAsoy5MM/Rzdq0=; b=Lm2M3rGkHkT3f+F7UBkjwstSIl/auE4a1/cqTtPJRchR7jGattYH6+BsFxZpd8nZO5mhC9 f+TM+VGj8IxWyBs0nJFrn5MPcqgi2XeWQY3Fn4BVhsr13kPLlYQI3Fm+EJ6ZI++ppg2IcD amtdKq66fNd7Elwa1q+CfPf/ea3vFtnw+Fl2Fw1cjQGAkIZWLMYZPNYXGRdWFg4za29eMN BhOifbsyvTWMoPv5oc+e6yHb0ULeMbsb9b13/2zXx30I5I1V2zxVg9GvZnAjb/cEcDoCkO 54rPbjNFufNxJb00ktGC0JNFD+K3SJpJ/LyjFbW5gs+DP8YW5pYVuZvLesP+KA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637387126; a=rsa-sha256; cv=none; b=k/7Rc3UUZY3AIoU4Hp1OB+9EcYRZj4bwf5lsihbrKAkkJCEePTPag0Te9za6a5Capwe8pI rLtYkgXp7vDg+9kdXoC4NPjXnAs5ZR1GwAitbqVWfpYJ2CVDVBbfr8MVKI9K7N0cWs+rDX Ehxw0UycsYerD1Zt9bKPV7JSsC7cJi731Z/J7F4m0mkQur0lEYTcd4QMb4VpUnGAL+vV8E l29DoANI0r7QkuUN9gvxCZYxpWEOZ2/T3lJZWgzaoCUDUGTwBhXqFSTQyDkMPJpxUfHYex 4dFhu8ZGjnN/VSfnL7WpCw/qc7u9MrCVvtNCREcNwaKg/0hvSam/dwaL2NF7/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=YKNr5EE+; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.37 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=YKNr5EE+; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 23AA92D9F9 X-Spam-Score: -0.37 X-Migadu-Scanner: scn0.migadu.com X-TUID: McUM45BaUfRg There are three open pull requests adding this functionality: - https://github.com/google/gmail-oauth2-tools/pull/17 (October 2019) - https://github.com/google/gmail-oauth2-tools/pull/26 (May 2020) - https://github.com/google/gmail-oauth2-tools/pull/37 (May 2021) (The patch here is identical to #26, so I just closed this one.) Meanwhile, the most recent commit to the upstream repository was in May 2019: that was the commit that first added `sendgmail`. This commit adjusts Guix's `sendgmail`, following Postel's advice, to make the command "liberal in its receiving behavior" (RFC 760): it always accepts email addresses with any domain name, as in #26, and it accepts (and ignores) the `-gsuite` flag used in #17. * gnu/packages/patches/sendgmail-remove-domain-restriction.patch: New file. This is the patch from #26. * gnu/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch: New file, based on #17. * gnu/local.mk (dist_patch_DATA): Add the new patches. * gnu/packages/mail.scm (sendgmail)[source]: Apply the new patches. Increment the "revision" argument to `git-version` from 0 to 1. --- gnu/local.mk | 2 + gnu/packages/mail.scm | 11 +++++- ...sendgmail-accept-ignored-gsuite-flag.patch | 39 +++++++++++++++++++ .../sendgmail-remove-domain-restriction.patch | 34 ++++++++++++++++ 4 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch create mode 100644 gnu/packages/patches/sendgmail-remove-domain-restriction.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7cc06c8212..9f57e3004e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1757,6 +1757,8 @@ dist_patch_DATA = \ %D%/packages/patches/screen-hurd-path-max.patch \ %D%/packages/patches/sdl-libx11-1.6.patch \ %D%/packages/patches/seed-webkit.patch \ + %D%/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch \ + %D%/packages/patches/sendgmail-remove-domain-restriction.patch \ %D%/packages/patches/seq24-rename-mutex.patch \ %D%/packages/patches/serf-python3.patch \ %D%/packages/patches/shakespeare-spl-fix-grammar.patch \ diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 891a163f0f..579c4b9328 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -4646,7 +4646,7 @@ (define-public rss2email (define-public sendgmail (let ((commit "e3229155a4037267ce40f1a3a681f53221aa4d8d") - (revision "0")) + (revision "1")) (package (name "sendgmail") (version (git-version "0.0.0" revision commit)) @@ -4657,6 +4657,9 @@ (define-public sendgmail (url "https://github.com/google/gmail-oauth2-tools") (commit commit))) (file-name (git-file-name name version)) + (patches (search-patches + "sendgmail-remove-domain-restriction.patch" + "sendgmail-accept-ignored-gsuite-flag.patch")) (sha256 (base32 "1cxpkiaajhq1gjsg47r2b5xgck0r63pvkyrkm7af8c8dw7fyn64f")))) @@ -4676,5 +4679,9 @@ (define-public sendgmail "The @command{sendgmail} command provides a minimal sendmail-compatible front-end that connects to Gmail using OAuth2. It is specifically designed for use with @code{git send-email}. The command needs a Gmail API key to -function.") +function. + +Guix's version of @command{sendgmail} has been patched for compatibility with +all known forks, including support for non-@code{@@gmail.com} email +addresses.") (license license:asl2.0)))) diff --git a/gnu/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch b/gnu/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch new file mode 100644 index 0000000000..8405ff4e42 --- /dev/null +++ b/gnu/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch @@ -0,0 +1,39 @@ +From 854490dc4a8a6a661b4750730c3ff749519f6e36 Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Sun, 14 Nov 2021 10:14:24 -0500 +Subject: [PATCH] sendgmail: accept and ignore a "-gsuite" flag + +Accepting a "-gsuite" flag provides compatability with +https://github.com/Flameeyes/gmail-oauth2-tools/commit/eabb456 +so users do not have to change their scripts or config files. + +Full hash of original: eabb45608ff4ce04045ff4ea92d05450e789ac81 + +Related to https://github.com/google/gmail-oauth2-tools/pull/17 +--- + go/sendgmail/main.go | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/go/sendgmail/main.go b/go/sendgmail/main.go +index 405aa1b..5cfd0c1 100644 +--- a/go/sendgmail/main.go ++++ b/go/sendgmail/main.go +@@ -40,6 +40,7 @@ var ( + setUp bool + dummyF string + dummyI bool ++ gsuite bool + ) + + func init() { +@@ -47,6 +48,7 @@ func init() { + flag.BoolVar(&setUp, "setup", false, "If true, sendgmail sets up the sender's OAuth2 token and then exits.") + flag.StringVar(&dummyF, "f", "", "Dummy flag for compatibility with sendmail.") + flag.BoolVar(&dummyI, "i", true, "Dummy flag for compatibility with sendmail.") ++ flag.BoolVar(&gsuite, "gsuite", true, "Dummy flag for compatibility with other forks of sendgmail.") + } + + func main() { +-- +2.32.0 + diff --git a/gnu/packages/patches/sendgmail-remove-domain-restriction.patch b/gnu/packages/patches/sendgmail-remove-domain-restriction.patch new file mode 100644 index 0000000000..d23af33375 --- /dev/null +++ b/gnu/packages/patches/sendgmail-remove-domain-restriction.patch @@ -0,0 +1,34 @@ +From a5ecd1b2302d0def2f6f8349747022a615a9f017 Mon Sep 17 00:00:00 2001 +From: Tamas K Lengyel +Date: Tue, 26 May 2020 13:27:50 -0600 +Subject: [PATCH] Don't limit to email with @gmail.com + +--- + go/sendgmail/main.go | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/go/sendgmail/main.go b/go/sendgmail/main.go +index b35ef23..405aa1b 100644 +--- a/go/sendgmail/main.go ++++ b/go/sendgmail/main.go +@@ -30,7 +30,6 @@ import ( + "log" + "net/smtp" + "os" +- "strings" + + "golang.org/x/oauth2" + googleOAuth2 "golang.org/x/oauth2/google" +@@ -52,9 +51,6 @@ func init() { + + func main() { + flag.Parse() +- if atDomain := "@gmail.com"; !strings.HasSuffix(sender, atDomain) { +- log.Fatalf("-sender must specify an %v email address.", atDomain) +- } + config := getConfig() + tokenPath := fmt.Sprintf("%v/.sendgmail.%v.json", os.Getenv("HOME"), sender) + if setUp { +-- +2.32.0 + -- 2.32.0