amavis.tsql 4.05 KB
Newer Older
Nigel Kukard's avatar
Nigel Kukard committed
1
# Amavis module schema
Wepongo's avatar
Wepongo committed
2
# Copyright (C) 2009-2015, AllWorldIT
Nigel Kukard's avatar
Nigel Kukard committed
3
# Copyright (C) 2008, LinuxRulz
Nigel Kukard's avatar
Nigel Kukard committed
4
#
Nigel Kukard's avatar
Nigel Kukard committed
5
6
7
8
# This program 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 2 of the License, or
# (at your option) any later version.
Nigel Kukard's avatar
Nigel Kukard committed
9
#
Nigel Kukard's avatar
Nigel Kukard committed
10
11
12
13
# 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.
Nigel Kukard's avatar
Nigel Kukard committed
14
#
Nigel Kukard's avatar
Nigel Kukard committed
15
16
17
# 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18

Nigel Kukard's avatar
Nigel Kukard committed
19
/* Amavisd-new integration for PolicyD */
20

21
CREATE TABLE @PREFIX@amavis_rules (
22
23
24
25
	ID			@SERIAL_TYPE@,

	PolicyID		@SERIAL_REF_TYPE@,

26
	Name			VARCHAR(255) NOT NULL,
27
28
29
30
31
32
33
34

/*
Mode of operation (the _m columns):

	This is done with the _m column names

	0 - Inherit
	1 - Merge  (only valid for lists)
Nigel Kukard's avatar
Nigel Kukard committed
35
	2 - Overwrite
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

*/


	/* Bypass options */
	bypass_virus_checks	SMALLINT,
	bypass_virus_checks_m	SMALLINT NOT NULL DEFAULT '0',

	bypass_banned_checks	SMALLINT,
	bypass_banned_checks_m	SMALLINT NOT NULL DEFAULT '0',

	bypass_spam_checks	SMALLINT,
	bypass_spam_checks_m	SMALLINT NOT NULL DEFAULT '0',

	bypass_header_checks	SMALLINT,
	bypass_header_checks_m	SMALLINT NOT NULL DEFAULT '0',


	/* Anti-spam options: NULL = inherit */
	spam_tag_level		FLOAT,
	spam_tag_level_m	SMALLINT NOT NULL DEFAULT '0',

	spam_tag2_level		FLOAT,
	spam_tag2_level_m	SMALLINT NOT NULL DEFAULT '0',

	spam_tag3_level		FLOAT,
	spam_tag3_level_m	SMALLINT NOT NULL DEFAULT '0',

	spam_kill_level		FLOAT,
	spam_kill_level_m	SMALLINT NOT NULL DEFAULT '0',

	spam_dsn_cutoff_level	FLOAT,
	spam_dsn_cutoff_level_m	SMALLINT NOT NULL DEFAULT '0',

	spam_quarantine_cutoff_level	FLOAT,
	spam_quarantine_cutoff_level_m	SMALLINT NOT NULL DEFAULT '0',

	spam_modifies_subject	SMALLINT,
	spam_modifies_subject_m	SMALLINT NOT NULL DEFAULT '0',

76
	spam_tag_subject	VARCHAR(255),  /* _SCORE_ is the score, _REQD_ is the required score */
77
	spam_tag_subject_m	SMALLINT NOT NULL DEFAULT '0',
Nigel Kukard's avatar
Nigel Kukard committed
78

79
	spam_tag2_subject	VARCHAR(255),
80
	spam_tag2_subject_m	SMALLINT NOT NULL DEFAULT '0',
Nigel Kukard's avatar
Nigel Kukard committed
81

82
	spam_tag3_subject	VARCHAR(255),
83
84
85
86
	spam_tag3_subject_m	SMALLINT NOT NULL DEFAULT '0',


	/* General checks: NULL = inherit */
87
	max_message_size	BIGINT,  /* in Kbyte */
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
	max_message_size_m	SMALLINT NOT NULL DEFAULT '0',

	banned_files		TEXT,
	banned_files_m		SMALLINT NOT NULL DEFAULT '0',


	/* Whitelist & blacklist */
	sender_whitelist	TEXT,
	sender_whitelist_m	SMALLINT NOT NULL DEFAULT '0',

	sender_blacklist	TEXT,
	sender_blacklist_m	SMALLINT NOT NULL DEFAULT '0',


	/* Admin notifications */
103
	notify_admin_newvirus	VARCHAR(255),
104
105
	notify_admin_newvirus_m	SMALLINT NOT NULL DEFAULT '0',

106
	notify_admin_virus	VARCHAR(255),
107
108
	notify_admin_virus_m	SMALLINT NOT NULL DEFAULT '0',

109
	notify_admin_spam	VARCHAR(255),
110
111
	notify_admin_spam_m	SMALLINT NOT NULL DEFAULT '0',

112
	notify_admin_banned_file	VARCHAR(255),
113
114
	notify_admin_banned_file_m	SMALLINT NOT NULL DEFAULT '0',

115
	notify_admin_bad_header	VARCHAR(255),
116
117
118
119
	notify_admin_bad_header_m	SMALLINT NOT NULL DEFAULT '0',


	/* Quarantine options */
120
	quarantine_virus	VARCHAR(255),
121
122
	quarantine_virus_m	SMALLINT NOT NULL DEFAULT '0',

123
	quarantine_banned_file	VARCHAR(255),
124
125
	quarantine_banned_file_m	SMALLINT NOT NULL DEFAULT '0',

126
	quarantine_bad_header	VARCHAR(255),
127
	quarantine_bad_header_m	SMALLINT NOT NULL DEFAULT '0',
Nigel Kukard's avatar
Nigel Kukard committed
128

129
	quarantine_spam		VARCHAR(255),
130
131
132
	quarantine_spam_m	SMALLINT NOT NULL DEFAULT '0',


133
	/* Interception options */
134
	bcc_to			VARCHAR(255),
135
136
137
	bcc_to_m		SMALLINT NOT NULL DEFAULT '0',


138
139
140
141
	Comment			VARCHAR(1024),

	Disabled		SMALLINT NOT NULL DEFAULT '0',

142
	FOREIGN KEY (PolicyID) REFERENCES @PREFIX@policies(ID)
143
144
) @CREATE_TABLE_SUFFIX@;

145
INSERT INTO @PREFIX@amavis_rules
146
147
148
149
150
	(
		PolicyID,
		Name,
		max_message_size,max_message_size_m,
		bypass_banned_checks, bypass_banned_checks_m
Nigel Kukard's avatar
Nigel Kukard committed
151
152
	)
	VALUES
153
154
155
156
157
158
159
	(
		1,
		'Default system amavis policy',
		100000,2,
		1,2
	);