All of lore.kernel.org
 help / color / mirror / Atom feed
* b4 send crashes when sendemail from is missing
@ 2022-09-28  9:37 Neil Armstrong
  2022-09-28 13:56 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Armstrong @ 2022-09-28  9:37 UTC (permalink / raw)
  To: tools

Hi !

First, thanks for the b4 work !

I've finally tried the b4 prep/send feature and when doing the first send I got this crash:

$ b4 send --no-sign

Converted the branch to 7 patches

Populating To/Cc addresses

Will send the following messages:

---

To: <snip>

Cc: <snip>
---

   [PATCH v1 0/7] <snip>
---

Press Enter to send or Ctrl-C to abort

Connecting to smtp.gmail.com:587

---

   [PATCH v1 0/7] <snip>
Traceback (most recent call last):

   File "/home/narmstrong/bin/b4", line 8, in <module>

     sys.exit(cmd())

   File "/home/narmstrong/.local/lib/python3.10/site-packages/b4/command.py", line 341, in cmd

     cmdargs.func(cmdargs)

   File "/home/narmstrong/.local/lib/python3.10/site-packages/b4/command.py", line 86, in cmd_send

     b4.ez.cmd_send(cmdargs)

   File "/home/narmstrong/.local/lib/python3.10/site-packages/b4/ez.py", line 1259, in cmd_send

     sent = b4.send_mail(smtp, send_msgs, fromaddr=fromaddr, destaddrs=alldests, patatt_sign=sign,

   File "/home/narmstrong/.local/lib/python3.10/site-packages/b4/__init__.py", line 3210, in send_mail

     smtp.sendmail(fromaddr, destaddrs, bdata)

   File "/usr/lib/python3.10/smtplib.py", line 881, in sendmail

     (code, resp) = self.mail(from_addr, esmtp_opts)

   File "/usr/lib/python3.10/smtplib.py", line 545, in mail

     self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender), optionlist))

   File "/usr/lib/python3.10/smtplib.py", line 154, in quoteaddr

     if addrstring.strip().startswith('<'):

AttributeError: 'NoneType' object has no attribute 'strip'


I figured the "from" field was missing from my gitconfig sendemail entry.

I checked and nowhere this "from" is required for git-send-email, perhaps get user.email or sendemail.smtpuser as fallback ?

Neil
-- 
Neil Armstrong <neil.armstrong@linaro.org>
Senior Software Engineer - Linaro Developer Services
https://linaro.org/services

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

* Re: b4 send crashes when sendemail from is missing
  2022-09-28  9:37 b4 send crashes when sendemail from is missing Neil Armstrong
@ 2022-09-28 13:56 ` Konstantin Ryabitsev
  2022-09-29  8:43   ` Neil Armstrong
  0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Ryabitsev @ 2022-09-28 13:56 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: tools

On Wed, Sep 28, 2022 at 11:37:45AM +0200, Neil Armstrong wrote:
> Hi !
> 
> First, thanks for the b4 work !
> I've finally tried the b4 prep/send feature and when doing the first send I got this crash:
> 
> $ b4 send --no-sign

Or, you know, you can just sign things. ;)

> I figured the "from" field was missing from my gitconfig sendemail entry.
> 
> I checked and nowhere this "from" is required for git-send-email, perhaps get user.email or sendemail.smtpuser as fallback ?

Yes, the latest master/stable-0.10.y will fall back to user.email if
sendemail.from is not set. Thank you for the report.

-K

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

* Re: b4 send crashes when sendemail from is missing
  2022-09-28 13:56 ` Konstantin Ryabitsev
@ 2022-09-29  8:43   ` Neil Armstrong
  2022-09-29 15:05     ` Konstantin Ryabitsev
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Armstrong @ 2022-09-29  8:43 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools

On 28/09/2022 15:56, Konstantin Ryabitsev wrote:
> On Wed, Sep 28, 2022 at 11:37:45AM +0200, Neil Armstrong wrote:
>> Hi !
>>
>> First, thanks for the b4 work !
>> I've finally tried the b4 prep/send feature and when doing the first send I got this crash:
>>
>> $ b4 send --no-sign
> 
> Or, you know, you can just sign things. ;)

It also crashed without a comprehensive error, I need to debug why!

Converted the branch to 7 patches

Populating To/Cc addresses

Will write out messages into <snip>

Traceback (most recent call last):

   File "/home/narmstrong/bin/b4", line 8, in <module>

     sys.exit(cmd())

   File "/home/narmstrong/.local/lib/python3.10/site-packages/b4/command.py", line 341, in cmd

     cmdargs.func(cmdargs)

   File "/home/narmstrong/.local/lib/python3.10/site-packages/b4/command.py", line 86, in cmd_send

     b4.ez.cmd_send(cmdargs)

   File "/home/narmstrong/.local/lib/python3.10/site-packages/b4/ez.py", line 1259, in cmd_send

     sent = b4.send_mail(smtp, send_msgs, fromaddr=fromaddr, destaddrs=alldests, patatt_sign=sign,

   File "/home/narmstrong/.local/lib/python3.10/site-packages/b4/__init__.py", line 3145, in send_mail

     bdata = patatt.rfc2822_sign(bdata)

   File "/home/narmstrong/.local/lib/python3.10/site-packages/patatt/__init__.py", line 1002, in rfc2822_sign

     pm.sign(algo, keydata, identity=config.get('identity'), selector=config.get('selector'))

   File "/home/narmstrong/.local/lib/python3.10/site-packages/patatt/__init__.py", line 569, in sign

     hv, pkinfo = ds.sign(keyinfo)

   File "/home/narmstrong/.local/lib/python3.10/site-packages/patatt/__init__.py", line 264, in sign

     bval, pkinfo = DevsigHeader._sign_openpgp(digest, keyinfo)

   File "/home/narmstrong/.local/lib/python3.10/site-packages/patatt/__init__.py", line 366, in _sign_openpgp

     raise SigningError('Running gpg failed', errors=err.decode().split('\n'))

patatt.SigningError: Running gpg failed

> 
>> I figured the "from" field was missing from my gitconfig sendemail entry.
>>
>> I checked and nowhere this "from" is required for git-send-email, perhaps get user.email or sendemail.smtpuser as fallback ?
> 
> Yes, the latest master/stable-0.10.y will fall back to user.email if
> sendemail.from is not set. Thank you for the report.

Great, thanks !

> 
> -K

Neil

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

* Re: b4 send crashes when sendemail from is missing
  2022-09-29  8:43   ` Neil Armstrong
@ 2022-09-29 15:05     ` Konstantin Ryabitsev
  0 siblings, 0 replies; 4+ messages in thread
From: Konstantin Ryabitsev @ 2022-09-29 15:05 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: tools

On Thu, Sep 29, 2022 at 10:43:55AM +0200, Neil Armstrong wrote:
>   File "/home/narmstrong/.local/lib/python3.10/site-packages/patatt/__init__.py", line 366, in _sign_openpgp
>     raise SigningError('Running gpg failed', errors=err.decode().split('\n'))
> 
> patatt.SigningError: Running gpg failed

Can you run:

    git format-patch -1 --stdout | patatt -d sign 2>/tmp/debug

/tmp/debug should contain the command it's trying to run to PGP-sign things,
e.g. for me:

    Running gpg --batch --no-auto-key-retrieve --no-auto-check-trustdb -s -u B6C41CE35664996C!

That should help troubleshoot what's failing.

-K

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

end of thread, other threads:[~2022-09-29 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28  9:37 b4 send crashes when sendemail from is missing Neil Armstrong
2022-09-28 13:56 ` Konstantin Ryabitsev
2022-09-29  8:43   ` Neil Armstrong
2022-09-29 15:05     ` Konstantin Ryabitsev

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.