guix/gnu/packages/patches/sendgmail-remove-domain-restriction.patch
Philip McGrath 7c2d84df1c
gnu: sendgmail: Don't limit domain name of sender.
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.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-12-10 15:32:45 +01:00

35 lines
889 B
Diff

From a5ecd1b2302d0def2f6f8349747022a615a9f017 Mon Sep 17 00:00:00 2001
From: Tamas K Lengyel <tamas@tklengyel.com>
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