📄 pgp-notes.txt
字号:
$Id: PGP-Notes.txt,v 3.0 2002/01/24 13:35:07 roessler Exp $ USING PGP FROM WITHIN MUTTWARNING: The configuration interface has completely changed as of 0.96.3! USERS' GUIDEHow do I use mutt with PGP, PGP5, or GnuPG?-------------------------------------------Go to the contrib subdirectory of the source tree. You'll findthree files there, pgp2.rc, pgp5.rc, and gpg.rc. These filescontain ready-to-use configurations for using mutt with pgp2, pgp5,and gpg.Include one of these files with your ~/.muttrc, and things shouldwork out fine.You may wish to verify that all paths and the language parametersgiven to the PGP binaries match your needs.Frequently Asked Questions and Tips-----------------------------------Q: "People are sending PGP messages which mutt doesn't recognize. What can I do?"The new way is to leave headers alone and use mutt'scheck-traditional-pgp function, which can detect PGP messages atrun-time, and adjust content-types.The old way is to configure your mail filter so it fixes headers:Add the following lines to your ~/.procmailrc (you areusing procmail, aren't you?): ------------------------------#### PGP## :0* !^Content-Type: message/* !^Content-Type: multipart/* !^Content-Type: application/pgp{ :0 fBw * ^-----BEGIN PGP MESSAGE----- * ^-----END PGP MESSAGE----- | formail \ -i "Content-Type: application/pgp; format=text; x-action=encrypt" :0 fBw * ^-----BEGIN PGP SIGNED MESSAGE----- * ^-----BEGIN PGP SIGNATURE----- * ^-----END PGP SIGNATURE----- | formail \ -i "Content-Type: application/pgp; format=text; x-action=sign"} ------------------------------For users of maildrop, "Mark Weinem"<mark.weinem@unidui.uni-duisburg.de> suggests the following recipe: ------------------------------BPGPM="-----BEGIN PGP MESSAGE-----"EPGPM="-----END PGP MESSAGE-----"BPGPS="-----BEGIN PGP SIGNATURE-----"EPGPS="-----END PGP SIGNATURE-----"if (!/^Content-Type: message/ && !/^Content-Type: multipart/ \ && !/^Content-Type: application\/pgp/){ if (/^$BPGPM/:b && /^$EPGPM/:b) xfilter "reformail -A 'Content-Type: application/pgp; format=text; \ x-action=encrypt'"if (/^$BPGPS/:b && /^$EPGPS/:b) xfilter "reformail -A 'Content-Type: application/pgp; format=text; \ x-action=sign'"} ------------------------------Q: "I don't like that PGP/MIME stuff, but want to use the old way of PGP-signing my mails. Can't you include that with mutt?"The old answer to this question used to be this: No. Application/pgp is not really suited to a world with MIME, non-textual body parts and similar things. Anyway, if you really want to generate these old-style attachments, include the following macro in your ~/.muttrc (line breaks for readability, this is actually one line): macro compose S "Fpgp +verbose=0 -fast +clearsig=on\ny^T^Uapplication/pgp; format=text; x-action=sign\n"There's a new answer, though: Set the $pgp_create_traditionalconfiguration variable (it's a quad-option) to something differentfrom "no" (that's the default). Mutt will then try to useapplication/pgp whereever it makes sense. In particular, it doesnot make any sense with multiparts, or non-ASCII or non-text bodies.In all other cases, PGP/MIME is used unconditionally.Note that application/pgp is still strongly deprecated.Q: "I don't like all the ^Gs and various other verbosity PGP is presenting me with."Roland Rosenfeld <roland@spinnaker.rhein.de> has found a quiteelegant solution to this problem: PGP has some pretty good foreignlanguage support. So we just introduce a language called "mutt"which contains empty strings for the messages we don't want to see.To use this, copy either language.txt or language50.txt (dependingon what PGP version you are using) to your $PGPPATH. Make sure thePGP command formats pass "+language=pgp" to all the PGP binaries(but not to pgpring!).For PGP 2.6, a German version called "muttde" is availableas well.Q: "My PGP signatures are being invalidated. BTW, I'm using Courier MTA."The author of the Courier MTA believes that the standard specifyingmultipart/signed is broken. For that reason, he has choosen toimplement his MTA in a way which does not assure thatmultipart/signed body parts are left untouched.We suggest that you abandon courier and change to sendmail, postfix,or exim. BACKGROUNDAuxiliary Programs------------------Mutt needs two auxiliary programs for its PGP support: pgpewrap andpgpring.1. pgpringpgpring is a key ring dumper. It extracts information from PGP'sbinary key ring and emits it in an (almost) readable output formatunderstood by mutt's key selection routines. This output formatmimics the one used by the GNU Privacy Guard (GPG).You'll need this program with PGP 2 and PGP 5.Command line options: -k <key ring> Dump the contents of the key ring specified as an argument to -k. -2, -5 Use the default key ring for PGP 2 or 5, respectively. -s Dump the secret key ring.2. pgpewrapThis is a little C program which does some command line munging: Thefirst argument is a command to be executed. When pgpewrapencounters a "--" (dash-dash) argument, it will interpret the nextargument as a prefix which is put in front of all followingarguments.Example: pgpewrap pgpe file -- -r a b cwill execute: pgpe file -r a -r b -r cThis script is needed with PGP 5 and with GPG, since their commandline interfaces can't be properly served by mutt's format mechanism.The Configuration Interface---------------------------As usual within mutt, the configuration interface for the PGPcommands relies on printf-like formats. For all PGP commands, thefollowing %-sequences are defined. %p The empty string when no passphrase is needed, the string "PGPPASSFD=0" if one is needed. This is mostly used in conditional % sequences. %f Most PGP commands operate on a single file or a file containing a message. %f expands to this file's name. %s When verifying signatures, there is another temporary file containing the detached signature. %s expands to this file's name. %a In "signing" contexts, this expands to the value of the configuration variable $pgp_sign_as. You probably need to use this within a conditional % sequence. %r In many contexts, mutt passes key IDs to pgp. %r expands to a list of key IDs.The following command formats are defined: $pgp_decode_command Decode application/pgp messages. This command operates with and without pass phrases. $pgp_verify_command Verify a PGP/MIME signature. $pgp_decrypt_command Decrypt a PGP/MIME encrypted MIME body. This command always gets a pass phrase. $pgp_sign_command Sign a PGP/MIME body. This command always gets a pass phrase. $pgp_encrypt_sign_command Encrypt and sign a MIME body. This command always gets a pass phrase. $pgp_encrypt_only_command Encrypt a MIME body, but don't sign it. $pgp_import_command Import PGP keys from a file. $pgp_export_command Export PGP keys to a file. The output must be ASCII armored. $pgp_verify_key_command Check a public key. This is used from the key selection menu. $pgp_list_secring_command List the secret keys matching some hints given in %r. $pgp_list_pubring_command List the public keys matching some hints given in %r.The passphrase is always passed on stdin; all commands must sendtheir output to stdout and stderr.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -