~semi-hallikas/sspamm/3.0-devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
###
### Configuration file for Semi's Spam Milter
###
### When filter starts configuration file (sspamm.conf) would be searched
### from paths in this order: Current directory, /etc/sspamm and /etc
###
[main]
# Name of our filter, must be same as defined in sendmail
name:		sspamm
#
# In /etc/mail/sendmail.mc you should define same port, here is also
# information about flags used in 'INPUT_MAIL_FILTER' macro:
#
# /********************* This stuff goes to sendmail.mc ********************
#
#dnl # F=
#dnl # (If a filter is unavailable or unresponsive and no 'F'lags have been
#dnl #  specified, the MTA will continue normal handling of the current
#dnl #  connection. The MTA will try to contact the filter again on each
#dnl #  new connection.)
#dnl # T - TempFail
#dnl # R - Reject
#dnl # T=
#dnl # C - Connection
#dnl # S - Sending Data
#dnl # R - Reading Data
#dnl # E - Overall timeout between sending end-of-message to filter and waiting for the final acknowledgment.
#
#define(`MILTER', 1)
#define(`confMILTER_MACROS_CONNECT',`t, b, j, _, {daemon_name}, {if_name}, {if_addr}')dnl
#define(`confMILTER_MACROS_HELO',`s, {tls_version}, {cipher}, {cipher_bits}, {cert_subject}, {cert_issuer}')dnl
#define(`confMILTER_MACROS_ENVFROM',`i, {auth_type}, {auth_authen}, {auth_ssf}, {auth_author}, {mail_mailer}, {mail_host}, {mail_addr}')dnl
#define(`confMILTER_MACROS_ENVRCPT',`{rcpt_mailer}, {rcpt_host}, {rcpt_addr}')dnl
#
#INPUT_MAIL_FILTER(`sspamm', `S=inet:7999@localhost, F=T, T=C:10m;E:10m;R:10m;S:5m')dnl
#
# ********************* This stuff goes to sendmail.mc ********************/
#
# Define port/socket that filter would listen.
port:		inet:7999
#port:		local:/tmp/sspamm.sock

###
### Files and Paths
###
#
# If sspamdir path is not defined, files would be used/saved/created in same
# that that configuration file is in.
sspammdir:	.
tmpdir:		/dev/shm
pid:		sspamm.pid
logfile:	sspamm.log

##
## On/Off parameters can be used with values: False, No, 0 or True, Yes, 1
##

#### timeme and syslog is going to be removed?
#
# Define debugfile if you want debug logging into file
debugfile:	debug.log

# Path to create mail 'var' files (for debug purpouses)
savedir:	saved

# Save information about time spend in different steps while filtering
# Times are shown on saved .var file, or on debug log with higher verbose
# level.
timeme:		Yes

# Verbose can also be numerical for more verbose output. Verbose levels are:
#	0 - No debug logging at all
#	...
#	3 - Full debug information
verbose:	2

# Make detailed rejections
#detailed:	True

#
#
# ***** NOTICE, YOU SHOULD DISABLE THIS AFTER YOU HAVE CONFIGURED FILTER *****
#
#
# If WatchMode is True, all mails are passed without modifying anything, only
# logging would take place
#
watchmode:	Yes

##############################################################################
[filter]
#
# We define default tests here. Possible values are:
# connect	Our white-/blacklisting
# helo		Imitates to be us
# ipfromto	Sender/Recipient matching
# rbl		Blacklisting
# dyndns	Dynamic DNS-name
# bayesian	Bayesian SPAM/HAM probability
# wordscan	Scan message body for strings
# vscan		Virus scanning with BDC ... (DISABLED!)
#
tests:		connect, helo, accept, block, ipfromto, samefromto, headers, dyndns, wordscan, bayesian, rbl, charset
#
# Note! If bayesian is before RBL/DynDNS mail with 'HAM' class is passed as
# 'UNSURE' if RBL/DynDNS matches... If Bayesian is after them, test rules
# are used.
#
# We only filter for these domains. It is possible to define different rules for domains.
# You can define scans to use with domain match (below, only those 3 tests are done):
# 	foobar.com, ourdomain.org:	connect, helo
# ... append 'non default' test for domain:
#	tests: connect, helo, ipfromto
#	domains:
#		ourdomain.org:	+rbl
#		.*
# Or opt-out scans from default tests:
#	other.com:			!bayesian
#
# Domains can be defined here in (real) regexp
domains:
		somedomain1.(net|fi|se|as|ch|be|gr): ipfromto
		test.com
		(guest1|guest2|guest3).com
		(fi.|se.)?(customer|alias).com: !charset
		foobar.net|foo.net|foo.com|thisisfoo.org
		domain2.(com|net|fi|se|dk): accept, samefromto, connect, helo, block, ipfromto, dyndns, headers, wordscan, bayesian, rbl, charset
		ourdomain.org, someother.net, anyone.com
		domain.org: !bayesian
		blocked.com: block
# Note: .* below means ANY ADDRESS
		.*

#
# It is possible to define few special things on domains. These are made in
# filter/rules section. It is possible to group multiple domains to single
# name, so there are not multiple 'domaindb' files for same (real) domain
# with multiple domain names. Rules section does not affect what domains are
# filtered.
#	crescom.*|on(-)?demand\..*: name=crescom
#
# Other rules available:
#	(!)watch	You can (un)set 'debugmode' for individual domain
#	flagall		Flag EVERY action, all mails are passed but flagged.
#
# Test based parameters that can be used here:
#	Bayesian:	ratio=[value], msgsneeded=[value], (!)usedomaindb, (!)dbtrain, (!)savembox
#
rules:
#		testdomain.org: flagall
# ALWAYS filter this domain, even in watch mode!
#		^somedomain1\.: name=somedomain1, !watch
#		^(guest1|guest2)\.: name=guest, msgsneeded=4000, ratio=500:500
#		(domain2|another).com: msgsneeded=100
#		(\.)?foobar\.: name=foobar
#		^ourdomain.*: name=our


[connect]
action:		Flag
# Outgoing mail is always ACCEPTED without logging
ignore_ip:	127.0.0.1|192.168.|10.|42.42.4[1-2].

[helo]
action:		Flag

[accept]
rules:
		(email-\d\d\d|outbound\d.den|mx\d.\w\w\w).paypal.com:(payment@|paypal@email.|service@intl.)paypal.com:
		.tfbnw.net:notification[\d\w._-]+@facebookmail.com:
		mx(smf)?pool\d\d.ebay.com:(checkout|status|member|ebay|[\d\w._-]+)@.*ebay\.\w\w(\w)?:
		(smfcamppool\d\d.emailebay.com|emasmail\d.emarsys.net):ebay.*(@reply\d\.ebay\.com|@ebay\.emarsys\.net):
		(wcmx\d)?.valvesoftware.com:.*@valvesoftware.com:
		ticketmaster.com:.*ticketmaster.com:
		(itmsout)?.apple.com:([\d\w._-]+@insideapple.|do_not_reply@)apple.com:

[block]
rules:
# Matches as sender AND recipient
		firstname.(last|sure)name@|etunimi.sukunimi@
# Matches as recipient
		spamtrap@somewhere.net$
		(unknown.user|another.one).*@somedomain.org$
# Not real mail domain
		@mail-disabled.com$

[samefromto]
action:		Flag