# greylisting-spp - A qmail-spp plugin implementing greylisting

#   Copyright (C) 2004 Peter Conrad <conrad@tivano.de>

#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License (version 2) as
#   published by the Free Software Foundation.

#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.

#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

all: whitelist.tcpserver

whitelist.tcpserver: whitelist_ip.txt
	sed 's=#.*==;s=[ 	]*$$==' < whitelist_ip.txt | \
	  grep -vE '^(127\.|192\.168|10|172\.(1[6-9]|2[0-9]|3[01])|)$$' | \
	  sed 's=^\([^\.]*\.[^\.]*\.[^\.]*\)$$=\1.=' | \
	  sed 's/$$/:allow,GL_WHITELISTED="1"/' >whitelist.tcpserver

clean:
	rm -f whitelist.tcpserver

# Do not change the following line:
# arch-tag: 2dc6d28d-0fea-49b7-bd30-dcc85f4f2402
