Easyconfig spamfilter¶
The redWall Spamfilter configuration is based on this guide: http://www.howtoforge.com/the-perfect-spamsnake-ubuntu-jeos-10.10-maverick-meerkat
See /etc/redwall/_easyconfigs/mailspamfilter/mailspamfilter.conf for configurable options.
Example Default Configuration:
1 # Please DO NOT Change this Version... it's needed in the future
2 config_version="1"
3
4 # Your primary domain
5 primary_domain="example.local"
6
7 # Your Mailserver hostname (this system's external fqdn where the mx record points to
8 hostname="mail.${primary_domain}"
9
10 # Your default internal Mail Server
11 internal_smtp_server="192.168.1.25"
12
13 # maximum message size in MB
14 maximum_message_size="30"
15
16 # Some default Mail Addresses and where they should end up (on your internal mail server)
17 internal_root_mail_adress="user1@${primary_domain}"
18 internal_abuse_mail_adress="user2@${primary_domain}"
19 internal_postmaster_mail_adress="postmaster@${primary_domain}"
20
21 # Your internal mail admin address
22 # can be empty -> turned off
23 # This enables Notifications in MailScanner
24 internal_mail_admin=${internal_postmaster_mail_adress}
25
26 # Organisation Name (short, no special chars!)
27 org_name="redwall"
28
29 # Your LONG Organisation Name
30 org_name_long="redwall test long"
31
32 # Your Website (only used in MailScanner)
33 website="www.${primary_domain}"
34
35 # Which SpamFilter Webinterface would you like to use ?
36 # Possible values:
37 # mailwatch
38 # off
39 # baruwa (experimental currently)
40 webinterface="mailwatch"
41
42 # How would you like to spam and high spam scores to be defined/retrieved
43 # Possible Values:
44 # baruwa (sql based -> defined in webinterface)
45 # mailwatch (sql based -> defined in webinterface (default low score 5, high score 10, defined by the admin user account)
46 # <n> (any number of your liking)
47 mailscan_spamassassin_score=${webinterface}
48 mailscan_spamassassin_high_score=${webinterface}
49
50 # How would you like to determine if spam scanning should be enabled ?
51 # Possible values:
52 # yes (Globally on)
53 # no (Globally off)
54 # baruwa (defined in the baruwa webinterface)
55 # mailwatch (defined in the mailwatch webinterface, default determined by the admin user account)
56 # ruleset (a custom mailscanner ruleset)
57 mailscan_spamassassin_use=${webinterface}
58
59 # Your trusted networks
60 # Allows relaying in postfix and is used in spamassassin for the trusted_networks value
61 trusted_networks_and_hosts="
62 10.0.0.0/8
63 127.0.0.0/8
64 192.168.1.0/24
65 "
66
67 # postfix transport maps
68 # specifies <domain>|<destination mail server
69 # first entry should be left as is because of the definitions on top of this file
70 # second line can be removed or adapted to your needs
71 # new lines can be added
72 transport_maps="
73 ${primary_domain}|${internal_smtp_server}
74 otherdomain.local|some.other.server.local
75 "
76
77 # Defines domain which should be allowed for relaying
78 # should contain ALL your internal Mail Domains
79 relay_domains="
80 ${primary_domain}
81 otherdomain.local
82 "
83
84 # Your valid recipients
85 # these are basically manually added entries... see below
86 relay_recipients="
87 ${internal_root_mail_adress}
88 ${internal_abuse_mail_adress}
89 ${internal_postmaster_mail_adress}
90 ${internal_mail_admin}
91 some.special.user@${primary_domain}
92 "
93
94 # postfix relaydomains, transport maps and relay recipients definitions
95 # you should not have to change this normally... if the webinterface value is correctly specified
96 # possible values:
97 # baruwa ( --> baruwa --> sql based + file (hash / ldap sync + manual)) - see ldap_servers below)
98 # file (file based (hash / ldap sync + manual) - see ldap_servers below)
99 # mailwatch ( same as file --> file (hash / ldap sync + manual) - see ldap_servers below)
100 # custom value
101 postfix_relay_domains="${webinterface}"
102 postfix_transport_maps="${webinterface}"
103 postfix_relay_recipients="${webinterface}"
104
105 # relay recipients ldap servers
106
107 # where to get valid relay recipients from
108 # i strongly recommend using an internal ldap server for this!
109 # disabled by default... as the configuration script tries to update your recipients
110 # during runtime... which will obviously fail if wrong settings are specified here!
111 # format is:
112 #friendly name (to your liking) |ldap server (or AD domain if your dns is working correctly) |search base |user account to bind | bind user password
113 ldap_servers=""
114
115 # example:
116 #----------------
117 #ldap_servers="
118 #testing|domain.local|DC=domain,DC=local|ldap@domain.local|ldapPW
119 #testing2|domain2.local|DC=domain2,DC=local|ldap@domain2.local|ldapPW
120 #"
121
122 # this defines the "logging driver" in mailscanner... you should not have to change this
123 # normally... if the webinterface value is correctly specified
124 # possible values:
125 # mailwatch (log mails to the mailwatch webinterface)
126 # baruwa (log mails to the baruwa webinterface)
127 # wrapper (wrapper script - not yet implemented)
128 mailscan_logging_driver="${webinterface}"
129 mailscan_blacklist_driver="${webinterface}"
130 mailscan_whitelist_driver="${webinterface}"
131
132 # Here you can specify internal imap mailboxes in order to train spamassassin with
133 # mails droped into the corresponding mailboxx folder
134 # variable can be empty -> turns this feature off
135 # format is:
136 # server|user|password|folder|type[spam|ham]|delete (delete mails after processing?)
137 learn_from_imap="
138 192.168.1.1|imapaccount|imappassword|_SPAM_Reports|spam|0
139 192.168.1.2|imapaccount|imappassword|_SPAM_Reports|spam|1
140 192.168.1.1|imapaccount|imappassword|_NO_SPAM_Reporting|ham|del
141 192.168.1.2|imapaccount|imappassword|_NO_SPAM_Reporting|ham|delete
142 "
143
144 # this enabled a "global first instance whitelist" based on the whitelist entried in mailwatch and/or baruwa
145 # possible values:
146 # mailwatch (sql based on mailwatch whilelist entries)
147 # baruwa (sql based on baruwa whitelist entries)
148 # custom (custom postfix value)
149 # empty/undefined (turn feature off)
150 postfix_globalwhitelist_driver="${webinterface}"
Once complete run
/etc/redwall/_easyconfigs/mailspamfilter/configure.sh
It should be safe to run the script multiple times if errors occur
After that you should be all set