home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 1 / GoldFishApril1994_CD2.img / d4xx / d473 / cnewssrc / cnews_src.lzh / relay / sh / inews.sh < prev    next >
Text File  |  1990-07-07  |  2KB  |  57 lines

  1. hname = "T:headers.$CLINUM"
  2. aname = "T:article.$CLINUM"
  3. header = yes
  4.  
  5. while read line
  6. do
  7.     if [ "$line" = "" ]
  8.     then
  9.         header = no
  10.     elif [ "$header" = "yes" ]
  11.     then
  12. #        These are all removed during the filtering that RELAYNEWS does:
  13. #            Xref:, Article-I.D., Lines, Date-Received, Received, Posted,
  14. #            Posting-Version, Relay-Version, Ollegal-Object
  15.         x = $(expr index ':' "$line")
  16.         inc x
  17.         text = $(expr substr "$line" x 9999)
  18.         case "$line" in
  19.         Newsgroups:*)    N_NGRP = $text;;
  20.         From:*)            N_FROM = $text;;
  21.         Date:*)            N_DATE = $text;;
  22.         Subject:*)        N_SUBJECT = $text;;
  23.         Distribution:*)    N_DISTR = $text;;
  24.         Organization:*)    N_ORGAN = $text;;
  25.  
  26.         Path:*)            true ;;        # Ignore Path: and Message-ID: headers
  27.         Message-ID:*)    true ;;
  28.         Approved:*)        true;; # N_APPROVED = $text;;
  29.         Sender:*)        true;; # N_SENDER = $text;;
  30.         Control:*)        true;; # N_CONTROL = $text;;
  31.         Also-Control:*)    true;; # N_ALSOCONTROL = $text;;
  32.         Keywords:*)        true;; # N_KEYWORD = $text;;
  33.         Comments:*)        true;; # N_COMMENT = $text;;
  34.         Expires:*)        true;; # N_EXPIRE = $text;;
  35.         References:*)    true;; # N_REFER = $text;;
  36. #        X-*:*)            echo "$line" >> $hname;;
  37.         *:*)            echo "$line" >> $hname;;
  38.         esac
  39.     else
  40.         echo "$line" >> $aname
  41.     fi
  42. done
  43.  
  44. if [ "$N_NEWSGROUP" = "" ]; then Error = "Newsgroup: is required!"; fi
  45. if [ "$N_FROM" = "" ]; then N_FROM = $(C:GetEnv USERNAME); fi
  46. if [ "$N_DATE" = "" ]; then N_DATE = $(parsedate $N_DATE); fi
  47. if [ "$N_DATE" = "" ]; then Error = "Date: is invalid!"; fi
  48. if [ "$N_SUBJECT" = "" ]; then Error = "Subject: is required!"; fi
  49. if [ "$N_DISTR" = "" ]; then N_DISTR = "na"; fi
  50. if [ "$N_ORGAN" = "" ]; then N_ORGAN = "Edwards & Edwards Consulting"; fi
  51.  
  52. if [ "$Error" != "" ]
  53. then
  54.     echo "$Error"
  55.     return 5
  56. fi
  57.