Penguin
Note: You are viewing an old revision of this page. View the current version.

If you want to be able to read encrypted mail you have sent (in your sent-mail folder), you will have to encrypt outgoing mail with multiple keys. At one point there was apparently a mutt option called 'pgp_encryptself', but it seems to no longer exist.

If you want to encrypt your mail with your own public key as well as the recipient's public key,

you can do it as follows
$ grep pgp_encrypt /.muttrc

If you customized pgp_encrypt_only_command or pgp_encrypt_sign_command, you just want to add to them.

If not, check here
$ grep pgp_encrypt /etc/Muttrc
You will now need your key ID, which you can find as follows
$ gpg --list-key your@email.address pub 1024D/72A6205E 2003-07-20 Kevin George <kevin@... .net> uid Kevin George <kevin@... .com> [...?

The ID is the number after the first slash - 72A6205E in this case. Now edit the pgp_encrypt_only_command and pgp_encrypt_sign_command lines of your .muttrc (or add new ones based on the entries in /etc/Muttrc) to look like this:

(Please do not copy these lines directly - base yours on your existing settings as they will likely differ from mine.)

set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap /usr/bin/gpg --charset utf-8 --batch --quiet --no-verbose --output - --encrypt --encrypt-to 72A6205E --textmode --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap /usr/bin/gpg --charset utf-8 --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --encrypt-to 72A6205E --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"

The bold area is what you are adding. Be sure to add the "--" at the beginning of the first bold word. Dashes may not appear bold in your font. You should now be set. Restart mutt and try sending encrypted email to someone else, then try reading it in your sent-mail folder.

If you get shell or gpg errors, be sure that the 'set' lines have no linefeeds where they don't belong. You may need to disable word wrap in your editor (pico/nano word wrap by default - use the '-w' command line argument to disable word wrap).

If/when you upgrade mutt, you will probably want to check your /etc/Muttrc afterwards and see if any of the pgp_encrypt_X lines have been modified. This should not be a problem though, since you should not have edited the lines in there, but in /.muttrc instead. That makes much more sense as well, in case you want to add other users to the system later (or if they already exist). When they send encrypted mail, they will not appreciate it if it is readable by you ;-)


Part of CategoryCryptography

The following authors of this page have not agreed to the WlugWikiLicense. As such copyright to all content on this page is retained by the original authors.
  • TomislavRenic
The following authors of this page have agreed to the WlugWikiLicense.

PHP Warning

lib/plugin/WlugLicense.php:99: Warning: Invalid argument supplied for foreach()

lib/plugin/WlugLicense.php:111: Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument

lib/plugin/WlugLicense.php:111: Notice: Undefined variable: ignore_authors