All of lore.kernel.org
 help / color / mirror / Atom feed
From: Justin Stitt <justinstitt@google.com>
To: "Kernel.org Tools" <tools@linux.kernel.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	 Nick Desaulniers <ndesaulniers@google.com>,
	Kees Cook <keescook@chromium.org>,
	 Justin Stitt <justinstitt@google.com>
Subject: [PATCH b4] b4: fix from header not using real name
Date: Thu, 27 Jul 2023 18:47:36 +0000	[thread overview]
Message-ID: <20230727-fix-from-header-v1-1-2fb23c0a5da9@google.com> (raw)

When using `b4 send` there seems to be an issue with the real name not
being included in the From: header.

Here's an example:
| From:	justinstitt@google.com

Whereas, something like the following is preferred:
| From: Justin Stitt <justinstitt@google.com>

This patch fixes this issue and achieves the preferred behavior (above)
by properly using both parts of a user's `from` field from their config.

A .gitconfig like this now properly works
| [sendemail]
|   from = Justin Stitt <justinstitt@google.com>

It should be noted that myself and Nick (reported this issue) use an
internal smtpserver called sendgmr. I'm not sure if this is a non-issue
on other smtpservers but the fix I've outlined in this patch looks
universal for locally-ran smtp commands.

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217332#c9
Signed-off-by: Justin Stitt <justinstitt@google.com>
---
 b4/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/b4/__init__.py b/b4/__init__.py
index b974642..760ba33 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -3259,7 +3259,7 @@ def get_smtp(dryrun: bool = False) -> Tuple[Union[smtplib.SMTP, smtplib.SMTP_SSL
         else:
             envpair = email.utils.parseaddr(fromaddr)
         if envpair[1]:
-            smtp += ['-f', envpair[1]]
+            smtp += ['-f', f"{envpair[0]} <{envpair[1]}>"]
         return smtp, fromaddr
 
     encryption = sconfig.get('smtpencryption')

---
base-commit: 099c9b47b39b6076752b8c757872080fad8fae56
change-id: 20230727-fix-from-header-c81940de575b

Best regards,
--
Justin Stitt <justinstitt@google.com>


             reply	other threads:[~2023-07-27 18:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 18:47 Justin Stitt [this message]
2023-07-27 23:07 ` [PATCH b4] b4: fix from header not using real name Justin Stitt
2023-07-27 23:20 ` Kees Cook
2023-08-01 16:12   ` Nick Desaulniers
2023-08-01 16:44     ` Kees Cook
2023-08-01 17:04       ` Konstantin Ryabitsev
2023-08-01 20:07         ` Justin Stitt
2023-08-01 22:25         ` Nick Desaulniers
2023-08-01 22:27           ` Justin Stitt
2023-08-01 22:34             ` Nick Desaulniers
2023-08-03 17:47             ` Nick Desaulniers
2023-08-03 17:51               ` Justin Stitt
2023-08-03 18:17               ` Konstantin Ryabitsev
2023-08-03 18:41                 ` Nick Desaulniers
2023-08-03 19:32                   ` Konstantin Ryabitsev
2023-08-03 20:58                     ` Nick Desaulniers
2023-08-03 18:41                 ` Justin Stitt
2023-08-01 22:20       ` Nick Desaulniers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230727-fix-from-header-v1-1-2fb23c0a5da9@google.com \
    --to=justinstitt@google.com \
    --cc=keescook@chromium.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=ndesaulniers@google.com \
    --cc=tools@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.