home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / os2 / pgprex12.arj / PGPREXX.ZIP / PGPckSig.CMD < prev    next >
Encoding:
Text File  |  1996-07-25  |  2.0 KB  |  75 lines

  1. /* REXX Program PGPckSig.CMD 1.2 */
  2. /* to check the signature on incoming mail.
  3.    Companion to PGPdeCode.CMD, PGPenCod.CMD (with SPLITMAIL.CMD and JOINMAIL.CMD).
  4.      Alternate to PGPdeSig.CMD.
  5.  
  6.    Copyright Lüko Willms <Lueko.Willms@T-Online.de>
  7.  
  8.    Configure this as a filter to be run when your mailer detects the string
  9.    '-----BEGIN PGP SIGNED MESSAGE-----' in the body of an incoming mail message
  10. */
  11.  
  12. arg MailFile .
  13.  
  14. /* ------------------------ Get message data  ------ */
  15.  
  16. From  = ''
  17. Sender = ''
  18. MsgId = ''
  19. Timestamp=Date('O')||' '||Time()
  20. Betreff = ''
  21.  
  22. Erg = STREAM(MailFile,'C','OPEN READ')
  23.  
  24. Zeile = linein(MailFile)
  25. ContLine = 0
  26. DO WHILE Length(Zeile) > 0
  27.     /* Beachte Fortsetzungszeilen!! */
  28.     ContLine = ContLine & (LEFT(Zeile,1) = ' ' | LEFT(Zeile,1) = '09'x)
  29.     Zeile = STRIP(Zeile)
  30.     If \ ContLine then
  31.        DO
  32.        Tag = TRANSLATE(WORD(Zeile,1))
  33.        Zeile = Delstr(Zeile,1,Length(Tag))
  34.        END
  35.  
  36.     If RIGHT(Zeile,1) = ',' then
  37.        DO
  38.        ContLine = TRUE                                 /* for the next line... */
  39.        Zeile = DELSTR(Zeile,Length(Zeile),1)
  40.        END
  41.  
  42.     SELECT
  43.       When (Tag = 'FROM:') then
  44.         From = zeile
  45.       When (Tag = 'SENDER:') then
  46.         Sender = Zeile
  47.       When (Tag = 'MESSAGE-ID:') then
  48.         MsgId = Zeile
  49.       When (Tag = 'DATE:') then
  50.         Timestamp = Zeile
  51.       When (Tag = 'SUBJECT:') then
  52.         Betreff = Zeile
  53.       Otherwise
  54.         NOP
  55.     END /* Switch */
  56.  
  57.     Zeile = linein(MailFile)
  58. END /* Do Header */
  59.  
  60. Erg = STREAM(MailFile,'C','CLOSE')
  61.  
  62. 'type ' MailFile ' | pgp -f 1>NUL 2>>'MailFile
  63.  
  64. /* Do logging ---------------------------------------------- */
  65. Erfolg = RC
  66. Tab = '09'x
  67. PARSE SOURCE . . MyName
  68. LogFile = FILESPEC("Path",MyName)||'PGPREXX.LOG'
  69. Erg = STREAM(LogFile,'C','OPEN WRITE')
  70. If Length(From) = 0 then
  71.    From = Sender
  72. Erg = LINEOUT(LogFile,Timestamp||Tab||'ckSig'||Tab||MsgId||Tab||Erfolg||Tab||'From: '||From)
  73. Erg = STREAM(LogFile,'C','CLOSE')
  74. exit
  75.