Skip to contentSkip to conversation

b4: Fix envelopeSender handling

PATCH Applied Maxime Ripard 2 participants 2 messages Jun 2, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 b4: Fix envelopeSender handling

The manpage for git-send-email states that:

Specify the envelope sender used to send the emails. This is useful if your default address is not the address that is subscribed to a list. In order to use the From address, set the value to "auto". If you use the sendmail binary, you must have suitable privileges for the -f parameter. Default is the value of the sendemail.envelopeSender configuration variable; if that is unspecified, choosing the envelope sender is left to your MTA.

However, b4 just reuses the value of sendemail.envelopeSender and passes it down directly to the sendmail binary if relevant, which means that if we were using the value "auto", we now have sendemail called with -f auto instead of the proper mail address, confusing sendmail.

We can fix this by interpreting the auto value as suggested in the manpage.

---
 b4/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
b4/__init__.py +4 -1
index 0197cf17ed33..9b1f69c9ff7b 100644
@@ -3247,7 +3247,10 @@ def get_smtp(dryrun: bool = False) -> Tuple[Union[smtplib.SMTP, smtplib.SMTP_SSL
         # Do we have the envelopesender defined?
         env_sender = sconfig.get('envelopesender', '')
         if env_sender:
-            envpair = email.utils.parseaddr(env_sender)
+            if env_sender == "auto":
+                envpair = email.utils.parseaddr(fromaddr)
+            else:
+                envpair = email.utils.parseaddr(env_sender)
         else:
             envpair = email.utils.parseaddr(fromaddr)
         if envpair[1]:
Signature · 1 line
2.40.1
#1 lore raw
Quoted 11 lines · Maxime Ripard

The manpage for git-send-email states that:

Specify the envelope sender used to send the emails. This is useful if your default address is not the address that is subscribed to a list. In order to use the From address, set the value to "auto". If you use the sendmail binary, you must have suitable privileges for the -f parameter. Default is the value of the sendemail.envelopeSender configuration variable; if that is unspecified, choosing the envelope sender is left to your MTA.

[...]

Applied, thanks!

[1/1] b4: Fix envelopeSender handling

      commit: c6835b7538331fc84b3743f57812181acd71dab6

Best regards,

Signature · 1 line
Konstantin Ryabitsev <[email protected]>