Commits

Zhang Huangbin committed 3495b78

Remove duplicate records in samples/cluebringer_extra.sql.

Comments (0)

Files changed (3)

iRedMail/ChangeLog

 iRedMail-0.8.6:
-    * Switch from Policyd-1.8 to Cluebringer on all Linux/BSD distributions.
+    * Works on openSUSE-13.1 milestone 4.
+    * Switch from Policyd-1.8 to Cluebringer on all Linux/BSD distributions,
+      with easier white/black/greylisting management.
     * Drop support for below releases:
         + Debian 6 (squeeze)
         + Gentoo

iRedMail/samples/cluebringer_extra.sql

 -- References: http://wiki.policyd.org/
 
 -- Priorities (Lower integer has higher priority):
---  4 No greylisting
 --  6 Whitelist 
+--  7 No greylisting
 --  8 Blacklist
 
 -- Cluebringer default priorities:
     FROM policies WHERE name='whitelisted_ips' LIMIT 1;
 
 -- Add access_control record to bypass whitelisted senders
-INSERT INTO access_control (PolicyID, Name, Verdict, Data)
-    SELECT id, 'whitelisted_senders', 'OK', 'Whitelisted sender'
+INSERT INTO access_control (PolicyID, Name, Verdict)
+    SELECT id, 'bypass_whitelisted_senders', 'OK'
     FROM policies WHERE name='whitelisted_senders' LIMIT 1;
-INSERT INTO access_control (PolicyID, Name, Verdict, Data)
-    SELECT id, 'whitelisted_domains', 'OK', 'Whitelisted domain'
+INSERT INTO access_control (PolicyID, Name, Verdict)
+    SELECT id, 'bypass_whitelisted_domains', 'OK'
     FROM policies WHERE name='whitelisted_domains' LIMIT 1;
-INSERT INTO access_control (PolicyID, Name, Verdict, Data)
-    SELECT id, 'whitelisted_ips', 'OK', 'Whitelisted IP'
+INSERT INTO access_control (PolicyID, Name, Verdict)
+    SELECT id, 'bypass_whitelisted_ips', 'OK'
     FROM policies WHERE name='whitelisted_ips' LIMIT 1;
 
 -- Sample: Add whitelisted sender, domain, IP
     SELECT id, '!%internal_ips,!%internal_domains', '%internal_domains', 0
     FROM policies WHERE name='blacklisted_ips' LIMIT 1;
 
--- Add access_control record to bypass whitelisted senders
+-- Add access control to reject whitelisted senders.
 INSERT INTO access_control (PolicyID, Name, Verdict, Data)
-    SELECT id, 'blacklisted_senders', 'OK', 'Blacklisted'
+    SELECT id, 'reject_blacklisted_senders', 'REJECT', 'Blacklisted sender'
     FROM policies WHERE name='blacklisted_senders' LIMIT 1;
 INSERT INTO access_control (PolicyID, Name, Verdict, Data)
-    SELECT id, 'blacklisted_domains', 'OK', 'Blacklisted'
+    SELECT id, 'reject_blacklisted_domains', 'REJECT', 'Blacklisted domain'
     FROM policies WHERE name='blacklisted_domains' LIMIT 1;
 INSERT INTO access_control (PolicyID, Name, Verdict, Data)
-    SELECT id, 'blacklisted_ips', 'OK', 'Blacklisted'
-    FROM policies WHERE name='blacklisted_ips' LIMIT 1;
-
--- Add access control to reject whitelisted senders.
-INSERT INTO access_control (PolicyID, Name, Verdict, Data)
-    SELECT id, 'reject_blacklisted_senders', 'REJECT', 'Blacklisted'
-    FROM policies WHERE name='blacklisted_senders' LIMIT 1;
-INSERT INTO access_control (PolicyID, Name, Verdict, Data)
-    SELECT id, 'reject_blacklisted_domains', 'REJECT', 'Blacklisted'
-    FROM policies WHERE name='blacklisted_domains' LIMIT 1;
-INSERT INTO access_control (PolicyID, Name, Verdict, Data)
-    SELECT id, 'reject_blacklisted_ips', 'REJECT', 'Blacklisted'
+    SELECT id, 'reject_blacklisted_ips', 'REJECT', 'Blacklisted IP'
     FROM policies WHERE name='blacklisted_ips' LIMIT 1;
 
 -- Sample: Add blacklisted sender, domain, IP
 -- Per-domain and per-user greylisting
 -- ------------------------------------
 INSERT INTO policies (Name, Priority, Disabled, Description)
-    VALUES ('no_greylisting', 4, 0, 'Disable grelisting for certain domain or users');
+    VALUES ('no_greylisting', 7, 0, 'Disable grelisting for certain domain or users');
 INSERT INTO policy_groups (Name, Disabled) VALUES ('no_greylisting', 0);
 INSERT INTO policy_members (PolicyID, Source, Destination, Disabled)
     SELECT id, '!%internal_ips,!%internal_domains', '%no_greylisting', 0
 -- INSERT INTO policy_group_members (PolicyGroupID, Member, Disabled)
 --    SELECT id, '@domain.com', 0 FROM policy_groups WHERE name='no_greylisting' LIMIT 1;
 
--- TODO Add necessary indexes with index name
--- policies.name
--- policy_group_members.member
--- policy_members.source, policy_members.destination
+-- TODO add indexes for columns used in Cluebringer core
+-- Add necessary indexes with index name
+CREATE INDEX policies_disabled on policies (disabled);
+CREATE INDEX policies_name ON policies (name);
+CREATE INDEX policy_groups_name ON policy_groups (name);
+CREATE INDEX policy_group_members_member ON policy_group_members (member);
+-- CREATE INDEX policy_members_source ON policy_members (source);
+-- CREATE INDEX policy_members_destination ON policy_members (destination);
 
 -- -------------------------------
 -- TODO Per-domain white/blacklist

