Bug 234095 - mail/mutt and mail/neomutt mail client can only decrypt with GPG1 but pkg only requires GPG2 as dependency
Summary: mail/mutt and mail/neomutt mail client can only decrypt with GPG1 but pkg onl...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-17 12:50 UTC by bugcatcher
Modified: 2019-02-06 13:22 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugcatcher 2018-12-17 12:50:46 UTC
Scenario: FreeBSD 12.0 release, just installed

Essentially, Mutt/Neomutt throws simple error messages, such as 'Could not copy message', when trying to decrypt a message in a mailbox, with only GPG2 installed.

As soon as 'gnupg1' package is installed, it is able to decrypt messages.

Unfortunately pkg required gpg2 as a dependency, which can create a confusing situation.

It took quite a while to solve this bug.
Firstly because the line "source /usr/share/doc/mutt/examples/gpg.rc" must be in muttrc, unlike Linux, for decryption to work.
Secondly because only Neomutt is compiled with debug options, whereas Mutt is compiled without debug options (but it does make sense, to keep one simple and one complex, as long as both are available). But once you have debug options enabled you can add verbose flags to modified GPG calls in your muttrc, and then get more fine grained understanding of the issue.
Comment 1 Derek Schrock 2018-12-18 02:30:56 UTC
Is there any reason you're not using gpgme with crypt_use_gpgme in your rc.  It's pretty much a single line config that replaces everything from gpg.rc.
Comment 2 Derek Schrock 2018-12-23 17:36:33 UTC
I'd still highly recommend using crypt_use_gpgme instead however.

Since gnupg 2.1 '--pinentry-mode loopback' is required when using --passphrase-fd.  Can you add this and see if it fixes your issue?

Either upstream needs so add this to contrib/gpg.rc to commands that use --passphrase-fd, or we need to patch it in at build time.

There are still some supported distros that install gnugp 2.0 so having upstream fix this might not be best until gnupg 2.1 is default.
Comment 3 bugcatcher 2019-02-06 13:22:20 UTC
Unfortunately I tried your suggestions but neither work, both continue to throw the "could not decrypt PGP message" and "could not copy message" error.

After reverting to the working config as mentioned in my original post, it only throws the above error messages when the GPG password input is wrong.