GPGME adapter provides OpenPGP-compliant cryptography via GnuPG Made Easy library.


This adapter requries two additional pieces of software to be installed:

  1. GnuPG, version 2.2

  2. gpgme gem


Following adapter-specific options are supported:


Optional. User id or e-mail which identifies key which will be used for message signing. By default, first address from mail’s From field is used.


Optional. Password for signer’s key. Must be a string.

Non-standard home directory location

GnuPG home directory is a place where configuration, keyrings, etc. are stored. By default, GnuPG home directory is located in $HOME/.gnupg. You can change it in a following way:

::GPGME::Engine.home_dir = 'path/to/home_dir'

Be advised that this setting is global. Hence, if you use GPGME outside EnMail as well, your other logic will be affected. One possible workaround is to sign e-mails in a different process. This should be fairly easy to achieve in Rails, as mailing is often handed to some kind of background job processor which runs in its own process. Nevertheless, consider switching to RNP adapter if this limitation poses a problem.

Using gpg.conf

GPGME API accepts little configuration options. Instead, it reads preferences from a gpg.conf file located in GnuPG home directory (usually $HOME/.gnupg). You may override defaults there, i.e. set preferred keys or algorithms. Refer to GnuPG documentation for more information about configuration files, or for list of available options. Also, you will find some nice example gpg.conf in this Stack Overflow answer.

Native extensions

The gpgme gem includes C extensions.

Issue tracker

Bugs, feature requests, and other issues are tracked with adapter: gpgme label: