maddy

Fork https://github.com/foxcpp/maddy

git clone git://git.lin.moe/go/maddy.git

 1# File 
 2
 3table.file module builds string-string mapping from a text file.
 4
 5File is reloaded every 15 seconds if there are any changes (detected using
 6modification time). No changes are applied if file contains syntax errors.
 7
 8Definition:
 9```
10file <file path>
11```
12or
13```
14file {
15	file <file path>
16}
17```
18
19Usage example:
20```
21# Resolve SMTP address aliases using text file mapping.
22modify {
23	replace_rcpt file /etc/maddy/aliases
24}
25```
26
27## Syntax
28
29Better demonstrated by examples:
30
31```
32# Lines starting with # are ignored.
33
34# And so are lines only with whitespace.
35
36# Whenever 'aaa' is looked up, return 'bbb'
37aaa: bbb
38
39	# Trailing and leading whitespace is ignored.
40	ccc: ddd
41
42# If there is no colon, the string is translated into ""
43# That is, the following line is equivalent to
44#	aaa:
45aaa
46
47# If the same key is used multiple times - table.file will return
48# multiple values when queries.
49ddd: firstvalue
50ddd: secondvalue
51
52# Alternatively, multiple values can be specified
53# using a comma. There is no support for escaping
54# so you would have to use a different format if you require
55# comma-separated values.
56ddd: firstvalue, secondvalue
57```
58