~rjarry/aerc-discuss

10 4

gpg with aerc

Details
Message ID
<CQV3Z9HSBXYA.TWHHJYXFKUMA@portable-navi>
DKIM signature
pass
Download raw message
Hello,

thanks for aerc, it's amazing!

I'm having an issue with using gpg which might be a little unique:
The IMAP/SMTP account I use has different identities, e.g. private and
public (say, private@mail.com and public@mail.com both arrive at
private@mail.com), and sending is possible with both identities. The way
I've been using gpg is that for each identity I have a separate key
pair, the reason being that I don't necessarily want to sign/encrypt
private@mail.com with public@mail.com and vice-versa.

This wasn't an issue with neomutt, my previous MUA, as you can simply
select another key to use.
Is this possible for aerc somehow? It seems that `:sign` and `:encrypt`
(neither of which I can find in `aerc(1)`) both don't support specifying
a key.

Is there a way to make this work? Or maybe my way of using gpg is
non-standard and I should be using one key pair for both identities?

Thanks!

-- 
witcher
Details
Message ID
<CQV6N5OC3ME7.NRUBBDUF95EF@hades.moritz.sh>
In-Reply-To
<CQV3Z9HSBXYA.TWHHJYXFKUMA@portable-navi> (view parent)
DKIM signature
pass
Download raw message
On Wed Mar 1, 2023 at 3:25 PM CET, witcher wrote:
> (neither of which I can find in `aerc(1)`)
This is now tracked in https://todo.sr.ht/~rjarry/aerc/144

The gpg integration was largely done by Tim, so he might be able to help
you in finding a satisfactory solution.

-- 
Moritz Poldrack
https://moritz.sh
Details
Message ID
<CQV8F3VW03J5.1V206F6K82RFC@spunky>
In-Reply-To
<CQV3Z9HSBXYA.TWHHJYXFKUMA@portable-navi> (view parent)
DKIM signature
pass
Download raw message
On Wed Mar 1, 2023 at 8:25 AM CST, witcher wrote:
> Hello,
>
> thanks for aerc, it's amazing!
>
> I'm having an issue with using gpg which might be a little unique:
> The IMAP/SMTP account I use has different identities, e.g. private and
> public (say, private@mail.com and public@mail.com both arrive at
> private@mail.com), and sending is possible with both identities. The way
> I've been using gpg is that for each identity I have a separate key
> pair, the reason being that I don't necessarily want to sign/encrypt
> private@mail.com with public@mail.com and vice-versa.
>
> This wasn't an issue with neomutt, my previous MUA, as you can simply
> select another key to use.
> Is this possible for aerc somehow? It seems that `:sign` and `:encrypt`
> (neither of which I can find in `aerc(1)`) both don't support specifying
> a key.
>
> Is there a way to make this work? Or maybe my way of using gpg is
> non-standard and I should be using one key pair for both identities?

Hey -

This should work as you want if you don't set 'pgp-key-id' in your
config. As long as the From header is the email address you want to
encrypt from, aerc will run: 

	gpg --list-secret-keys <email>

in order to find which key to sign with.

-- 
Tim
Details
Message ID
<CQV9AR2FE16J.1QCOVQF0FUZLK@portable-navi>
In-Reply-To
<CQV8F3VW03J5.1V206F6K82RFC@spunky> (view parent)
DKIM signature
pass
Download raw message
> As long as the From header is the email address you want to
> encrypt from

That doesn't seem to work for me - neither
> "Real Name" <private@mail.com>
nor
> private@mail.com
in the From header makes aerc uses the key of "private@mail.com" for
signing.

My `accounts.conf` doesn't set `pgp-key-id`, but it sets `from` and
`aliases` to the public and private addresses respectively. Whenever I
send an email from private@mail.com I just change the `From` field to
that email address.
`pgp-opportunistic-encrypt` is set to `true`, if it matters.
Details
Message ID
<CQV9KPKE41TE.WEKVERBCAY3D@spunky>
In-Reply-To
<CQV9AR2FE16J.1QCOVQF0FUZLK@portable-navi> (view parent)
DKIM signature
pass
Download raw message
On Wed Mar 1, 2023 at 12:37 PM CST, witcher wrote:
> > As long as the From header is the email address you want to
> > encrypt from
>
> That doesn't seem to work for me - neither
> > "Real Name" <private@mail.com>
> nor
> > private@mail.com
> in the From header makes aerc uses the key of "private@mail.com" for
> signing.
>
> My `accounts.conf` doesn't set `pgp-key-id`, but it sets `from` and
> `aliases` to the public and private addresses respectively. Whenever I
> send an email from private@mail.com I just change the `From` field to
> that email address.
> `pgp-opportunistic-encrypt` is set to `true`, if it matters.

If you run `gpg --list-secret-keys private@mail.com`, do you get a
result?
Details
Message ID
<CQV9OPAN7GTB.3AFH75ZXBM8H1@portable-navi>
In-Reply-To
<CQV9KPKE41TE.WEKVERBCAY3D@spunky> (view parent)
DKIM signature
pass
Download raw message
> If you run `gpg --list-secret-keys private@mail.com`, do you get a
> result?

I do - I get the correct email with a different key id than
public@mail.com.
Details
Message ID
<CQVA7MMHT9EN.3RMAB8EWK6IS@portable-navi>
In-Reply-To
<CQV9OPAN7GTB.3AFH75ZXBM8H1@portable-navi> (view parent)
DKIM signature
pass
Download raw message
Wild guess: From a quick look at the code it seems like the `from` field
in `accounts.conf` is read, not the `From` header of the email:
widgets/compose.go +399
This could explain my issue.

I'm not familiar with the aerc codebase at all, so it might be I'm
wrong. Thought I'd mention it for the chance I'm not :)
Details
Message ID
<CQVY7GKFT9IM.27J46D6BZRFO3@ringo>
In-Reply-To
<CQVA7MMHT9EN.3RMAB8EWK6IS@portable-navi> (view parent)
DKIM signature
pass
Download raw message
witcher, Mar 01, 2023 at 20:11:
> Wild guess: From a quick look at the code it seems like the `from` field
> in `accounts.conf` is read, not the `From` header of the email:
> widgets/compose.go +399
> This could explain my issue.
>
> I'm not familiar with the aerc codebase at all, so it might be I'm
> wrong. Thought I'd mention it for the chance I'm not :)

Just a wild guess: can you ensure that you have the following:

    [general]
    pgp-provider = auto

or

    [general]
    pgp-provider = gpg

in ~/.config/aerc/aerc.conf ?
Details
Message ID
<CQVZ2MDK3ZPY.1PEUFXQALZBUR@portable-navi>
In-Reply-To
<CQVY7GKFT9IM.27J46D6BZRFO3@ringo> (view parent)
DKIM signature
pass
Download raw message
On Thu Mar 2, 2023 at 2:57 PM CET, Robin Jarry wrote:
> witcher, Mar 01, 2023 at 20:11:
> Just a wild guess: can you ensure that you have the following:
>
>     [general]
>     pgp-provider = auto
>
> or
>
>     [general]
>     pgp-provider = gpg
>
> in ~/.config/aerc/aerc.conf ?

I have the following set in ~/.config/aerc/aerc.conf:

    [general]
    pgp-provider=gpg
Details
Message ID
<CQVZ6FT005CN.N8L7MZ0X068H@spunky>
In-Reply-To
<CQVA7MMHT9EN.3RMAB8EWK6IS@portable-navi> (view parent)
DKIM signature
pass
Download raw message
On Wed Mar 1, 2023 at 1:11 PM CST, witcher wrote:
> Wild guess: From a quick look at the code it seems like the `from` field
> in `accounts.conf` is read, not the `From` header of the email:
> widgets/compose.go +399
> This could explain my issue.

Yeah, that's what is happening. This should be changed to pull the From
header. Would you be willing to work on a patch? I can give some
guidance if you need!

-- 
Tim
Details
Message ID
<CQVZDW7V5LDV.14QYPLQL61XI0@portable-navi>
In-Reply-To
<CQVZ6FT005CN.N8L7MZ0X068H@spunky> (view parent)
DKIM signature
pass
Download raw message
On Thu Mar 2, 2023 at 3:42 PM CET, Tim Culverhouse wrote:
> Would you be willing to work on a patch? I can give some guidance if
> you need!

Gladly! I'll have a look at it in the evening and will get back to you
if needed!
Reply to thread Export thread (mbox)