The function mc-encrypt
will encrypt a message in the current
buffer. mc-write-mode
binds this function to C-c / e by
default.
When this function is called, Mailcrypt will prompt you for a
comma-separated list of recipients. If called from a mail composition
buffer, the recipient list will default to the Email addresses in the
`To
', `CC
', and `BCC
' lines of the message.
If you want to be able to decrypt the message yourself, you need to add
yourself to the recipient list. If you always want to do so, set the
variable mc-encrypt-for-me
to t
. (Note that Mailcrypt
overrides the PGP "encrypttoself" flag; use this variable instead.)
If you provide an empty recipient list, Mailcrypt will ASCII-armor the message without encrypting it.
Once you have edited the recipient list to your satisfaction, type
RET
to accept it. You will then be asked whether you want
to sign the message; answer y or n. You can avoid this
question by setting the variable mc-pgp-always-sign
: A value of
t
means "yes", a value of 'never
means "no".
If you elect to sign the message, Mailcrypt will prompt you for the appropriate passphrase unless it is cached (see Passphrase Cache).
Mailcrypt will then pass the message to PGP for processing. Mailcrypt
will call the functions listed in mc-pre-encryption-hook
and
mc-post-encryption-hook
immediately before and after processing,
respectively. The encrypted message will then replace the original
message in the buffer. You can undo the encryption with the normal
Emacs undo command C-x u (see Emacs Undo).
If an error occurs, Mailcrypt will display an appropriate diagnostic. If you do not have the public key for one of the specified recipients, Mailcrypt will offer to try to fetch it for you (see Key Fetching).
The default key for signing is the first one on the secret key ring
which matches the string mc-pgp-user-id
; this defaults to
(user-login-name)
. Note that this differs from PGP's normal
default, which is to use the first of all of the secret keys. To
mimic PGP's behavior, set this variable to ""
. This variable is
specific to pgp 2.6.x; mc-pgp50-user-id
and mc-gpg-user-id
are
the corresponding variables for pgp 5.0 and GnuPG.
If you want to use a secret key other than your default for signing the
message, pass a prefix argument to mc-encrypt
. (That is, type
C-u C-c / e.) Mailcrypt will prompt for a string and will sign with
the first key on your secret keyring which matches that string. It will
be assumed that you want to sign the message, so you will not be
prompted.