Commits

Zhang Huangbin committed 839fd2e

Code cleanup.

Comments (0)

Files changed (5)

iRedMail/functions/policyd.sh

     # Get SQL structure template file.
     tmp_sql="/tmp/policyd_config_tmp.${RANDOM}${RANDOM}"
     if [ X"${DISTRO}" == X"RHEL" -o X"${DISTRO}" == X"SUSE" ]; then
-        orig_policyd_sql_file="$(eval ${LIST_FILES_IN_PKG} ${PKG_POLICYD} | grep '/DATABASE.mysql$')"
+        cat > ${tmp_sql} <<EOF
+CREATE DATABASE ${POLICYD_DB_NAME};
+USE ${POLICYD_DB_NAME}
+-- Import SQL structure template.
+SOURCE ${SAMPLE_DIR}/policyd/DATABASE.mysql;
 
-        # Convert 'TYPE=' to 'ENGINE=' while creating tables.
-        perl -pi -e 's#TYPE=#ENGINE=#g' ${orig_policyd_sql_file}
-
-        cat > ${tmp_sql} <<EOF
-# Import SQL structure template.
-SOURCE ${orig_policyd_sql_file};
-
-# Grant privileges.
+-- Grant privileges.
 GRANT SELECT,INSERT,UPDATE,DELETE ON ${POLICYD_DB_NAME}.* TO "${POLICYD_DB_USER}"@localhost IDENTIFIED BY "${POLICYD_DB_PASSWD}";
 FLUSH PRIVILEGES;
 EOF
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         # dbconfig-common will initialize policyd database, grant privileges.
         cat > ${tmp_sql} <<EOF
-# Reset password.
+-- Reset password.
 USE mysql;
 UPDATE user SET Password=password("${POLICYD_DB_PASSWD}") WHERE User="${POLICYD_DB_USER}";
 FLUSH PRIVILEGES;
         fi
 
     elif [ X"${DISTRO}" == X'GENTOO' ]; then
-        orig_policyd_sql_file="$(eval ${LIST_FILES_IN_PKG} ${PKG_POLICYD} | grep '/DATABASE.mysql.bz2$')"
-
-        # orig_policyd_sql_file contains SQL command to create database.
-        bunzip2 -c ${orig_policyd_sql_file} > ${tmp_sql}
-
         cat >> ${tmp_sql} <<EOF
-# Grant privileges.
+CREATE DATABASE ${POLICYD_DB_NAME};
+USE ${POLICYD_DB_NAME}
+-- Import SQL structure template.
+SOURCE ${SAMPLE_DIR}/policyd/DATABASE.mysql;
+-- Grant privileges.
 GRANT SELECT,INSERT,UPDATE,DELETE ON ${POLICYD_DB_NAME}.* TO "${POLICYD_DB_USER}"@localhost IDENTIFIED BY "${POLICYD_DB_PASSWD}";
 FLUSH PRIVILEGES;
 EOF
 
     elif [ X"${DISTRO}" == X"FREEBSD" ]; then
-        # Template file will create database: policyd.
-        perl -pi -e 's#TYPE=#ENGINE=#g' /usr/local/share/doc/policyd/DATABASE.mysql
         cat > ${tmp_sql} <<EOF
-# Import SQL structure template.
-SOURCE /usr/local/share/doc/policyd/DATABASE.mysql;
-
-# Grant privileges.
+CREATE DATABASE ${POLICYD_DB_NAME};
+USE ${POLICYD_DB_NAME}
+-- Import SQL structure template.
+SOURCE ${SAMPLE_DIR}/policyd/DATABASE.mysql;
+-- Grant privileges.
 GRANT SELECT,INSERT,UPDATE,DELETE ON ${POLICYD_DB_NAME}.* TO "${POLICYD_DB_USER}"@localhost IDENTIFIED BY "${POLICYD_DB_PASSWD}";
 FLUSH PRIVILEGES;
 EOF
         :
     fi
 
+    # Import whitelist/blacklist shipped in policyd.
     cat >> ${tmp_sql} <<EOF
 USE ${POLICYD_DB_NAME};
-SOURCE ${SAMPLE_DIR}/policyd_blacklist_helo.sql;
+SOURCE ${SAMPLE_DIR}/policyd/whitelist.sql;
+SOURCE ${SAMPLE_DIR}/policyd/blacklist_helo.sql;
 EOF
 
-    # Import whitelist/blacklist shipped in policyd and provided by iRedMail.
-    if [ X"${DISTRO}" == X"RHEL" ]; then
-        cat >> ${tmp_sql} <<EOF
-SOURCE $(eval ${LIST_FILES_IN_PKG} ${PKG_POLICYD} | grep 'whitelist.sql');
-SOURCE $(eval ${LIST_FILES_IN_PKG} ${PKG_POLICYD} | grep 'blacklist_helo.sql');
-EOF
-
-    elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
-        # Create a temp directory.
-        tmp_dir="/tmp/$(${RANDOM_STRING})" && mkdir -p ${tmp_dir}
-
-        for i in $( eval ${LIST_FILES_IN_PKG} postfix-policyd | grep 'sql.gz$'); do
-            cp $i ${tmp_dir}
-            gunzip ${tmp_dir}/$(basename $i)
-
-            cat >> ${tmp_sql} <<EOF
-SOURCE ${tmp_dir}/$(basename $i | awk -F'.gz' '{print $1}');
-EOF
-        done
-    elif [ X"${DISTRO}" == X"FREEBSD" ]; then
-        cat >> ${tmp_sql} <<EOF
-SOURCE $(eval ${LIST_FILES_IN_PKG} "${PKG_POLICYD}*" | grep 'whitelist.sql');
-SOURCE $(eval ${LIST_FILES_IN_PKG} "${PKG_POLICYD}*" | grep 'blacklist_helo.sql');
-EOF
-    else
-        :
-    fi
-
     mysql -h${MYSQL_SERVER} -P${MYSQL_SERVER_PORT} -u${MYSQL_ROOT_USER} -p"${MYSQL_ROOT_PASSWD}" <<EOF
 $(cat ${tmp_sql})
 USE ${POLICYD_DB_NAME};

iRedMail/samples/policyd/DATABASE.mysql

+-- CREATE DATABASE policyd;
+-- USE policyd;
+  
+CREATE TABLE policy (
+  _rcpt        char(60) NOT NULL default '',
+  _optin       tinyint(1) unsigned NOT NULL default '1',
+  _priority    tinyint(1) unsigned NOT NULL default '0',
+  UNIQUE KEY _rcpt (_rcpt,_optin) 
+) ENGINE=MyISAM;
+
+CREATE TABLE policy_training (
+  _rcpt        char(60) NOT NULL default '',
+  _expire      int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _rcpt (_rcpt),
+  KEY _expire (_expire)
+) ENGINE=MyISAM;
+
+CREATE TABLE throttle (
+  _from        char(60) NOT NULL default '',
+  _count_max   mediumint(8) unsigned NOT NULL default '0',
+  _count_cur   mediumint(8) unsigned NOT NULL default '1',
+  _date        int(10) unsigned NOT NULL default '0',
+  _quota_cur   int(10) unsigned NOT NULL default '0',
+  _quota_max   int(10) unsigned NOT NULL default '0',
+  _time_limit  int(10) unsigned NOT NULL default '0',
+  _mail_size   int(10) unsigned NOT NULL default '0',
+  _count_tot   mediumint(8) unsigned NOT NULL default '1',
+  _rcpt_max    mediumint(8) unsigned NOT NULL default '0',
+  _rcpt_cur    mediumint(8) unsigned NOT NULL default '1',
+  _rcpt_tot    mediumint(8) unsigned NOT NULL default '1',
+  _abuse_cur   int(10) unsigned NOT NULL default '0',
+  _abuse_tot   int(10) unsigned NOT NULL default '0',
+  _log_warn    int(10) unsigned NOT NULL default '0',
+  _log_panic   int(10) unsigned NOT NULL default '0',
+  _priority    tinyint(1) unsigned NOT NULL default '0',
+  UNIQUE KEY _from (_from)
+) ENGINE=MyISAM;
+
+CREATE TABLE throttle_from_instance (
+  _instance    char(60) NOT NULL default '',
+  _from        char(60) NOT NULL default '',
+  _expire      int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _instance (_instance),
+  KEY _expire (_expire)
+) ENGINE=MyISAM;
+
+CREATE TABLE throttle_rcpt (
+  _rcpt        char(60) NOT NULL default '',
+  _count_max   mediumint(8) unsigned NOT NULL default '0',
+  _count_cur   mediumint(8) unsigned NOT NULL default '1',
+  _date        int(10) unsigned NOT NULL default '0',
+  _time_limit  int(10) unsigned NOT NULL default '0',
+  _count_tot   mediumint(8) unsigned NOT NULL default '1',
+  _abuse_cur   int(10) unsigned NOT NULL default '0',
+  _abuse_tot   int(10) unsigned NOT NULL default '0',
+  _log_warn    int(10) unsigned NOT NULL default '0',
+  _log_panic   int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _rcpt (_rcpt)
+) ENGINE=MyISAM;
+
+CREATE TABLE rcpt_acl (
+  _sender      char(60) NOT NULL default '',
+  _rcpt        char(60) NOT NULL default '',
+  _wblist      char(60) NOT NULL default '',
+  _priority    int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _rcpt (_rcpt,_sender)
+) ENGINE=MyISAM;
+
+CREATE TABLE triplet (
+  _from        char(60) NOT NULL default '',
+  _rcpt        char(60) NOT NULL default '',
+  _host        char(15) NOT NULL default '',
+  _datenew     int(10) unsigned NOT NULL default '0',
+  _datelast    int(10) unsigned NOT NULL default '0',
+  _count       smallint(5) unsigned NOT NULL default '0',
+  UNIQUE KEY _host (_host,_from,_rcpt),
+  KEY _datelast (_datelast),
+  KEY _datenew (_datenew)
+) ENGINE=MyISAM;
+  
+CREATE TABLE whitelist (
+  _whitelist   char(15) NOT NULL default '',
+  _description char(60) NOT NULL default '',
+  _expire      int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _whitelist (_whitelist),
+  KEY _expire (_expire)
+) ENGINE=MyISAM;
+
+CREATE TABLE whitelist_sender (
+  _whitelist   char(60) NOT NULL default '',
+  _description char(60) NOT NULL default '',
+  _expire      int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _whitelist (_whitelist),
+  KEY _expire (_expire)
+) ENGINE=MyISAM;
+
+CREATE TABLE whitelist_dnsname (
+  _whitelist   char(60) NOT NULL default '',
+  _description char(60) NOT NULL default '',
+  _expire      int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _whitelist (_whitelist),
+  KEY _expire (_expire)
+) ENGINE=MyISAM;
+
+CREATE TABLE blacklist (
+  _blacklist   char(15) NOT NULL default '',
+  _description char(60) NOT NULL default '',
+  _expire      int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _blacklist (_blacklist),
+  KEY _expire (_expire)
+) ENGINE=MyISAM;
+
+CREATE TABLE blacklist_helo (
+  _helo        char(60) NOT NULL default '',
+  UNIQUE KEY _helo (_helo)
+) ENGINE=MyISAM;
+
+CREATE TABLE blacklist_sender (
+  _blacklist   char(60) NOT NULL default '',
+  _description char(60) NOT NULL default '',
+  _expire      int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _blacklist (_blacklist),
+  KEY _expire (_expire)
+) ENGINE=MyISAM;
+
+CREATE TABLE blacklist_dnsname (
+  _blacklist   char(60) NOT NULL default '',
+  _description char(60) NOT NULL default '',
+  _expire      int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _blacklist (_blacklist),
+  KEY _expire (_expire)
+) ENGINE=MyISAM;
+
+CREATE TABLE spamtrap (
+  _rcpt        char(60) NOT NULL default '',
+  _active      tinyint(1) unsigned NOT NULL default '1',
+  UNIQUE KEY _rcpt (_rcpt,_active)
+) ENGINE=MyISAM;
+
+CREATE TABLE helo (
+  _host        char(15) NOT NULL default '',
+  _helo        char(60) NOT NULL default '',
+  _expire      int(10) unsigned NOT NULL default '0',
+  UNIQUE KEY _host (_host,_helo),
+  KEY _expire (_expire)
+) ENGINE=MyISAM;
+

iRedMail/samples/policyd/blacklist_helo.sql

