]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/zwgc/zwgc.desc
Import new release
[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.16 2000/07/14 14:04:23 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 match "message"
53   if (downcase($recipient) == downcase($user)) then
54     case $instance
55     match "PERSONAL"
56       set type = "Personal"
57     match "URGENT"
58       set type = "Urgent"
59     default
60       set type = $instance
61     endcase
62   else
63     set type = "Instance "+$instance
64   endif
65
66   fields signature body
67   if ($body == "") then
68     set body = $signature
69     set signature = ""
70   endif
71   if ($signature =~ "^[Ff]rom: .*") then
72     set dummy = lany($signature,"From: ")
73   endif
74   if ($signature =~ "\n$") then
75     set dummy = rany($signature,"\n")
76   endif
77   if ($signature == "") then
78     set ftext = "From: @bold("+protect($sender)+")"
79   else
80     set ftext = "From: @bold(@{"+protect($signature)+"} <"+
81       protect($sender)+">)"
82   endif
83
84   print "@center(@bold("+$aval+") "+$type+" message at "+$time+
85     " on "+$date+"\n"+$ftext+" on "+$fromhost+"\nTo: "+
86     $recipient+")\n\n"
87   print $body
88   put
89   exit
90
91 match "login"
92   case $opcode  
93   match "USER_LOGIN"
94     set log = "logged in"
95   match "USER_LOGOUT"
96     set log = "logged out"
97   default
98     set log = "unknown opcode"
99   endcase
100
101   fields host when tty
102   print "@center(@bold("+$sender+") "+$log+")\n"
103   print "@center(on @bold("+$host+") on "+$tty+")\n"
104   print "@center(at "+$when+")"
105   put
106   exit
107
108 default
109   if (downcase($class) == "filsys" and downcase($opcode) == "shutdown") then
110     set format = "From $sender:\n@bold(Shutdown message from $1 at $time)\n"+
111       "@center(System going down, message is:)\n\n$2\n\n@center(@bold($3))"
112   elseif (downcase($class) == "filsys") then
113     set format = "@bold(Filesystem Operation Message for $instance:)\n"+
114       "From: @bold($sender) at $time $date\n$message"
115   elseif (downcase($class) == "mail" and downcase($instance) == "popret") then
116     set format = "You have new mail:\n\nFrom: $1\nTo: $2\nSubject: $3"
117   elseif (downcase($class) == "mail") then
118     set format = "From Post Office $1:\n$2"
119   elseif (downcase($class) == "syslog") then
120     set format = "From $sender:\nSyslog message from $instance, level "+
121       "$opcode:\n$message"
122   elseif ($number_of_fields == "1") then
123     set format = "Class $class, Instance $instance:\nTo: @bold($recipient) "+
124       "at $time $date\nFrom: @bold($sender)\n\n$message"
125   else
126     set format = "Class $class, Instance $instance:\nTo: @bold($recipient) "+
127       "at $time $date\nFrom: @bold($1) <$sender>\n\n$2"
128   endif
129
130   print "(Authentication: @bold("+$aval+") from host: "+$fromhost+")\n"
131   print substitute($format)
132   put
133   exit
134
135 endcase