Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
* [PATCH b4] b4: fix from header not using real name
@ 2023-07-27 18:47 Justin Stitt
  2023-07-27 23:07 ` Justin Stitt
  2023-07-27 23:20 ` Kees Cook
  0 siblings, 2 replies; 18+ messages in thread
From: Justin Stitt @ 2023-07-27 18:47 UTC (permalink / raw)
  To: Kernel.org Tools
  Cc: Konstantin Ryabitsev, Nick Desaulniers, Kees Cook, Justin Stitt

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>


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-08-03 20:58 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27 18:47 [PATCH b4] b4: fix from header not using real name Justin Stitt
2023-07-27 23:07 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox