~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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
###
### 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:		sspamm3

# If child threads is used. Configuration is checked and reloaded in real
# time. Negative effect with threads is that you can't use signals and not
# even CTRL-C to quit. Even then, you SHOULD use childs.
childs:		True
#
# 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(`sspamm3', `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:8003
#port:		local:/var/sspamm/sspamm3.sock

###
### Files and Paths
###
### It is possible to use 'macros' on next values: pid, savedir, logfile, rrdfile and crcfile
### %h - hostname (short)
### %c - path of configuration file used
### %s - value in sspammdir variable
### %n - value in name variable
#
# If sspamdir path is not defined, files would be used/saved/created in same
# that that configuration file is in.
sspammdir:	/var/sspamm
tmpdir:		/dev/shm

# Make backup of resident (memory) configuration file, before loading new.
confbackup:	False

# If pid file is removed while sspamm is running in daemon mode (as it
# should), sspamm will quite nicely. This is CORRECT way to quit from
# sspamm. Milters does not like signals.
pid:		%n.pid

# Note! If logfile is renamed, sspamm will close and open new logfile with
# original name. This allows logrotate.
logfile:	%n.log

rrdfile:	%c/%n-%h.rrd
crcfile:	sspamm.crc

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

# Save unsure and HAM messages only. Usefull for training purpouses.
nonspamonly:	True

# Verbose is numerical value. Verbose levels are:
#	0 - No output at all
#	1 - warning conditions, error, critical
#	2 - Informational (for quick debug) or normal but significant condition
#	3 - debug-level messages
#	4 - full debug, without is_listed flood
#	5 - full debug, with is_listed tests
#	6 - quickview of filtering, without debug
#	7 - log output
#
verbose:	1
# Verbose mode for offline testing
offline:	3

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

# 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

##
## Keep checksum database of passed message body. Also makes crc test possible.
##
crcsave:	True
crchours:	12

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

##############################################################################
[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
#
defaulttests: connect, helo, accept, crc, block, samefromto, ipfromto, headers, wordscan, dyndns, charset, bayesian, rbl

domains:
### TODO: Samples how these matches
#
# 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. Note, first match breaks.
#		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
#		blocked.com: block
# All these three are same:
#		sample1.org: all,-helo
#		sample1.net: -helo
#		sample1.com: !helo
# Also these two:
#		sample2.org: +charset
#		sample2.org: all,+charset
#
# Note: .* below matches ALL ADDRESS
		.*

rules:
### TODO: Samples how these matches
#
# It is possible to define few special things on domains. These are made in
# filter/rules section. Rules section does not affect what domains are
# filtered.
		(sspamm|spam)(-)?(filter)?.(com|net): flagall
### ALWAYS filter this domain, even in watch mode!
		hallikas.com: flagall
		septem.fi: watch
		sspamm.com: !watch

[actions]
# It could be good idea to use action comment "(?#flag)" as prefix of regexp
# rule. But this is for backup if comment is not there. More about actions
# on 'rules' section.
accept:		Accept
block:		Delete
connect:	Delete
helo:		Delete
samefromto:	Delete
ipfromto:	Flag
dyndns:		Flag
rbl:		Delete
charset:	Flag
headers:	Flag
wordscan:	Flag
bayesian:	Flag
crc:		Delete

[settings]
maxbodysize:	1024
ipservers:
		(?#delete)dnsbl-3.uceprotect.net
		(?#delete)dnsbl-2.uceprotect.net
		(?#delete)dnsbl-1.uceprotect.net
# Sometimes these have false positives
#		(?#reject)bl.spamcop.net
		(?#reject)sbl.spamhaus.org
		(?#reject)psbl.surriel.com
		(?#reject)cbl.abuseat.org
		(?#reject)xbl.spamhaus.org
		(?#flag)b.barracudacentral.org


### NOTE! comments in rules!
### You can use multiple comments on one line, but if you START regexp line with comment,
### it is used as 'action' what LINE (not single rule) should do!
### So look carefully on next examples:
#
# Folowing actions are available:
# (?#delete)	- Delete message without notifying of recipient/sender
# (?#reject)	- Reject, Don't deliver. Generates NDR. Not recommented!
# (?#flag)	- Flag message as {SPAM}:, continue testing
# (?#flag+)	- Flag message as {SPAM}: and ACCEPT it for delivery
# (?#accept)	- Accept message for delivery
#
# On accept section:
# (?#skip)	- If 'skip' in 'accept', skip 'block' testing.
# (?#break)	- Break current testing ruleset, continue testing
#
# On DynDNS section:
# (?#authmx)	- allow dyndns after this, but do RBL test
# (?#skip)	- allow dyndns addresses and skip RBL for this match
# (?#ignore)	- don't allow dyndns relay, but don't do RBL test for this host 
# (?#break)	- allow dyndns, break rbl tests
#
#
# Note. Example of skip, break combination in accept/block:
# =========================================================
# ----- CUT -----
# accept:
## If sender AND/OR recipient is abuse@ flag and accept it.
#		(?#flag+):abuse@
#		(?#skip):(hostmaster|postmaster|webmaster|website|sspamm|[A-Za-z]+\.[A-Za-z]+)@sspamm.com$
#		(?#break)@sspamm.com$
#block:
#		(?#delete)@sspamm.com$
# ----- CUT -----
#
# Ruleset above block EVERYTHING except addresses defined in accept-skip
# rule. Skip is not same as accept, because after skip all other rules are
# tested.
#
#
# More Notes/Samples!
# ===================
# If first does not match, but second does. Mail WOULD BE REJECTED!
#		(?#reject)smtp-gw\d.sspamm.com|(?#accept)^smtp
# This is correct way to write above
#		(?#reject)smtp-gw\d.sspamm.com
#		(?#accept)^smtp
# 
# This is bit dangerous, because system parses first comment as action:
#		(?#smilehouse.com)193.94.205.129|(?#datacapture.co.uk)adsl-217.146.111.67.merula.net|(?#mail.nordvalls.se)85.30.130.17
# If must start with comment, but without action, this is beter way to write it:
#		(?#)(?#smilehouse.com)193.94.205.129|(?#datacapture.co.uk)adsl-217.146.111.67.merula.net|(?#mail.nordvalls.se)85.30.130.17
# This is valid line. All matches on this line, is detected as authmx host.
#		(?#authmx)(?#smilehouse.com)193.94.205.129|(?#datacapture.co.uk)adsl-217.146.111.67.merula.net|(?#mail.nordvalls.se)85.30.130.17


[rules]
##############################################################################################################################
###
###
###
##############################################################################################################################
## Hide rules make possible to hide hosts from received/ipfromto tests. You
## should add hosts here, that relays email to your system often. gmail and
## iki.fi for example. Technical detail, received lines are processed
## recursively, lines matched to hide rules are ignored when creating
## received table, so those lines are not matched to any rules!
hide:
		^(192\.168\.\d{1,3}\.\d{1,3}|10\.\d{1,3}\.\d{1,3}\.\d{1,3})
		(silppuri|jatkuu|taas|leimasin|ikuisesti|ikiaikainen).iki.fi
		smtp\d[ab].crescom.fi

##############################################################################################################################
###
###
###
##############################################################################################################################
### Connect - Personal 'firewall'
## Matches is tested against IP and DNS. (Not recursive. Should it be?)
connect:
# 127.0.0.1 test is also hardcoded, here is sample how to do it:
		(?#accept)^127\.0\.0\.1$
# If reverse DNS returns localhost, delete message. PTR should NEVER point
# to localhost. (except on 127. block)
		(?#delete)^localhost$
# Local, internal, network are accepted
		(?#accept)^(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})$
		(?#accept)^193\.93\.133\.\d{1,3}
# Our IP/DNS Blacklist
		(?#delete)^(41.178.206.33|59.97.228.77|62.33.151.228|93.46.245.100|94.178.74.109|95.56.110.10|95.79.45.230|111.65.136.240|114.34.95.232|117.207.84.67|119.42.126.187|124.107.86.195|188.93.135.34|190.178.93.116|201.254.80.39|201.34.214.16)$
		(?#delete)mail.cclite.com|ertadmires.com|182.18.31.\d{1,3}
		(?#delete)altmx.ertadmires.com|gw-zone-\d.evpanet.com
# Known "spammers"
		(?#flag+)(relay\d+.)?sendserver.(emailserver68.)?dk
		(?#reject)\.adsl$

##############################################################################################################################
###
###
###
##############################################################################################################################
helo:
		(?#reject)^aol.com$
		(?#accept)plesk.isolta.info$

##############################################################################################################################
###
###
###
##############################################################################################################################
### accept/block/ipfromto - test [ip/dns]:[from]:[to] combinations for match.
##
## Accept and Block are TESTED WITH ALL [ip/dns]:[from]:[to] combinations,
## These two MUST keep as light as possible. Mostly these are used for quick
## block of recipients. Note these usually should have recipient to match.
##
## NOTE! Most rules (sender based) should be in ipfromto because that is
## tested for only first recipient.
##
accept:
# If sender AND/OR recipient is abuse@ flag it.
		(?#flag+):abuse@

# If using 'allowed' recipient list. Add allowed recipients here, like this:
		(?#skip):(hostmaster|postmaster|webmaster|website)@hallikas.com$
		(?#skip):(wlan|wlan2|secure|symbian|giveaway|notify|iphone|growl|blog)@hallikas.com$
		(?#skip):(root|semi|semi2nd|sami|samipekka.hallikas|sami-pekka.hallikas|hilkka|jonne|jaska|mari|ville|laura|lasse)@hallikas.com$
#		(?#skip):([A-Za-z]+\.[A-Za-z]+|[a-z]+)@hallikas.com$
		(?#break)@hallikas.com$

##############################################################################################################################
###
###
###
##############################################################################################################################
block:
# Continued from accept part. All allowed recipients are matched in 'accept'
# section with 'skip' action. Now it is safe to delete others.
		(?#delete)@hallikas.com$

# This should/could be in ipfromto, but we must make as quick match as possible.
# Matches as sender AND recipient
		(?#delete)@rolex.com:
		(?#delete)firstname.(last|sure)name(\w)?@|etunimi.sukunimi(\w)?@

# SpamTrap. Matches as recipient, note end of line mark ($).
		(?#delete)roskaposti@hallikas.com$
		(?#flag)(prizecrazy|imustlotto)@peltonen.com$

##############################################################################################################################
###
###
###
##############################################################################################################################
ipfromto:
# NOTE! I should use \. instead of plain . ... Mainly because . matches
# EVERYTHING, but \. matches only dot. But I'm lazy and I like to write
# readable rules. So it is VERY VERY likely that .osuuspankki.fi would match
# with . same way as with \.
#
		(?#accept)\.google\.com:[\w-]+(\.[\w-]+)?@(unelmakoulu|kauniaistenlukio).fi:[\w-]+(\.[\w-]+)?@kauniainen.fi
		(?#accept)\.google\.com:[\w\d_.=+-]+@gmail.com:
# SpamFighters should be trusted senders
		(?#accept)^mail\d{1,3}.messagelabs.com:
#
		(?#accept)(smfcamppool\d\d.emailebay.com|emasmail\d.emarsys.net):ebay.*(@reply\d\.ebay\.com|@ebay\.emarsys\.net):
		(?#accept)mx(smf)?pool\d\d.ebay.com:(checkout|status|member|ebay|[\d\w._-]+)@.*ebay\.\w\w(\w)?:

		(?#accept)(sms1-els\d\d\d-\d\d\d.mm)?.ticketmaster.com:[A-Za-z0-9_.=@+-]+ticketmaster.com:
		(?#accept)(sms1-els\d\d\d-\d\d\d.mm)?.ticketmaster.com:.*ticketmaster.com:
		(?#accept)ticketmaster.com:.*ticketmaster.com:


### Known services
		(?#accept)sink.edelkey.net:[\w\.-]+@espoo.fi
		(?#accept)webmail1-vallila2.fe.helsinki.fi:[\w\.-]+@helsinki.fi
		(?#accept).osuuspankki.fi:[\w-]+(\.[\w-]+)?@pohjola.fi:
		(?#accept)mail.reima.fi:\w+.\w+@reima.fi
		(?#accept)194.100.70.[6789]\d:(apache|\w+(\.\w+))@verkkokauppa.com:
		(?#accept).nodeta.fi:robot@nimenhuuto.com:
		(?#accept).netlogmail.com:notification\+[\w\d]+@netlogmail.com:
		(?#accept)(hauki|koti).tapanitarvainen.fi:jasenasiat\+\d+@effi.org:
		(?#accept)\.(huuto.net|tieto.com):huutosync@[\w\d]+.huuto.net:
		(?#accept)((proto|alpha).tvkaista.fi|93.90.50.\d{1,3}):noreply@tvkaista.fi
		(?#accept)smtpa.mpoli.fi:(visitors-bounces|[\w-]+)@assembly.org:
		(?#accept)www.boincstats.com:root@www.boincstats.com:
		(?#accept)email.getsatisfaction.com:bounces\+[\d\w\.=-]+@sendgrid.net:
		(?#accept)echo-\d{1,3}.nebula.fi:asiakaspalvelu@booky.fi:
		(?#accept)mail\d.diigo.com:service@diigo.com:
		(?#accept)((smtp-\d{1,3})?.spotifymail.com|\.\w{3}\.spotify.(net|com)):(account-admin|[\w-]+)@(\w{3}\.)?spotify(mail)?.(com|net):
		(?#accept)ns.server5.pcm-server.net:\w+@city-interactive.com:
		(?#accept)mail.talktochange.eu:talk@talktochange.com:
# Apple
		(?#accept)(\.apple\.com:(repair2-feedback|do_not_reply_con_en|[A-Za-z0-9_-]+)@(euro.|insideapple.)?apple.com:
# PayPal
		(?#accept)^(email\d?|outbound\d?|mx\d?)(\.\w{3})?\.paypal.com:(payment|service|paypal)@((email|intl)\.)?paypal.com:
# Valve
		(?#accept)(\w\wmx\d)?.valvesoftware.com:bitbucket@valvesoftware.com:
		(?#accept)72-165-61-135.dia.static.qwest.net:bitbucket@valvesoftware.com:
# Facebook
		(?#accept)((^out(camp)?mail\d{1,3}.snc\d).facebook.com|.tfbnw.net):(update|notification)\+[a-z0-9_-]+@facebookmail.com:
# Lippupiste
		(?#accept).mail.saunalahti.fi:lippupiste@lippupiste.fi:
# Warn if "known" addresses are not matched!
		(?#flag)@(paypal.com|facebook.com|ebay.com|apple.com):

##
		(?#accept)mta-out.inet.fi:\w+\.\w+@pp.inet.fi:
## Other KNOWN addresses
		(?#accept).messaging.microsoft.com:[\w-]+(\.[\w-]+)@yit.fi:
		(?#accept)(laviini)?.saunalahti.fi:automaatti@koulukaverit.com:
		(?#accept)ultra41.hard.ware.fi:palaute@etuovi.com
		(?#accept)\d{1,3}.32-63.138.28.213.in-addr.arpa:apache@web\d{1,3}.multitronic.fi
		(?#accept)virt-gw.sc-chi.37signals.com:app@virt-gw.sc-chi.37signals.com:\w+\.\w+@translinkcf.fi
		(?#accept)starsoft.fi:tuki@starsoft.fi:

		(?#skip)(support|abuse|postmaster)@\w+\.\w{2,4}$:
		(?#skip)^(smtp-gw1.crescom.fi|80.81.171.48):

### Games
### Web 2.0 services
		(?#accept)(kirjtuo1)?.helmet.fi:(circadm|\w+)@((kirjtuo1|\w+\d)\.)?helmet.fi:
### Mailinglist
		(?#accept)mail\d.pohjoiskarjala.net:museoposti-bounces@lists.greenspot.fi
### Ads
### Spam?

# Known mass mailings or ads:
		(?#accept)survey.interquest.com:www-data@survey.interquest.com
		(?#accept)sender.mystadium.com:bounce@mystadium.com:
		(?#accept).genisys.fi:uutiskirje@lippu.fi:
		(?#accept)www.paloma.se:noreply@sender1.se:
#
		(?#accept)suorakirje.atbusiness.com:sskirje@suorakirje.atbusiness.com:
		(?#accept).ccmdcampaigns.net:email@tictacphoto.cccampaigns.net:
#
		(?#accept)(?#Geocaching)154.128-191.167.150.66.in-addr.arpa:noreply@geocaching.com
		(?#accept)(?#Eveonline).mail.eveonline.com:[a-z_-]+@bounce.mail.eveonline.com:
		(?#accept)(?#Tjareborg)external.mytravel.se:noreply@info.tjareborg.fi:
		(?#accept)(?#Lindex)88.131.62.209:bounce@mail.lindexmail.com:
		(?#accept)(?#Seppala)neolane.seppala.fi:splbounce@as.loyaltynorth.fi:
		(?#accept)(?#SAS)sas-out.sas.dk:neobounces@flysas.com:
		(?#accept)(?#Finnair).finnair.fi:finnair.campaign@finnair.com:
		(?#accept)(?#TallinkSilja)mail\d{1,4}.mkt1434.com:[a-z_-+]@bounce.mkt1434.com:
		(?#accept)(?#Play.com).newsletters.play.com:[a-z_-]+@bounce.newsletters.play.com:
		(?#accept)(?#Kokkiman)mailer1.kokkimanmail.com:bounce@kokkimanmail.com:
		(?#accept)(?#Ravintola Tonys Deli)84.234.71.49:ekirjelahetys@hummeri.net:
		(?#accept)(?#Equinux)194.145.236.28:_www@mx3.equinux.net:
		(?#accept)(?#Crystal/iPhone)ssl.bultacocorporation.com:noreply@crystalsdk.com:
		(?#accept)(?#PhotoBox).neolane.net:photoways405-bounces@znet.neolane.net:
		(?#accept)(?#PlayStation)mailout.playstationmail.com:news@eu.playstationmail.com:
		(?#accept)(?#Voddler)88.131.62.\d{1,3}:[\d\w\.-]+@mta\d{1,3}.anp.se:
		(?#accept)(?#FIM).planeetta.com:fim@bounce.surface.fi:
		(?#accept)(?#Pixmania)81.255.72.\d{1,3}:promofi@pixmania.org:
		(?#accept)(?#DigiExpress)eg\d{2}.netikka.fi:tavoittamattomat@digiexpress.fi:
		(?#accept)(?#Finmatkat,Ellos)directmail.rwcmp.com:noreply[A-Za-z0-9_.=+-]+@bounce\d.rwcmp.com:
#
		(?#accept)(?#E&SNews)smtp-gw.fsdata.se:es_news@speakersforum.fi:
		(?#accept)(?#Ifolor,Anton&Nina)vdk\d.pvmailer.net:mailing-[\w\d-]+@mailpv.net:
		(?#accept)(?#VoteBundle)173.231.138.217:bounce-[\d\w\.=-]+@mail\d{1,3}.us2.mcsv.net:
		(?#accept)(?#ScreenCastsOnline)smtp-verifiedoptin-\d{2}.aweber.com:[\w\d=]+@smtp-verifiedoptin-\d{2}.aweber.com:
#
# Spammers?
		(?#flag-).parhaattarjoukset.com:bounces@send.parhaattarjoukset.com:
		(?#flag-)(?#benchmarkemail.com)bmesrv30.com:bounce@bmsend.com:
		(?#flag-)(?#CityDeals)62.27.57.\d{1,3}:info-[\w\d]+@news.citydeal.fi:
		(?#flag-)(?#Taukotarjous/Alennusvahti/Voittajaportaali)mail[\w\d]{2,3}.locomail.dk:postmaster-\d+@locomail.dk:

##############################################################################################################################
###
### dyndns - Dynamic names (automatically generated for Home computers) and RBL
###
##############################################################################################################################
dyndns:
###
### authmx - define mail relay hosts, that can/would accept 'dyndns'. Don't do dyndns check after match.
###
#
# skip - allow dyndns addresses and skip RBL for this match
# authmx - allow dyndns after this, but do RBL test
# ignore - don't allow dyndns relay, but don't do RBL test for this host
# break - break dyndns and rbl tests on match, and continue
#
# You can use NAME
#	client194-14-197-6.exicom.se
#	(?#authmx)ded-rb.dedicated.tdcsong.se.222.42.195.in-addr.arpa
#	(?#delete)\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-].+\.(ru|ro|ua|ar|cn|jp|tw|it|br|mx|in)$
#	(?#flag)\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-].+\.(com|net|org)$
# IP
#	213.150.148.53
#	217.212.20.191|213.50.2.(2|109)
# Or even regexps with comments.
#	(?#authmx)(?#hemtex.se)83.241.254.6[67]
#
#
# Some clients are blacklisted behind known hosting companies. We trust them.
		(?#break)emh\d{2}.mail.saunalahti.fi|virtualserver\d{2}.nebula.fi|pop.fonet.fi
















# Known relays, mostly ok
		(?#skip)^(mail-...-...\.google\.com|\w{3}\d-omc\d-\w\d\d.\w{3}\d\.hotmail\.com|outmail\d\d\d\.....\.facebook\.com|mail\d{1,3}\.messagelabs\.com)$
		(?#skip)(\.(web)?mail\.saunalahti\.fi|\.messaging\.microsoft\.com)$
#
		(?#skip)^(mail(scan|server)\d?.nebula.fi|rasia.welcomnet.fi|mta-out.inet.fi|mta-out-\d.luukku.com|smtp.tele.fi|resilar.fimnet.fi|hwebmail\d.abo.fi|(mx\d|webmail)?.ya.elisa.fi)|(smtp-\w+|webmail)\d-\w+\d.fe.helsinki.fi$
		(?#skip)^((kuulamakrilli|tulikuusama|oliivipuu|sirokuusama).dnainternet.net|83.102.40.\d{1,3})$
		(?#skip)^(edge\d{1,3}.sonerahosted.fi|mx\d.suomi24.fi|smtp.zoner.fi|pop.fonet.fi|mbox\d.netikka.net|(argo|hydra).otaverkko.fi)
		(?#skip)^((sally|sink|gate).edelkey.net|smtp-\d.edu.hel.fi|hipper.arcada.fi|137\.163\.31\.|213\.214\.150\.120)$

# Was blacklisted?
		(?#skip)(?#smilehouse.com)193\.65\.59\.129|(?#datacapture.co.uk)adsl-217.146.111.67.merula.net|(?#mail.nordvalls.se)85\.30\.130\.17

# Trusted companies
		(?#skip)asmtpout\d{1,3}.mac.com
		(?#skip)\w\wmx\d\.valvesoftware\.com

# Suspicious gateways (relays)
		(?#authmx)\.networksolutionsemail\.com
		(?#authmx)mq\d{2}\.kotisivut\.com
		(?#authmx)gw\d\.sky\.od\.ua

# Generic, mostly ok
		(?#authmx)^(mail(\d\w?)?|outbound\d?\d?|(smtp|mail)-?(out|gw)?(\d{1,3})?|mta-out(-\d)|listse?rv|proxy|server|ns\d{1,3}?)\.
		(?#authmx)^(\w)?(smtp(in|out)|mx|mq|secmx|post|relay|smtprelay|mta|pop|imap|spamgw|filter|filtteri|gate|posti|(e|www)mail|webmail)(\d)?(\d)?\.
		(?#authmx)^(smtpout|smgw\d\d|memailout\d\d.|eni-mailout\d\d|fmmailgate\d\d|hnexfw\d\d|bbnrelbas\d\d)\.
		(?#authmx)(\.iki\.fi|\.yahoo\.com|\.sth\.basefarm\.net|\.fre\.skanova\.net)$















# Web 2.0 services (mail reminder, etc)
		(?#skip)(#?etwinning.net)(omaha|cfprod).eun.org

# Badly configured reverse DNS for networks
		(?#skip)(?#lists.greenspot.fi)62.220.237.116
		(?#skip)(?#mta162.anp.se, Voddler, Lindex, etc.).128-25.62.131.88.in-addr.arpa
		(?#skip)(?#mail.assembly.org)212.226.90.232
		(?#skip)(?#mail280.us2.mcsv.net).192/27.138.231.173.in-addr.arpa
		(?#skip)(?#verkkokauppa.com).64-27.70.100.194.in-addr.arpa
		(?#skip)(?#emaileri.fi).0-127.52.73.62.in-addr.arpa
		(?#skip)(?#lists.janstock.fi)baana-81-175-188-237.fw.dsl.phnet.fi
# Badly configured reverse DNS for Single IP
		(?#accept)(?#Viasat)195.67.16.187
		(?#accept)(?#Pixmania)81.255.72.211
		(?#skip)(?#aleksi13.fi)213.139.179.3
		(?#accept)(#Valve/Steam)72.165.61.135
		(?#flag)72-165-61-\d{1,3}.dia.static.qwest.net
###
### Regexp rules how to detect "dynamic" hostnames. If dynamic host should be
### allowed, hostname should be allowed in skip_dns (RBL section).
		(?#skip)^\d+\.edelkey\.net$
		(?#delete)host\d{1,3}-\d{1,3}-(dynamic|static).\d{1,3}-\d{1,3}-[rb].(retail|business).telecomitalia.it
		(?#delete)\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3}.(pool.ukrtel|dynamic.hinet)\.net
		(?#delete)\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}.+\.(dyn.estpak.ee)$
		(?#delete)\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-].+\.(ru|ro|ua|ar|cn|jp|tw|it|br|mx|in)$
		(?#flag)\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-].+\.(fi|se|ee|no)$
		(?#flag)\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-].+\.(com|net|org)$
		(?#flag)\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}[\.-]
		(?#flag)\d{1,3}\.(Red-|subnet)\d{1,3}[\.-]\d{1,3}[\.-]\d{1,3}\.
		(?#reject)\.bb\.sky\.com|\.static\.theplanet\.com|\.dip\.t-dialin\.net|\.\w\w-\d-\d\w\.dynamic\.ziggo\.nl
		(?#flag)c-[\da-f]+.\d+-\d+-[\da-f]+.cust.bredbandsbolaget.se
		(?#flag)c-[\da-f]+-\d+\.cust\.telenor\.se
		(?#flag)d\w{1,3}\.F\w+FL\d{1,3}.vectant.ne.jp










		(?#skip)62.142.5.(110|95)

###
### skip - Do not make dyndns test for match. If recursive mode is enabled,
###        skip to next received host.
###
### NOTE! This affects also on Blacklisting (RBL) test. If dyndns is skiped, so is RBL.
###

#		(?#skip)(?#too many false blocking).*dnainternet.net|.*\.sta(tic)?\.(smilehouse.com|louhi.net|ac-net.se|estpak.ee)
#		(?#skip).(smilehouse.com|louhi.net|ac-net.se|estpak.ee|dnainternet.net)
#		(?#skip)(?#diamo.se)88.131.23.18|(?#dpu.se)82.182.83.75|(?#mbcint.se)82.182.83.75|(?#autoexperten.nu)213.150.159.45
#		(?#skip)(?#smilehouse.com)193.94.205.129|(?#tamroshop.fi)193.65.59.129|(?#mail.duodecim.fi)195.236.0.9


##############################################################################################################################
###
### CHARSET
###
##############################################################################################################################
charset:
		(?#skip)(utf-8|iso-8859-1|us-ascii|windows-1252)
		(?#flag)(windows-1250|windows-1251)
		(?#flag)(iso-2022-jp|shift_jis|big5|GB2312|koi8-r)

##############################################################################################################################
###
### HEADERS
###
##############################################################################################################################
# Note! This is does not include headers that has duplicate keys, like Received.
headers:
		(?#accept)Reply-To: clubone@tallinksilja.messages4.com
		(?#delete)From:.*(V[il1]agra|Rolex|Pfizer|OEM Software|pen1s|enlarge|get bigger|lotto winner)
		(?#reject)\<(halen@iki.fi|samipekka.hallikas@nic.fi)\>
		(?#reject)To: janstock@janstock.fi|X-BeenThere: janstock.fi_tz@lists.janstock.fi
		(?#flag)X-Spam-Flag: YES|X-SpamTest-Status: SPAM|X-Spam: Not detected

##############################################################################################################################
###
### SUBJECT
###
##############################################################################################################################
subject:
		(?#accept)gift copy .* on Steam$
		(?#accept)Tilauksesi on |Tilausvahvistus|^([A-Z][a-z]: )?Huutokauppa \d+ sulkeutunut
		(?#accept)^Receipt for Your Payment to
		(?#delete)(cheap|discount)? ?(Swiss|Fake|Replica|Brand(ed)?|Rolex|Mont Blanc|Bvlgari|Breilting|Tissot|Versace|Gucci|Vuitton|Dunhill|Omega|Panerai|D&G|Jacob & Co|Armani|Cartier) (cheap )?(pen|key chain|watch|watson|cufflinks|necklace|wallet|acc?essories|acc?essory|earrings|replica|-\d\d%)
		(?#delete)(Rep\|ica|Qua1ity|Rep1ica|En1arge|Pen1s|Peni5|K1onopiin|S0ftWare|R[o0]lex|V[i1l]agra|Pharmacy|Pfizer|Cialis Soft|Lorazepam|Diazepam|Valiun|Viagra|Xanax|Valium|Phentermine|Vicodin|Hydrocodone|Prescription|Zoloft|Kamagra|Ritalin|Adderall)( |,)
		(?#delete)Ultimate( |_)?Replica|Luxury ?Watch|Cheapest ?Viagra|Order ?Viagra|PenisEn.+pill|online pharmacy|No Rx Required
		(?#delete)International (Real Estate )?Consulting( Company)?|Local representation( needed)?$
		(?#delete)^Hi .+ Up to [7-9]\d% off| -\d\d% now$|\d\d% (discount|off today)\.$|for you( now)? -\d\d%$|\. \d\d% off$
		(?#reject)(weight losing pills|super slim|weight loss|Replica|Make money|(Message|Letter) from Russia|invites you for chat)
		(?#reject)RE: ?(RE: ?)?(Hi|good (morning|evening|day))( !)?
		(?#reject)^\{SPAM\}:

##############################################################################################################################
###
### WORDSCAN / HTML
###
##############################################################################################################################
blockhtml:
# Some weird spam signatures
		(?#reject)http://www.google-analytics.com/ga.js
		(?#reject)<!--https://www.\w+.(firefigure|\w+).(com?|net|info)-->
# This matches with spams with one "random" line, and next line is only URL with domain part and tld, without host part.
		(?#delete)^<DIV align=center><FONT face=Arial size=2>\n<A href="http://\w+.ru">[\w ]+(\?)?</A></FONT></DIV></BODY></HTML>
		(?#delete)<body>\n\n<p>[\w\d,. -]+<br />\n<a href="https?://(\w+.)?\w+.ru/" target="_blank">https?://(\w+.)?\w+.ru/</a>&nbsp;</p>\n\n</body>
		(?#delete)<body lang=EN-US link=blue vlink=purple> <div class=Section1> <p class=MsoNormal><o:p>[A-Za-z -]+</o:p></p> <p class=MsoNormal><o:p><a href="http://\w+.com/">http://\w+\.\w+/</a></o:p></p> </div> </body>
		(?#delete)<a href="https?://\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}/~[\w\d]+/\w{1,3}.html\?[\w\d=]+" target="_blank" style="font-weight:bold; font-size:\d\dpx;">
		(?#reject)<a href=.?https?://\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}/~
		(?#reject)<img height="[01]" width="[01]" src="http://[\d\w._/-]+\?
		(?#delete)<span style="FONT-SIZE: 2px; FLOAT: right; COLOR: white">|<u style="font-size:11px; color:#
		(?#reject)/EmailOrder.asp">http://
		(?#reject)<em> ?on-line now</em>
# Agressive spam like ads
		(?#reject)http://www.(mailinglist.dk|recipientservice.net)/(mailinglist|newsletter)/


##############################################################################################################################
###
### WORDSCAN / HTML, Links
###
##############################################################################################################################
links:

##############################################################################################################################
###
### WORDSCAN
###
##############################################################################################################################
blockwords:
		(?#flag-)<\!-- campaignid: \d+ -->|Email Marketing by|\.benchmarkemail\.com
		(?#delete)(MoneyBack|Results) Guara\w+ http://(www\.)?\w+.ru
		(?#delete)S0ftWare|Ejacu1ation
		(?#delete)((Come|Visit) everybody|Click here|Click is all you need|Enter right here|Hurry to click|Just a click away|Just one click|Longing for your visit|One click away|One-finger click|Only one click|Our store|Press button now|Press the button|Run inside|Speed to visit|Take a step to enter|Visit and take|Visit this minute|We invite you|Welcome anytime|We want you to enter|We welcome you here|your best choice) http://[\w\d]+\.ru
		(?#delete)(Hi|Hello|Good evening|Good day)! (How are you|How goes it|What s up|What(.)?'s up|How are you getting on|Haven(.)?'t heard from you for long)(\?|!) I
		(?#delete)^[\w,. -]+\nhttps?://(\w+.)?\w+.ru/$
		(?#flag)http://[\d\w_.-]+\.ru/\?\[\d\w]
		(?#delete)(Replica|Branded|Rolex|Mont Blanc|Bvlgari|Breilting|Tissot|Versace|Gucci|Vuitton|Dunhill|Omega|Panerai|D&G|Armani|Cartier) (pen|watch|cufflinks|necklace|wallet)
		(?#delete)Omega Speedmaster|Patek Philippe Twenty|Breitling Chronomatic|Lange & Sohne Langematik
		(?#delete)Sale on Pfizer|Pharmacy(USA|Canada)|http://pharma
		(?#delete)order any diploma|(get your|buy the) master.+degree|an online degree|100% verified Degree|start improving your life|in (a|\w+) days? doing (easy things|a little work)|Career Trends
		(?#reject)\.angelfire\.com/|easy-gosky(\.(com|net))?
		(?#flag)the sum of .+ Million (United )?Dollars
		(?#reject)need your urgent assistance in transferring|Burkina Faso|note, this is not a scam
		(?#reject)(Pharmacy|Pfizer|Viagra|Xanax|Lunesta|Codeine)
		(?#delete)gain in length|increase in thickness|Rock-hard|doctor designed|proven natural
		(?#reject)(^Dearly Beloved,$|this money distributed among charity|help me collect the money from|we can not buy this stove in our local market)
		(?#reject)hashtag that a brand is promoting|Penetrate this site|weight loss pill|OEM Software
		(?#reject)123Greetings|Promohouse Ltd|Software Innovations Inc|registry of World Businesses|Europe Business Guide|panosta kunnolla ja voita|ilmoita tietosi ja voita|/(\w+.)?opcktrac.com/
		(?#reject)my profile and new photos|million.+dollars?.+@mail\.ru
		(?#reject)^\w+:\nhttp://bit.ly/[\w\d]+$\n\n
		(?#reject)next of kin to my deceased client|company is looking for Administrative representative|International headhunting company|like to offer you a job of
		(?#reject)Euro PowerBall|your email has just won|lottery claims|Email: claims@
		(?#reject)Send email to takemeoff@[\w\.]+ to ensure no further communication
		(?#reject)A lot of software for Windows and MAC OS in different languages|The best licensed software with a dCopyright X 2010
		(?#reject)^please view the attachment to get the details Thank you$
		(?#reject)Note: Your Personal Contact/Communication Code With