+INSERT INTO blacklist_helo VALUES ('2die4.com');
+INSERT INTO blacklist_helo VALUES ('accountant.com');
+INSERT INTO blacklist_helo VALUES ('adexec.com');
+INSERT INTO blacklist_helo VALUES ('africamail.com');
+INSERT INTO blacklist_helo VALUES ('allergist.com');
+INSERT INTO blacklist_helo VALUES ('alumnidirector.com');
+INSERT INTO blacklist_helo VALUES ('archaeologist.com');
+INSERT INTO blacklist_helo VALUES ('arcticmail.com');
+INSERT INTO blacklist_helo VALUES ('artlover.com');
+INSERT INTO blacklist_helo VALUES ('asia.com');
+INSERT INTO blacklist_helo VALUES ('australiamail.com');
+INSERT INTO blacklist_helo VALUES ('berlin.com');
+INSERT INTO blacklist_helo VALUES ('bikerider.com');
+INSERT INTO blacklist_helo VALUES ('cartoday.com');
+INSERT INTO blacklist_helo VALUES ('catlover.com');
+INSERT INTO blacklist_helo VALUES ('cheerful.com');
+INSERT INTO blacklist_helo VALUES ('chemist.com');
+INSERT INTO blacklist_helo VALUES ('cis.co.za');
+INSERT INTO blacklist_helo VALUES ('clerk.com');
+INSERT INTO blacklist_helo VALUES ('cliffhanger.com');
+INSERT INTO blacklist_helo VALUES ('columnist.com');
+INSERT INTO blacklist_helo VALUES ('comic.com');
+INSERT INTO blacklist_helo VALUES ('compleatgolfer.co.za');
+INSERT INTO blacklist_helo VALUES ('consultant.com');
+INSERT INTO blacklist_helo VALUES ('counsellor.com');
+INSERT INTO blacklist_helo VALUES ('cutey.com');
+INSERT INTO blacklist_helo VALUES ('deliveryman.com');
+INSERT INTO blacklist_helo VALUES ('diplomats.com');
+INSERT INTO blacklist_helo VALUES ('doctor.com');
+INSERT INTO blacklist_helo VALUES ('doglover.com');
+INSERT INTO blacklist_helo VALUES ('dr.com');
+INSERT INTO blacklist_helo VALUES ('dublin.com');
+INSERT INTO blacklist_helo VALUES ('earthling.net');
+INSERT INTO blacklist_helo VALUES ('email.com');
+INSERT INTO blacklist_helo VALUES ('europe.com');
+INSERT INTO blacklist_helo VALUES ('execs.com');
+INSERT INTO blacklist_helo VALUES ('financier.com');
+INSERT INTO blacklist_helo VALUES ('gardener.com');
+INSERT INTO blacklist_helo VALUES ('gem.co.za');
+INSERT INTO blacklist_helo VALUES ('geologist.com');
+INSERT INTO blacklist_helo VALUES ('getawaytoafrica.com');
+INSERT INTO blacklist_helo VALUES ('gmail.com');
+INSERT INTO blacklist_helo VALUES ('google.com');
+INSERT INTO blacklist_helo VALUES ('graphic-designer.com');
+INSERT INTO blacklist_helo VALUES ('hairdresser.net');
+INSERT INTO blacklist_helo VALUES ('hot-shot.com');
+INSERT INTO blacklist_helo VALUES ('iafrica.co.za');
+INSERT INTO blacklist_helo VALUES ('iafrica.com');
+INSERT INTO blacklist_helo VALUES ('iname.com');
+INSERT INTO blacklist_helo VALUES ('incrediblemail.co.za');
+INSERT INTO blacklist_helo VALUES ('inorbit.com');
+INSERT INTO blacklist_helo VALUES ('insurer.com');
+INSERT INTO blacklist_helo VALUES ('japan.com');
+INSERT INTO blacklist_helo VALUES ('journalist.com');
+INSERT INTO blacklist_helo VALUES ('law.co.za');
+INSERT INTO blacklist_helo VALUES ('lawyer.com');
+INSERT INTO blacklist_helo VALUES ('legislator.com');
+INSERT INTO blacklist_helo VALUES ('lobbyist.com');
+INSERT INTO blacklist_helo VALUES ('london.com');
+INSERT INTO blacklist_helo VALUES ('loveable.com');
+INSERT INTO blacklist_helo VALUES ('lycos.com');
+INSERT INTO blacklist_helo VALUES ('mad.scientist.com');
+INSERT INTO blacklist_helo VALUES ('madrid.com');
+INSERT INTO blacklist_helo VALUES ('mail.com');
+INSERT INTO blacklist_helo VALUES ('mindless.com');
+INSERT INTO blacklist_helo VALUES ('minister.com');
+INSERT INTO blacklist_helo VALUES ('moscowmail.com');
+INSERT INTO blacklist_helo VALUES ('mselect.co.za');
+INSERT INTO blacklist_helo VALUES ('munich.com');
+INSERT INTO blacklist_helo VALUES ('musician.org');
+INSERT INTO blacklist_helo VALUES ('mweb.co.za');
+INSERT INTO blacklist_helo VALUES ('mweb.com');
+INSERT INTO blacklist_helo VALUES ('mwunitymail.mweb.co.za');
+INSERT INTO blacklist_helo VALUES ('myself.com');
+INSERT INTO blacklist_helo VALUES ('nav-gateway.mweb.co.za');
+INSERT INTO blacklist_helo VALUES ('netactive.co.za');
+INSERT INTO blacklist_helo VALUES ('nycmail.com');
+INSERT INTO blacklist_helo VALUES ('optician.com');
+INSERT INTO blacklist_helo VALUES ('outblaze.com');
+INSERT INTO blacklist_helo VALUES ('pediatrician.com');
+INSERT INTO blacklist_helo VALUES ('pix.co.za');
+INSERT INTO blacklist_helo VALUES ('pixie.co.za');
+INSERT INTO blacklist_helo VALUES ('playful.com');
+INSERT INTO blacklist_helo VALUES ('poetic.com');
+INSERT INTO blacklist_helo VALUES ('popstar.com');
+INSERT INTO blacklist_helo VALUES ('post.com');
+INSERT INTO blacklist_helo VALUES ('presidency.com');
+INSERT INTO blacklist_helo VALUES ('priest.com');
+INSERT INTO blacklist_helo VALUES ('programmer.net');
+INSERT INTO blacklist_helo VALUES ('publicist.com');
+INSERT INTO blacklist_helo VALUES ('realtyagent.com');
+INSERT INTO blacklist_helo VALUES ('registerednurses.com');
+INSERT INTO blacklist_helo VALUES ('repairman.com');
+INSERT INTO blacklist_helo VALUES ('representative.com');
+INSERT INTO blacklist_helo VALUES ('rescueteam.com');
+INSERT INTO blacklist_helo VALUES ('rome.com');
+INSERT INTO blacklist_helo VALUES ('saintly.com');
+INSERT INTO blacklist_helo VALUES ('samerica.com');
+INSERT INTO blacklist_helo VALUES ('sanfranmail.com');
+INSERT INTO blacklist_helo VALUES ('scientist.com');
+INSERT INTO blacklist_helo VALUES ('seductive.com');
+INSERT INTO blacklist_helo VALUES ('singapore.com');
+INSERT INTO blacklist_helo VALUES ('sociologist.com');
+INSERT INTO blacklist_helo VALUES ('soon.com');
+INSERT INTO blacklist_helo VALUES ('techie.com');
+INSERT INTO blacklist_helo VALUES ('technologist.com');
+INSERT INTO blacklist_helo VALUES ('tokyo.com');
+INSERT INTO blacklist_helo VALUES ('umpire.com');
+INSERT INTO blacklist_helo VALUES ('usa.com');
+INSERT INTO blacklist_helo VALUES ('whoever.com');
+INSERT INTO blacklist_helo VALUES ('winemag.co.za');
+INSERT INTO blacklist_helo VALUES ('winning.com');
+INSERT INTO blacklist_helo VALUES ('witty.com');
+INSERT INTO blacklist_helo VALUES ('writeme.com');
+INSERT INTO blacklist_helo VALUES ('yahoo.com');
+INSERT INTO blacklist_helo VALUES ('yours.com');
+
+-- Provided by iRedMail
+INSERT INTO blacklist_helo (_helo) VALUES ("126.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("163.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("163.net");
+INSERT INTO blacklist_helo (_helo) VALUES ("sohu.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("yahoo.com.cn");
+INSERT INTO blacklist_helo (_helo) VALUES ("yahoo.co.jp");
+INSERT INTO blacklist_helo (_helo) VALUES ("wz.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("taj-co.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("speedtouch.lan");
+INSERT INTO blacklist_helo (_helo) VALUES ("dsldevice.lan");
+INSERT INTO blacklist_helo (_helo) VALUES ("728154EA470B4AA.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("CF8D3DB045C1455.net");
+INSERT INTO blacklist_helo (_helo) VALUES ("dsgsfdg.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("se.nit7-ngbo.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("mail.goo.ne.jp");
+INSERT INTO blacklist_helo (_helo) VALUES ("n-ong_an.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("e5.il.n5tt.zj.cn");
+INSERT INTO blacklist_helo (_helo) VALUES ("meqail.teamefs-ine5tl.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("zzg.jhf-sp.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("din_glo-ng.net");
+INSERT INTO blacklist_helo (_helo) VALUES ("fda-cnc.ie.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("yrtaj-yrco.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("m.am.biz.cn");
+INSERT INTO blacklist_helo (_helo) VALUES ("xr_haig.roup.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("hjn.cn");
+INSERT INTO blacklist_helo (_helo) VALUES ("we_blf.com.cn");
+INSERT INTO blacklist_helo (_helo) VALUES ("netvigator.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("mysam.biz");
+INSERT INTO blacklist_helo (_helo) VALUES ("mail.teams-intl.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("seningbo.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("nblf.com.cn");
+INSERT INTO blacklist_helo (_helo) VALUES ("kdn.ktguide.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("zzsp.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("nblongan.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("dpu.cn");
+INSERT INTO blacklist_helo (_helo) VALUES ("mail.nbptt.zj.cn");
+INSERT INTO blacklist_helo (_helo) VALUES ("nbalton.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("cncie.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("xinhaigroup.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("5483e996d84343f.com");
+INSERT INTO blacklist_helo (_helo) VALUES ("yeah.net");

iRedMail/samples/policyd/whitelist.sql

+INSERT INTO whitelist (_whitelist,_description) VALUES ('127.%.%.%','# localhost');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('192.168.%.%','# private netblock');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('10.%.%.%','# private netblock');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('12.5.136.141','# Southwest Airlines (unique sender, no retry)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('12.5.136.142','# Southwest Airlines (unique sender, no retry)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('12.107.209.244','# kernel.org mailing lists (high traffic, unique sender per mail)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('12.107.209.250','# sourceware.org mailing lists (high traffic, unique sender per mail)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('63.82.37.110','# SLmail');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('64.7.153.18','# sentex.ca (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('64.12.137.%','# AOL (common pool) - http://postmaster.aol.com/servers/imo.html');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('64.12.138.%','# AOL (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('64.124.204.39','# moveon.org (unique sender per attempt)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('64.125.132.254','# collab.net (unique sender per attempt)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('64.233.170.%','# gmail (common server pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('65.82.241.160','# Groupwise?');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.100.210.82','# Groupwise?');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.135.209.%','# Ebay (for time critical alerts)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.135.197.%','# Ebay (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.162.216.166','# Groupwise?');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.206.22.82','# PLEXOR');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.206.22.83','# PLEXOR');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.206.22.84','# PLEXOR');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.206.22.85','# PLEXOR');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.218.66.%','# Yahoo Groups servers (common pool, no retry)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.218.67.%','# Yahoo Groups servers (common pool, no retry)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.218.69.%','# Yahoo Groups servers (common pool, no retry)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.27.51.218','# ljbtc.com (Groupwise)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.89.73.101','# Groupwise?');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('68.15.115.88','# Groupwise?');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('194.245.101.88','# Joker.com (email forwarding server)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('195.235.39.19','# Tid InfoMail Exchanger v2.20');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('195.238.2.105','# skynet.be (wierd retry pattern)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('195.238.2.124','# skynet.be (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('195.238.3.12','# skynet.be (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('195.238.3.13','# skynet.be (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('204.60.8.162','# Groupwise?');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('204.107.120.10','# Ameritrade (no retry)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('205.188.139.136','# AOL (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('205.188.139.137','# AOL (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('205.188.144.207','# AOL (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('205.188.144.208','# AOL (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('205.188.156.66','# AOL (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('205.188.157.%','# AOL (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('205.188.159.7','# AOL (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('205.206.231.%','# SecurityFocus.com (unique sender per attempt)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('205.211.164.50','# sentex.ca (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('207.115.63.%','# Prodigy (broken software that retries continually with no delay)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('207.171.168.%','# Amazon.com (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('207.171.180.%','# Amazon.com (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('207.171.187.%','# Amazon.com (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('207.171.188.%','# Amazon.com (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('207.171.190.%','# Amazon.com (common pool)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('213.136.52.31','# Mysql.com (unique sender)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('216.136.226.0','# Yahoo Mail?');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('216.157.204.5','# Groupwise?');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('217.158.50.178','# AXKit mailing list (unique sender per attempt)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('209.237.227.%','# SpamAssassin mailing list');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('66.35.250.%','# lists.sourceforge.net');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('196.25.240.%','# saix.net');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('196.4.160.%','# internet solutions (business smtp)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('196.35.77.%','# internet solutions (dialup smtp)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('196.25.69.%','# telkom');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('196.2.50.%','# mweb (dialup smtp)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('196.2.49.%','# mweb (business smtp)');
+INSERT INTO whitelist (_whitelist,_description) VALUES ('196.2.24.%','# mweb (business smtp)');
+INSERT INTO whitelist_dnsname (_whitelist,_description) VALUES ('bigfish.com','# bigfish.com has smtp servers behind multiple ips');

iRedMail/samples/policyd_blacklist_helo.sql

-/*
-#---------------------------------------------------------------------
-# This file is part of iRedMail, which is an open source mail server
-# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
-#
-# iRedMail is free software: you can 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
-# (at your option) any later version.
-#
-# iRedMail 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 iRedMail.  If not, see <http://www.gnu.org/licenses/>.
-#---------------------------------------------------------------------
-
-    Sample iptables rules. It should be localted at:
-        /etc/sysconfig/iptables
-
-    Shipped within iRedMail project:
-        http://iRedMail.googlecode.com/
-
-    Thanks all contributer(s):
-        * muniao <at> gamil.
-*/
-
-/*
-    This is the real HELO:
-        sohu.com    websmtp.sohu.com relay2nd.mail.sohu.com
-        126.com     m15-78.126.com
-        163.com     m31-189.vip.163.com m13-49.163.com
-        gmail.com   hu-out-0506.google.com
-
-    Some are imported from policyd blacklist_helo.sql.
-*/
-
-INSERT INTO blacklist_helo (_helo) VALUES ("126.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("163.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("163.net");
-INSERT INTO blacklist_helo (_helo) VALUES ("sohu.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("yahoo.com.cn");
-INSERT INTO blacklist_helo (_helo) VALUES ("yahoo.co.jp");
-INSERT INTO blacklist_helo (_helo) VALUES ("wz.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("taj-co.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("speedtouch.lan");
-INSERT INTO blacklist_helo (_helo) VALUES ("dsldevice.lan");
-INSERT INTO blacklist_helo (_helo) VALUES ("728154EA470B4AA.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("CF8D3DB045C1455.net");
-INSERT INTO blacklist_helo (_helo) VALUES ("dsgsfdg.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("se.nit7-ngbo.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("mail.goo.ne.jp");
-INSERT INTO blacklist_helo (_helo) VALUES ("n-ong_an.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("e5.il.n5tt.zj.cn");
-INSERT INTO blacklist_helo (_helo) VALUES ("meqail.teamefs-ine5tl.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("zzg.jhf-sp.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("din_glo-ng.net");
-INSERT INTO blacklist_helo (_helo) VALUES ("fda-cnc.ie.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("yrtaj-yrco.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("m.am.biz.cn");
-INSERT INTO blacklist_helo (_helo) VALUES ("xr_haig.roup.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("hjn.cn");
-INSERT INTO blacklist_helo (_helo) VALUES ("we_blf.com.cn");
-INSERT INTO blacklist_helo (_helo) VALUES ("netvigator.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("mysam.biz");
-INSERT INTO blacklist_helo (_helo) VALUES ("mail.teams-intl.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("seningbo.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("nblf.com.cn");
-INSERT INTO blacklist_helo (_helo) VALUES ("kdn.ktguide.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("zzsp.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("nblongan.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("dpu.cn");
-INSERT INTO blacklist_helo (_helo) VALUES ("mail.nbptt.zj.cn");
-INSERT INTO blacklist_helo (_helo) VALUES ("nbalton.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("cncie.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("xinhaigroup.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("5483e996d84343f.com");
-INSERT INTO blacklist_helo (_helo) VALUES ("yeah.net");
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.