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