;; I'll release the doc-strings fixed version of X-PGP-Sig_el in the ;; near future. First of all, this program is mainly for the news administrators, not for people in the street. It is useful to sign control messages with X-PGP-Sig header using any Emacs news programs, e.g. Gnus, Wanderlust, etc. Here is a simple instruction of how to use x-pgp-sig.el. 1. Requirements =============== You need to have installed PGP 2.63i, 2.63ia or 5.0i, and Emacs 20/21, XEmacs with MULE or Mule 2.3 based on Emacs 19.34. Any other versions have been neither supported nor tested yet. 2a. Installing with FSF Emacs ============================= Type the following: make install or make EMACS=emacs-21.2 LISPDIR=/usr/lib/emacs/site-lisp install The default values are: EMACS=emacs LISPDIR=/usr/local/share/emacs/site-lisp 2b. Installing with XEmacs ========================== Type the following: make xinstall or make XEMACS=xemacs-21.4.8 XLISPDIR=/usr/lib/xemacs/site-lisp xinstall The default values are: XEMACS=xemacs XLISPDIR=/usr/local/lib/xemacs/site-lisp 3. Setting up .emacs (or equivalent) file ========================================= Put the following lines in your (X)Emacs startup file: (autoload 'x-pgp-sig-sign "x-pgp-sig" nil t) (autoload 'x-pgp-sig-set-signer "x-pgp-sig" nil t) (autoload 'x-pgp-sig-set-signer-maybe "x-pgp-sig" nil t) (autoload 'x-pgp-sig-verify "x-pgp-sig" nil t) (add-hook 'HOOK 'x-pgp-sig-sign t) You must modify `HOOK' in the last line to the proper symbol for the news program which you wish to use. It should be a normal hook which will be evaluated just before sending a news message. For Gnus, you can use `message-header-hook' as follows: (add-hook 'message-header-hook 'x-pgp-sig-sign t) In addition, it is better to put this line in the end of .gnus file rather than .emacs file. Because the hook function `x-pgp-sig-sign' should be called when the message has been prepared completely for sending as a news article. This issue is just the same for the other news programs. 4. Signing ========== Compose a news message and type `C-c C-c'. Then you will be prompted for the PGP passphrase only at the first time to sign. The passphrase will be encrypted and held in the Lisp variable. 5. Verifying ============ Type `M-x x-pgp-sig-verify' in the raw article buffer. The raw article means not-decoded and not-modified data which remains just as it was retrieved from the news server. Especially for Gnus and some news programs, you can use this command in the summary buffer. You have a need to contain the public keys for the senders in your key ring file. 6. Useful Commands ================== M-x x-pgp-sig-set-signer Set the signer's user-id and the passphrase. You can use this command before typing `C-c C-c'. M-x x-pgp-sig-set-signer-maybe Similar to `x-pgp-sig-set-signer' except that it does nothing if the signer's user-id and the passphrase have already been set. 7. User options =============== `x-pgp-sig-process-asynchronous-p' Try to switch the value for this option if you feel signing or verifying is very slow. If non-nil, Emacs will call the PGP command asynchronously, otherwise synchronously. The proper value may be different whether you use PGP version 2 or 5. The default value is t. `x-pgp-sig-sign-fields' List of header names to be signed. The default value is: ("Subject" "Control" "Message-ID" "Date" "From" "Sender") Note that since some headers might be modified or deleted by the news server (as far as we know, the Sender header will be replaced by some kind of news agent, and the inews command will modify the Date header), you should never include such headers in the list. `x-pgp-sig-adjust-sign-fields-alist' Alist used to do addition and subtraction some header names with `x-pgp-sig-sign-fields' when signing a message. Each element looks like the following form: (REGEXP (sub "Sub1" "Sub2" ...) (add "Add1" "Add2" ...)) If REGEXP matches to the header contents, the header names Sub1, Sub2, ... are substracted from `x-pgp-sig-sign-fields' and the header names Add1, Add2, ... are added to `x-pgp-sig-sign-fields'. REGEXP can also be a function which will be called in the narrowed header with no arg. The default value is nil. `x-pgp-sig-from' Your e-mail address. The default value is the same as the value for `user-mail-address'. `x-pgp-sig-default-signer' PGP user-id. It will be used for both PGP versions 2 and 5. If you have different IDs for PGP versions, use `x-pgp-sig-default-signer-list' instead. The default value is "user-full-name ". `x-pgp-sig-default-signer-list' List of user-IDs for PGP version 2 and PGP version 5. `x-pgp-sig-pgp-v5-p' Set this to t if you use PGP version 5. The default value is nil. `x-pgp-sig-pgp-program' The name of the PGP command. The default value is "pgp". `x-pgp-sig-shell-program' The shell file name used to sign with PGP version 5 when the value of `x-pgp-sig-process-asynchronous-p' is nil. The default value is "/bin/sh". `x-pgp-sig-shell-program-arg' Argument used to have `x-pgp-sig-shell-program' execute its command line argument. The default value is "-c". `x-pgp-sig-pipe-command' The name of the command used to pipe data stream to the PGPS command when `x-pgp-sig-process-asynchronous-p' is nil and `x-pgp-sig-pgp-v5-p' is non-nil. The default value is "/bin/cat". `x-pgp-sig-process-coding-system-for-output' Coding-system used for communicating with the PGP command. The default value is nil and the coding system `binary' will be used. `x-pgp-sig-pgppath' The value for the environment variable PGPPATH. `x-pgp-sig-pubring' Name of the the public key ring file for PGP version 2. The default value is `x-pgp-sig-pgppath'"/pubring.pgp". `x-pgp-sig-pubring-v5' Name of the the public key ring file for PGP version 5. The default value is `x-pgp-sig-pgppath'"/pubring.pkr". `x-pgp-sig-secring' Name of the the secret key ring file for PGP version 2. The default value is `x-pgp-sig-pgppath'"/secring.pgp". `x-pgp-sig-secring-v5' Name of the the secret key ring file for PGP version 5. The default value is `x-pgp-sig-pgppath'"/secring.skr". `x-pgp-sig-delete-last-empty-line-while-verifying' If non-nil, try to verify a signed message deleting empty lines in the end of the message body one by one until it succeeds. The default value is t. `x-pgp-sig-approved-field-body' String used for the body of the Approved header. The Approved header will be added only when there is the Control header in the message except for cancelling. The default value is the same as the value for `x-pgp-sig-from'. `x-pgp-sig-x-info-field-body' If it is a string, the X-Info header will be added to the message with the string as a field body. The default value is nil and the X-Info header will not be added. `x-pgp-sig-last-fields' List of header names which should be placed under the X-PGP-Sig header. The default value is: ("Content-Type" "Content-Transfer-Encoding") `x-pgp-sig-always-sign' If non-nil, always sign a message. Otherwise, user will be prompted whether sign a message or not. The default value is nil. `x-pgp-sig-inhibit-repeated-sign' If non-nil, the X-PGP-Sig header will not be added to a message if it has already been signed. The default value is t. `x-pgp-sig-enter-keyid-first' If non-nil, the command `x-pgp-sig-set-signer(-maybe)' will prompt user for the key-id first. The default value is nil. `x-pgp-sig-add-signature-judging-function' Function used to ask user whether sign a message or not. It is called only when the value of `x-pgp-sig-always-sign' is nil. The default value is `x-pgp-sig-add-signature-y-or-n-p'. `x-pgp-sig-load-hook' Hook run when the file x-pgp-sig.el(c) is loaded. The default value is nil. `x-pgp-sig-reload-hook' Hook run when the file x-pgp-sig.el(c) is reloaded. The default value is nil. `x-pgp-sig-sign-hook' Hook run just after signing a message. The default value is nil. `x-pgp-sig-prepare-sign-hook' Hook run just before calling the PGP command to sign a message. `x-pgp-sig-post-sign-hook' Hook run just after calling the PGP command to sign a message.