iRedMail/samples/iredmail.mysql

-#---------------------------------------------------------------------
-# 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/>.
-#---------------------------------------------------------------------
+-- --------------------------------------------------------------------
+-- 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/>.
+-- --------------------------------------------------------------------
 
-#
-# Based on original postfixadmin template.
-# http://postfixadmin.sf.net
-#
+--
+-- Based on original postfixadmin template.
+-- http://postfixadmin.sf.net
+--
 
-#
-# Table structure for table admin
-#
+--
+-- Table structure for table admin
+--
 CREATE TABLE IF NOT EXISTS admin (
     username VARCHAR(255) NOT NULL DEFAULT '',
     password VARCHAR(255) NOT NULL DEFAULT '',
     INDEX (active)
 ) ENGINE=MyISAM;
 
-#
-# Table structure for table alias
-#
+--
+-- Table structure for table alias
+--
 CREATE TABLE IF NOT EXISTS alias (
     address VARCHAR(255) NOT NULL DEFAULT '',
     goto TEXT,
     INDEX (active)
 ) ENGINE=MyISAM;
 
-#
-# Table structure for table domain
-#
+--
+-- Table structure for table domain
+--
 CREATE TABLE IF NOT EXISTS domain (
     -- mail domain name. e.g. iredmail.org.
     domain VARCHAR(255) NOT NULL DEFAULT '',
     INDEX (active)
 ) ENGINE=MyISAM;
 
-#
-# Table structure for table domain_admins
-#
+--
+-- Table structure for table domain_admins
+--
 CREATE TABLE IF NOT EXISTS domain_admins (
     username VARCHAR(255) CHARACTER SET ascii NOT NULL DEFAULT '',
     domain VARCHAR(255) CHARACTER SET ascii NOT NULL DEFAULT '',
     INDEX (active)
 ) ENGINE=MyISAM;
 
-#
-# Table structure for table mailbox
-#
+--
+-- Table structure for table mailbox
+--
 CREATE TABLE IF NOT EXISTS mailbox (
     username VARCHAR(255) NOT NULL DEFAULT '',
     password VARCHAR(255) NOT NULL DEFAULT '',
     INDEX (active)
 ) ENGINE=MyISAM;
 
-#
-# Table structure for table sender_bcc_domain
-#
+--
+-- Table structure for table sender_bcc_domain
+-- TODO Merge into table 'domain' (domain.sender_bcc)
+--
 CREATE TABLE IF NOT EXISTS sender_bcc_domain (
     domain VARCHAR(255) NOT NULL DEFAULT '',
     bcc_address VARCHAR(255) NOT NULL DEFAULT '',
     INDEX (active)
 ) ENGINE=MyISAM;
 
-#
-# Table structure for table sender_bcc_user
-#
+--
+-- Table structure for table recipient_bcc_domain
+-- TODO Merge into table 'domain' (domain.recipient_bcc)
+--
+CREATE TABLE IF NOT EXISTS recipient_bcc_domain (
+    domain VARCHAR(255) NOT NULL DEFAULT '',
+    bcc_address VARCHAR(255) NOT NULL DEFAULT '',
+    created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+    modified DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+    expired DATETIME NOT NULL DEFAULT '9999-12-31 00:00:00',
+    active TINYINT(1) NOT NULL DEFAULT 1,
+    PRIMARY KEY (domain),
+    INDEX (bcc_address),
+    INDEX (expired),
+    INDEX (active)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table sender_bcc_user
+-- TODO Merge into table 'mailbox' (mailbox.sender_bcc)
+--
 CREATE TABLE IF NOT EXISTS sender_bcc_user (
     username VARCHAR(255) NOT NULL DEFAULT '',
     bcc_address VARCHAR(255) NOT NULL DEFAULT '',
     INDEX (active)
 ) ENGINE=MyISAM;
 
-#
-# Table structure for table recipient_bcc_domain
-#
-CREATE TABLE IF NOT EXISTS recipient_bcc_domain (
-    domain VARCHAR(255) NOT NULL DEFAULT '',
-    bcc_address VARCHAR(255) NOT NULL DEFAULT '',
-    created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
-    modified DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
-    expired DATETIME NOT NULL DEFAULT '9999-12-31 00:00:00',
-    active TINYINT(1) NOT NULL DEFAULT 1,
-    PRIMARY KEY (domain),
-    INDEX (bcc_address),
-    INDEX (expired),
-    INDEX (active)
-) ENGINE=MyISAM;
-
-#
-# Table structure for table recipient_bcc_user
-#
+--
+-- Table structure for table recipient_bcc_user
+-- TODO Merge into table 'mailbox' (mailbox.recipient_bcc)
+--
 CREATE TABLE IF NOT EXISTS recipient_bcc_user (
     username VARCHAR(255) NOT NULL DEFAULT '',
     bcc_address VARCHAR(255) NOT NULL DEFAULT '',
     INDEX (admin)
 ) ENGINE=MyISAM;
 
-#
-# IMAP shared folders. User 'from_user' shares folders to user 'to_user'.
-# WARNING: Works only with Dovecot 1.2+.
-#
+--
+-- IMAP shared folders. User 'from_user' shares folders to user 'to_user'.
+-- WARNING: Works only with Dovecot 1.2+.
+--
 CREATE TABLE IF NOT EXISTS share_folder (
     from_user VARCHAR(255) CHARACTER SET ascii NOT NULL,
     to_user VARCHAR(255) CHARACTER SET ascii NOT NULL,
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.