]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/zwgc/zwgc.desc
Initial revision
[1ts-debian.git] / zephyr / zwgc / zwgc.desc
1 #       Copyright 1989, 1990 Massachusetts Institute of Technology
2 #
3 #       For copying and distribution information, see the file
4 #       "mit-copyright.h".
5
6 #       $Id: zwgc.desc,v 1.15 1999/01/22 23:20:51 ghudson Exp $
7 #
8 #
9 # Default WindowGram description file
10 #
11
12 # Opcode "ping" is used by sender programs to see if the message would
13 # really get sent, or if the recipient has logged out.  No useful
14 # information is normally contained in these messages, so we discard them.
15 if (upcase($opcode) == "PING") then exit endif
16
17 #
18 # AUTHENTICATION information
19 #
20 # $auth can be either Yes, No, or Forged
21 #
22 # "Yes" means that the sender field present in the notice was verified by
23 # Kerberos authentication
24 #
25 # "No" means that either the sender did not include any authentication
26 # information, or the authentication information was not verified by the
27 # Zephyr Server before the notice was sent to you.
28 #
29 # "Forged" means that the Server claims that the sender of the notice
30 # was verified by Kerberos authentication, but your WindowGram client
31 # could not verify this.  This stage of verification is done by a cryptographic
32 # checksum.  The most probable cause of the failure of the checksum
33 # provided by the Server to match the checksum generated by your
34 # WindowGram client is that you changed Kerberos tickets, and the Server
35 # was using an old value to compute the cryptographic checksum.  You can
36 # update the Server's value by typing 'zctl load' to your prompt.
37 #
38 # By default, notices which appear forged are labeled as 'UNAUTHENTIC'
39 # to avoid confusion as to what 'Forged' really means.
40 # To change this display, change the last word in the line following
41 # 'match "forged" to something other than "UNAUTHENTIC".
42 case $auth
43 match "yes"
44         set aval = "Authentic"
45 match "no","forged"
46         set aval = "@b(@large(UNAUTHENTIC))"
47 endcase
48
49 case $class
50 match "WG_CTL_CLASS"
51         exit
52 #  
53 # MAIL NOTIFICATION
54 #
55 # To receive mail notifications, you need to do several things:
56 # 1) subscribe to MAIL,POP messages.  You do this by typing:
57 #       zctl add mail pop
58 # to your prompt.  By doing this, you will get a simple notice every
59 # time you are logged in and more mail arrives for you at your post office.
60 #
61 # 2) If you wish to be notified of the sender, recipient and subject of the
62 # new mail, remove the pound-signs from the beginning of the 10 lines below
63 # between 'match "MAIL"' and 'exit', inclusive, and type the command
64 #       zctl add mail popret
65 # to your prompt.
66 #
67 # Note: The use of the following lines is NOT necessary to receive
68 # notifications of new mail.  The only effect of uncommenting these
69 # lines is to display on your screen the sender, recipient and subject
70 # of the mail (In addition, uncommenting these lines will add extra load
71 # to the post office servers, making them run slower.).
72 # If you do not wish this information to be displayed where other users
73 # might possibly read it, or you wish to avoid loading down the post
74 # office servers, you need not uncomment these lines.  Just follow step
75 # 1 above. 
76 #
77 #match "MAIL"
78 #       case $instance
79 #       match "pop"
80 #               exec "zmailnotify"
81 #               exit
82 #       endcase
83 #       print "(Authentication: @bold("+$aval+"))\n"
84 #       print substitute($default)
85 #       put
86 #       exit
87 match "message"
88         if (downcase($recipient) == downcase($user)) then
89                 case $instance
90                 match "PERSONAL"
91                         set type = "Personal"
92                 match "URGENT"
93                         set type = "Urgent"
94                 default
95                         set type = $instance
96                 endcase
97         else
98                 set type = "Instance "+$instance
99         endif
100
101         fields signature body
102         if ($body == "") then
103                 set body = $signature
104                 set signature = ""
105         endif
106         if ($signature =~ "^[Ff]rom: .*") then
107                 set dummy = lany($signature,"From: ")
108         endif
109         if ($signature =~ "\n$") then
110                 set dummy = rany($signature,"\n")
111         endif
112         if ($signature == "") then
113                 set ftext = "From: @bold("+protect($sender)+")"
114         else
115                 set ftext = "From: @bold(@{"+protect($signature)+"} <"+
116                         protect($sender)+">)"
117         endif
118
119         print "@center(@bold("+$aval+") "+$type+" message at "+$time+
120                 " on "+$date+"\n"+$ftext+" on "+$fromhost+"\nTo: "+
121                 $recipient+")\n\n"
122         print $body
123         put
124         exit
125
126 match "login"
127         case $opcode
128         match "USER_LOGIN"
129                 set log = "logged in"
130         match "USER_LOGOUT"
131                 set log = "logged out"
132         default
133                 set log = "unknown opcode"
134         endcase
135
136         fields host when tty
137         print "@center(@bold("+$sender+") "+$log+")\n"
138         print "@center(on @bold("+$host+") on "+$tty+")\n"
139         print "@center(at "+$when+")"
140         put
141         exit
142
143 default
144         print "(Authentication: @bold("+$aval+") from host: "+$fromhost+")\n"
145         print substitute($default)
146         put
147         exit
148
149 endcase