1CIDR_TABLE(5) File Formats Manual CIDR_TABLE(5)
2
3
4
6 cidr_table - format of Postfix CIDR tables
7
9 postmap -q "string" cidr:/etc/postfix/filename
10
11 postmap -q - cidr:/etc/postfix/filename <inputfile
12
14 The Postfix mail system uses optional lookup tables. These tables are
15 usually in dbm or db format. Alternatively, lookup tables can be spec‐
16 ified in CIDR (Classless Inter-Domain Routing) form. In this case, each
17 input is compared against a list of patterns. When a match is found,
18 the corresponding result is returned and the search is terminated.
19
20 To find out what types of lookup tables your Postfix system supports
21 use the "postconf -m" command.
22
23 To test lookup tables, use the "postmap -q" command as described in the
24 SYNOPSIS above.
25
27 The general form of a Postfix CIDR table is:
28
29 network_address/network_mask result
30 When a search string matches the specified network block, use
31 the corresponding result value. Specify 0.0.0.0/0 to match every
32 IPv4 address, and ::/0 to match every IPv6 address.
33
34 An IPv4 network address is a sequence of four decimal octets
35 separated by ".", and an IPv6 network address is a sequence of
36 three to eight hexadecimal octet pairs separated by ":".
37
38 Before comparisons are made, lookup keys and table entries are
39 converted from string to binary. Therefore table entries will be
40 matched regardless of redundant zero characters.
41
42 Note: address information may be enclosed inside "[]" but this
43 form is not required.
44
45 IPv6 support is available in Postfix 2.2 and later.
46
47 network_address result
48 When a search string matches the specified network address, use
49 the corresponding result value.
50
51 blank lines and comments
52 Empty lines and whitespace-only lines are ignored, as are lines
53 whose first non-whitespace character is a `#'.
54
55 multi-line text
56 A logical line starts with non-whitespace text. A line that
57 starts with whitespace continues a logical line.
58
60 Patterns are applied in the order as specified in the table, until a
61 pattern is found that matches the search string.
62
64 /etc/postfix/main.cf:
65 smtpd_client_restrictions = ... cidr:/etc/postfix/client.cidr ...
66
67 /etc/postfix/client.cidr:
68 # Rule order matters. Put more specific whitelist entries
69 # before more general blacklist entries.
70 192.168.1.1 OK
71 192.168.0.0/16 REJECT
72
74 postmap(1), Postfix lookup table manager
75 regexp_table(5), format of regular expression tables
76 pcre_table(5), format of PCRE tables
77
79 Use "postconf readme_directory" or "postconf html_directory" to locate
80 this information.
81 DATABASE_README, Postfix lookup table overview
82
84 The CIDR table lookup code was originally written by:
85 Jozsef Kadlecsik
86 KFKI Research Institute for Particle and Nuclear Physics
87 POB. 49
88 1525 Budapest, Hungary
89
90 Adopted and adapted by:
91 Wietse Venema
92 IBM T.J. Watson Research
93 P.O. Box 704
94 Yorktown Heights, NY 10598, USA
95
96
97
98 CIDR_TABLE(5)