]> git.lizzy.rs Git - plan9front.git/blob - sys/man/4/ratfs
cifs(4), cifsd(8): add HISTORY
[plan9front.git] / sys / man / 4 / ratfs
1 .TH RATFS 4
2 .SH NAME
3 ratfs  \- mail address ratification file system
4 .SH SYNOPSIS
5 .B ratfs
6 [
7 .B -d
8 ] [
9 .B -c
10 .I configuration
11 ] [
12 .B -f
13 .I classification
14 ] [
15 .B -m
16 .I mountpoint
17 ]
18 .SH DESCRIPTION
19 .I Ratfs
20 starts a process that mounts itself (see
21 .IR bind (2))
22 on
23 .I mountpoint
24 (default
25 .BR /mail/ratify ).
26 .I Ratfs
27 is a persistent representation of the local network
28 configuration and spam blocking list.  Without it
29 each instance of
30 .IR smtpd (6)
31 would need to reread and parse a multimegabyte list
32 of addresses and accounts.
33 .PP
34 .I Ratfs
35 serves a control file,
36 .BR ctl ,
37 and several top level directories:
38 .BR trusted ,
39 .BR deny ,
40 .BR dial ,
41 .BR block ,
42 .BR delay ,
43 and
44 .BR allow .
45 .PP
46 The control file is write only and accepts three
47 possible commands:
48 .TF "debug file
49 .TP
50 .B reload
51 rereads
52 .I classification
53 and
54 .I configuration
55 .TP
56 .B debug \fIfile\fP
57 creates
58 .I file
59 and sends debugging output to it.
60 .TP
61 .B nodebug
62 closes the debug file and turns off debugging
63 .PD
64 .PP
65 The directory
66 .B trusted
67 serves a file for each IP range from which all mail
68 is trusted.  The names of the files are CIDR blocks;
69 an IP address or an IP address followed by
70 .BR #\fIn\fP ,
71 where
72 .I n
73 is the number of bits to match.
74 To check if any IP address falls in a trusted
75 range, it is sufficient to open the file whose
76 name is the IP address.
77 For example, if
78 .B trusted
79 contains only the file
80 .BR 135.104.0.0#16 ,
81 an attempt to open the file 135.104.9.1 will
82 succeed while opening 10.1.1.1 will fail.
83 To determine the particular range matched,
84 .B dirfstat
85 (see stat (2))
86 the open file and the
87 .B name
88 field will be the matching CIDR range.
89 .PP
90 The trusted ranges come both from the
91 .B ournet
92 entries in the file
93 .I configuration
94 (default
95 .BR /mail/lib/blocked )
96 and from creates, typically done by
97 .B imap4d
98 (see
99 .IR ipserv (8))
100 and
101 .B pop3
102 (see
103 .IR mail (1))
104 whenever they are used to read someone's mail.
105 .PP
106 The remaining directories,
107 .BR allow ,
108 .BR block ,
109 .BR delay ,
110 .BR deny ,
111 and
112 .BR dial ,
113 represent the contents of the
114 .I classification 
115 (default
116 .BR /mail/lib/smtpd.conf.ext ).
117 Each contains two directories;
118 .B ip
119 and
120 .BR account .
121 The
122 .B ip
123 directory has the same open semantics as the 
124 .B trusted
125 directory, i.e., to check if an IP address falls
126 in that category, try to open a file whose
127 name is the IP address.
128 The
129 .B account
130 directory is similar but is used for matching
131 strings.  Each file in the directory represents
132 a regular expression.  To see if one of the
133 strings matches one of the regular expressions,
134 try to open the file whose name is the string.
135 If it succeeds, then there is a regular expression
136 that matches.  To determine the regular expression,
137 .B fstat
138 the open file.  The
139 .B name
140 field will be the regular expression.
141 .PP
142 There is a direct mapping from entries in
143 .I classification
144 and files under
145 .BR allow ,
146 .BR block ,
147 .BR delay ,
148 .BR deny ,
149 and
150 .BR dial.
151 A configuration file entry of the form:
152 .EX
153         dial    135.104.9.0/24
154 .EE
155 corresponds to the file
156 .BR dial/ip/135.104.9.0#24 .
157 An entry of the form
158 .EX
159         *block  .*!gre
160 .EE
161 corresponds to the file
162 .BR block/account/.*!gre .
163 .PP
164 Both the configuration file and control file formats
165 are described in
166 .IR smtpd (6).
167 .SH SOURCE
168 .B /sys/src/cmd/ratfs
169 .SH "SEE ALSO"
170 .IR mail (1)
171 .IR smtpd (6)
172 .IR scanmail (8)
173
174