Home page
ENGLISH
JAPANESE
Counter
Last update : 2017/05/03

S25R home page   http://www.gabacho-net.jp/en/anti-spam/
S25R whitelist download page   http://www.gabacho-net.jp/en/anti-spam/white-list.html
milter-greylist   http://hcpnet.free.fr/milter-greylist/

The bash script converts the S25R whitelist in the postfix format into the whitelist in the milter-greylist format

Introduction

When you make use of the S25R anti-spam system for the sendmail and the milter-greylist,
taking advantage of the published S25R whitelist, an email from the sender matching the S25R rules
can be received without any delay by greylisting function.

The format of the S25R whitelist published at the S25R home page is the format for the postfix.
This bash script converts it into the format for the milter-greylist.

Copyright, License

The "s25r-whiteconv.sh" bash script is copyright 2013 by Takao Abe. All rights reserved.
This software is free software, you can use and redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or any later version.

Format conversion

Published S25R whitelist for the postfixConverted S25R whitelist for the milter-greylist
/\.example\.jp$/Having alphabetsracl whitelist domain /\.example\.jp$/
sm_macro "whitelist-linenumber" "_" /\.example\.jp \[/
racl whitelist sm_macro "whitelist-linenumber"
or ( *1 )
racl whitelist domain /\.example\.jp$/
/^192\.0\.2\.1$/A single IP addressracl whitelist addr 192.0.2.1
/^172\.16\.9[6-9]\.[0-9]+$/The 3rd. octet and the 4th. octet
are predefined in the script ( *2 )
racl whitelist addr 172.16.96.0/22
/^192\.0\.2\.1(6[1-9]|7[0-4])$/The 4th. octet
is predefined in the script ( *3 )
racl whitelist addr 192.0.2.160/28
/^192\.0\.2\.22(8|9)$/The ( ) regex of the 4th. octet
expresses the CIDR /31 subnet
racl whitelist addr 192.0.2.228/31
/^192\.0\.2\.23[4-5]$/The [ ] regex of the 4th. octet
expresses the CIDR /31 subnet
racl whitelist addr 192.0.2.234/31
/^192\.0\.2\.1(3[2-4]|40)$/The ( ) and/or [ ] regex
expresses plural IP addresses ( *4 )
list "whitelist-linenumber" addr { 192.0.2.132 192.0.2.133 192.0.2.134 192.0.2.140 }
racl whitelist list "whitelist-linenumber"
Complex, etcCan not expand the regex ( *5 )# white-list.txt : Line=number, Reason

*1 The command-line option -p specifies converted verbs.
*2 The REGEX_OCTET3_4 array variable in the script.
*3 The REGEX_OCTET4 array variable in the script.
*4 The MAX_EXPAND_REGEX variable in the script limits the number of IP address to be expanded from the regex.
*5 In the published S25R on Jul. 10, 2013, 3 regex's can not be converted.

Download

Comment lines in the source code are written in Japanese.

s25r-whiteconv.sh

md5sum  397772b516071ef1190ede08a60ae739
sha1sum  a71b964fb848567fcd5328e73aca9d59e43ed306

Usage

s25r-whiteconv.sh [-b] [-p] inputfile outputfile

-b
Regex of domain that begins with \. is converted into non-regular expression.
This option is used in conjunction with the 'domainexact' keyword of the milter-greylist configuration file.
-p
Even if the IP address is successfully looked up, forged IP address is considered to be unresolved IP address.
The regex of the domain is converted into only 'racl whitelist domain'.
inputfile
The downloaded S25R whitelist for the postfix from S25R whitelist download page
outputfile
The converted whitelist for the milter-greylist

Copyright (C) 2013, Takao Abe. All rights reserved.

Another HTML-lint     W3C HTML Validator     W3C CSS Validator


ChangeLog
2017/05/03 Correct mistake of the subnetmask for the 4th octet '([1-9]|1[0-4])'.
2017/01/09 Command line option -b is added.
2015/02/08 Convert single FQDN host name to non-regular expression ( plane expression )
2013/07/13 Published