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\fB <\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# The \fInetwork_mask\fR is the number of high-order bits in 39# the \fInetwork_address\fR that the search string must match. 40# 41# Before comparisons are made, lookup keys and table entries 42# are converted from string to binary. Therefore table entries 43# will be matched regardless of redundant zero characters. 44# 45# Note: address information may be enclosed inside "[]" but 46# this form is not required. 47# 48# IPv6 support is available in Postfix 2.2 and later. 49# .IP "\fInetwork_address result\fR" 50# When a search string matches the specified network address, 51# use the corresponding \fIresult\fR value. 52# .IP "blank lines and comments" 53# Empty lines and whitespace-only lines are ignored, as 54# are lines whose first non-whitespace character is a `#'. 55# .IP "multi-line text" 56# A logical line starts with non-whitespace text. A line that 57# starts with whitespace continues a logical line. 58# TABLE SEARCH ORDER 59# .ad 60# .fi 61# Patterns are applied in the order as specified in the table, until a 62# pattern is found that matches the search string. 63# EXAMPLE SMTPD ACCESS MAP 64# .nf 65# /etc/postfix/main.cf: 66# smtpd_client_restrictions = ... cidr:/etc/postfix/client.cidr ... 67# 68# /etc/postfix/client.cidr: 69# # Rule order matters. Put more specific whitelist entries 70# # before more general blacklist entries. 71# 192.168.1.1 OK 72# 192.168.0.0/16 REJECT 73# .fi 74# SEE ALSO 75# postmap(1), Postfix lookup table manager 76# regexp_table(5), format of regular expression tables 77# pcre_table(5), format of PCRE tables 78# README FILES 79# .ad 80# .fi 81# Use "\fBpostconf readme_directory\fR" or 82# "\fBpostconf html_directory\fR" to locate this information. 83# .na 84# .nf 85# DATABASE_README, Postfix lookup table overview 86# HISTORY 87# CIDR table support was introduced with Postfix version 2.1. 88# AUTHOR(S) 89# The CIDR table lookup code was originally written by: 90# Jozsef Kadlecsik 91# KFKI Research Institute for Particle and Nuclear Physics 92# POB. 49 93# 1525 Budapest, Hungary 94# 95# Adopted and adapted by: 96# Wietse Venema 97# IBM T.J. Watson Research 98# P.O. Box 704 99# Yorktown Heights, NY 10598, USA 100# 101# Wietse Venema 102# Google, Inc. 103# 111 8th Avenue 104# New York, NY 10011, USA 105#-- 106