home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / mail / mime / 180 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  2.7 KB

  1. Path: sparky!uunet!spool.mu.edu!srvr1.engin.umich.edu!news-server.engin.umich.edu!disser
  2. From: disser@engin.umich.edu (David Disser)
  3. Newsgroups: comp.mail.mime
  4. Subject: Re: pgp headers for MIME
  5. Followup-To: comp.mail.mime
  6. Date: 22 Jan 93 12:21:47
  7. Organization: University of Michigan
  8. Lines: 65
  9. Distribution: world
  10. Message-ID: <DISSER.93Jan22122147@simile.engin.umich.edu>
  11. References: <C18C4r.6K8@wizzy.com> <KHERA.93Jan22095241@thneed.cs.duke.edu>
  12. NNTP-Posting-Host: simile.engin.umich.edu
  13. In-reply-to: khera@cs.duke.edu's message of 22 Jan 93 14:52:41 GMT
  14.  
  15.  
  16. I made some wrapper scripts around PGP a while back to handle this sort of
  17. thing.  I *do* use 'text/x-pgp' and 'pgp -a' because it allows people with
  18. pgp but not MIME to still read the messages.
  19.  
  20.  
  21. Here's a start for mh + MIME users: an "editor" that runs out of the MH
  22. "What now?" prompt, and PGP encodes your message in a nice mhn-processable
  23. format.  Note that this works only on MH 6.7.2-MIME+mtr or later.
  24.  
  25. Call this script "pgpedit" and make links to it called: pgpe, pgpes, pgpk,
  26. pgka.
  27.  
  28. After you're done writing your message, type "edit pgpe" at the What now?
  29. prompt, it will try to figure out who you're sending to, encode with their
  30. key if you have it, and format it for MHN.  Then type "edit mhn" and voila
  31. your message is ready to go.  The type is "text/x-pgp" and needs an
  32. .mh_profile line like:
  33.  
  34. mhn-show-text/x-pgp: pgp -m %F
  35.  
  36. You can call it by different names for different options, notable "pgpk" to
  37. send someone your public key, or "pgpka" to send the whole keyring.
  38. Anyway, here's the script.
  39.  
  40. #!/bin/sh
  41.  
  42. case `basename $0` in
  43.         pgpes) opt="-feast" ;;
  44.         pgps) opt="-staf +clearsig=on" ;;
  45.         pgpe) opt="-feat" ;;
  46.         pgpka) pgp -kxa "" pubkey$$
  47.                 (echo '#<text/x-pgp';cat pubkey$$.asc;echo '#') >> $*
  48.                 rm -f pubkey$$.asc
  49.                 exit 0 ;;
  50.         pgpk)   pgp -kxa $USER pubkey$$
  51.                 (echo '#<text/x-pgp';cat pubkey$$.asc;echo '#') >> $* 
  52.                 rm -f pubkey$$.asc 
  53.                 exit 0 ;;
  54. esac
  55.  
  56. if head -20 $* | grep -s '^--------$' ; then
  57.         sed -ne '1,/^--------$/p' $* > header$$
  58.         sed -e '1,/^--------$/d' $* > body$$
  59. else
  60.         sed -ne '1,/^$/p' $* > header$$
  61.         sed -e '1,/^$/d' $* > body$$
  62. fi
  63.  
  64. to=`sed -ne 's/^[tT]o: //p' header$$`
  65.  
  66. if [ -n "$to" ] ; then
  67.         if pgp -kv "$to" 2>&1 | grep -s '^pub' ; then
  68.                 echo Using public key for $to.
  69.                 opt="$opt $to"
  70.         fi
  71. fi
  72.  
  73. (cat header$$;echo '#<text/x-pgp';pgp $opt < body$$;echo '#')  > $*
  74. rm -f header$$ body$$
  75. --
  76.  
  77. ) Dave Disser                 UM-CAEN User Services    
  78. ) disser@engin.umich.edu      229 Chrysler Center    
  79. ) (313) 763-3067              Ann Arbor, MI 48109-2092
  80.