How to use git-credential-gopass with git send-email?

46 views Asked by At

I'm starting to now contribute to projects on sr.ht which typically uses git send-email as part of the workflow.

I read the gitcredentials and git-send-email. I saw Setting up gitconfig smtppass as passcmd and it seems there they used a custom helper, but that shouldn't necessary if one exists like the credential-helpers like git-credential-gopass?

This is what I have:

[sendemail]
    smtpserver = example.com
    smtpuser = [email protected]
    smtpencryption = ssl
    smtpserverport = 465

[credential "smtp://example.com:465"]
    username = [email protected]
    helper = gopass mail/example_email

I added this to my global config, password is normally returned when I type gopass mail/example_email. I want to avoid that annoying:

Password for 'smtp://[email protected]@example.com:465'

Prompt every time I try to send a patch.

1

There are 1 answers

0
dogman On

So you need to have only the username under smtpuser even if you'd normally authenticate with [email protected] otherwise what you'll get is [email protected]@example.com

[sendemail]
    smtpserver = example.com
    smtpuser = username
    smtpencryption = ssl
    smtpserverport = 465

[credential "smtp://[email protected]:465"]
    helper = gopass

Secondly the path needs to be:

.../gopass/stores/root/git/example.com_465/username.gpg