1spamassassin-run(3) User Contributed Perl Documentation spamassassin-run(3)
2
3
4
6 spamassassin - simple front-end filtering script for SpamAssassin
7
9 spamassassin [options] [ < mailmessage | path ... ]
10
11 spamassassin -d [ < mailmessage | path ... ]
12
13 spamassassin -r [ < mailmessage | path ... ]
14
15 spamassassin -k [ < mailmessage | path ... ]
16
17 spamassassin -W|-R [ < mailmessage | path ... ]
18
19 Options:
20
21 -L, --local Local tests only (no online tests)
22 -r, --report Report message as spam
23 -k, --revoke Revoke message as spam
24 -d, --remove-markup Remove spam reports from a message
25 -C path, --configpath=path, --config-file=path
26 Path to standard configuration dir
27 -p prefs, --prefspath=file, --prefs-file=file
28 Set user preferences file
29 --siteconfigpath=path Path for site configs
30 (def: /etc/mail/spamassassin)
31 --cf='config line' Additional line of configuration
32 -x, --nocreate-prefs Don't create user preferences file
33 -e, --exit-code Exit with a non-zero exit code if the
34 tested message was spam
35 --mbox read in messages in mbox format
36 --mbx read in messages in UW mbx format
37 -t, --test-mode Pipe message through and add extra
38 report to the bottom
39 --lint Lint the rule set: report syntax errors
40 -W, --add-to-whitelist Add addresses in mail to persistent address whitelist
41 --add-to-blacklist Add addresses in mail to persistent address blacklist
42 -R, --remove-from-whitelist Remove all addresses found in mail from
43 persistent address list
44 --add-addr-to-whitelist=addr Add addr to persistent address whitelist
45 --add-addr-to-blacklist=addr Add addr to persistent address blacklist
46 --remove-addr-from-whitelist=addr Remove addr from persistent address list
47 -4 --ipv4only, --ipv4-only, --ipv4 Use IPv4, disable use of IPv6 for DNS etc.
48 -6 Use IPv6, disable use of IPv4 where possible
49 --progress Print progress bar
50 -D, --debug [area=n,...] Print debugging messages
51 -V, --version Print version
52 -h, --help Print usage message
53
55 spamassassin is a simple front-end filter for SpamAssassin.
56
57 Using the SpamAssassin rule base, it uses a wide range of heuristic
58 tests on mail headers and body text to identify "spam", also known as
59 unsolicited bulk email. Once identified, the mail is then tagged as
60 spam for later filtering using the user's own mail user-agent
61 application.
62
63 The default tagging operations that take place are detailed in
64 "TAGGING" in spamassassin.
65
66 By default, message(s) are read in from STDIN (< mailmessage), or from
67 specified files and directories (path ...) STDIN and files are assumed
68 to be in file format, with a single message per file. Directories are
69 assumed to be in a format where each file in the directory contains
70 only one message (directories are not recursed and filenames containing
71 whitespace or beginning with "." or "," are skipped). The options
72 --mbox and --mbx can override the assumed format, see the appropriate
73 OPTION information below.
74
75 Please note that SpamAssassin is not designed to scan large messages.
76 Don't feed messages larger than about 500 KB to SpamAssassin, as this
77 will consume a huge amount of memory.
78
80 -e, --error-code, --exit-code
81 Exit with a non-zero error code, if the message is determined to be
82 spam.
83
84 -h, --help
85 Print help message and exit.
86
87 -V, --version
88 Print version and exit.
89
90 -t, --test-mode
91 Test mode. Pipe message through and add extra report. Note that
92 the report text assumes that the message is spam, since in normal
93 use it is only visible in this case. Pay attention to the score
94 instead.
95
96 If you run this with -d, the message will first have SpamAssassin
97 markup removed before being tested.
98
99 -r, --report
100 Report this message as manually-verified spam. This will submit
101 the mail message read from STDIN to various spam-blocker databases.
102 Currently, these are the Distributed Checksum Clearinghouse
103 "http://www.dcc-servers.net/dcc/", Pyzor "http://pyzor.org/",
104 Vipul's Razor "http://razor.sourceforge.net/", and SpamCop
105 "http://www.spamcop.net/".
106
107 If the message contains SpamAssassin markup, the markup will be
108 stripped out automatically before submission. The support modules
109 for DCC, Pyzor, and Razor must be installed for spam to be reported
110 to each service. SpamCop reports will have greater effect if you
111 register and set the "spamcop_to_address" option.
112
113 The message will also be submitted to SpamAssassin's learning
114 systems; currently this is the internal Bayesian statistical-
115 filtering system (the BAYES rules). (Note that if you only want to
116 perform statistical learning, and do not want to report mail to
117 third-parties, you should use the "sa-learn" command directly
118 instead.)
119
120 -k, --revoke
121 Revoke this message. This will revoke the mail message read from
122 STDIN from various spam-blocker databases. Currently, these are
123 Vipul's Razor.
124
125 Revocation support for the Distributed Checksum Clearinghouse,
126 Pyzor, and SpamCop is not currently available.
127
128 If the message contains SpamAssassin markup, the markup will be
129 stripped out automatically before submission. The support modules
130 for Razor must be installed for spam to be revoked from the
131 service.
132
133 The message will also be submitted as 'ham' (non-spam) to
134 SpamAssassin's learning systems; currently this is the internal
135 Bayesian statistical-filtering system (the BAYES rules). (Note
136 that if you only want to perform statistical learning, and do not
137 want to report mail to third-parties, you should use the "sa-learn"
138 command directly instead.)
139
140 --lint
141 Syntax check (lint) the rule set and configuration files, reporting
142 typos and rules that do not compile correctly. Exits with 0 if
143 there are no errors, or greater than 0 if any errors are found.
144
145 -W, --add-to-whitelist
146 Add all email addresses, in the headers and body of the mail
147 message read from STDIN, to a persistent address whitelist. Note
148 that you must be running "spamassassin" or "spamd" with a
149 persistent address list plugin enabled for this to work.
150
151 --add-to-blacklist
152 Add all email addresses, in the headers and body of the mail
153 message read from STDIN, to the persistent address blacklist. Note
154 that you must be running "spamassassin" or "spamd" with a
155 persistent address list plugin enabled for this to work.
156
157 -R, --remove-from-whitelist
158 Remove all email addresses, in the headers and body of the mail
159 message read from STDIN, from a persistent address list. STDIN must
160 contain a full email message, so to remove a single address you
161 should use --remove-addr-from-whitelist instead.
162
163 Note that you must be running "spamassassin" or "spamd" with a
164 persistent address list plugin enabled for this to work.
165
166 --add-addr-to-whitelist
167 Add the named email address to a persistent address whitelist.
168 Note that you must be running "spamassassin" or "spamd" with a
169 persistent address list plugin enabled for this to work.
170
171 --add-addr-to-blacklist
172 Add the named email address to a persistent address blacklist.
173 Note that you must be running "spamassassin" or "spamd" with a
174 persistent address list plugin enabled for this to work.
175
176 --remove-addr-from-whitelist
177 Remove the named email address from a persistent address whitelist.
178 Note that you must be running "spamassassin" or "spamd" with a
179 persistent address list plugin enabled for this to work.
180
181 --ipv4only, --ipv4-only, --ipv4
182 Do not use IPv6 for DNS tests. Normally, SpamAssassin will try to
183 detect if IPv6 is available, using only IPv4 if it is not. Use if
184 the existing tests for IPv6 availability produce incorrect results
185 or crashes.
186
187 -L, --local
188 Do only the ''local'' tests, ones that do not require an internet
189 connection to operate. Normally, SpamAssassin will try to detect
190 whether you are connected to the net before doing these tests
191 anyway, but for faster checks you may wish to use this.
192
193 Note that SpamAssassin's network rules are run in parallel. This
194 can cause overhead in terms of the number of file descriptors
195 required if --local is not used; it is recommended that the minimum
196 limit on fds be raised to at least 256 for safety.
197
198 -d, --remove-markup
199 Remove SpamAssassin markup (the "SpamAssassin results" report,
200 X-Spam-Status headers, etc.) from the mail message. The resulting
201 message, which will be more or less identical to the original, pre-
202 SpamAssassin input, will be output to STDOUT.
203
204 (Note: the message will not be exactly identical; some headers will
205 be reformatted due to some features of the Mail::Internet package,
206 but the body text will be.)
207
208 -C path, --configpath=path, --config-file=path
209 Use the specified path for locating the distributed configuration
210 files. Ignore the default directories (usually
211 "/usr/share/spamassassin" or similar).
212
213 --siteconfigpath=path
214 Use the specified path for locating site-specific configuration
215 files. Ignore the default directories (usually
216 "/etc/mail/spamassassin" or similar).
217
218 --cf='config line'
219 Add additional lines of configuration directly from the command-
220 line, parsed after the configuration files are read. Multiple
221 --cf arguments can be used, and each will be considered a separate
222 line of configuration. For example:
223
224 spamassassin -t --cf="body NEWRULE /text/" --cf="score NEWRULE 3.0"
225
226 -p prefs, --prefspath=prefs, --prefs-file=prefs
227 Read user score preferences from prefs (usually
228 "$HOME/.spamassassin/user_prefs").
229
230 --progress
231 Prints a progress bar (to STDERR) showing the current progress.
232 This option will only be useful if you are redirecting STDOUT (and
233 not STDERR). In the case where no valid terminal is found this
234 option will behave very much like the --showdots option in other
235 SpamAssassin programs.
236
237 -D [area,...], --debug [area,...]
238 Produce debugging output. If no areas are listed, all debugging
239 information is printed. Diagnostic output can also be enabled for
240 each area individually; area is the area of the code to instrument.
241 For example, to produce diagnostic output on bayes, learn, and dns,
242 use:
243
244 spamassassin -D bayes,learn,dns
245
246 Higher priority informational messages that are suitable for
247 logging in normal circumstances are available with an area of
248 "info".
249
250 For more information about which areas (also known as channels) are
251 available, please see the documentation at:
252
253 L<http://wiki.apache.org/spamassassin/DebugChannels>
254
255 -x, --nocreate-prefs
256 Disable creation of user preferences file.
257
258 --mbox
259 Specify that the input message(s) are in mbox format. mbox is a
260 standard Unix message folder format.
261
262 --mbx
263 Specify that the input message(s) are in UW .mbx format. mbx is
264 the mailbox format used within the University of Washington's IMAP
265 implementation; see "http://www.washington.edu/imap/".
266
268 sa-learn(1) spamd(1) spamc(1) Mail::SpamAssassin::Conf(3)
269 Mail::SpamAssassin(3)
270
272 "Mail::SpamAssassin"
273
275 See <http://issues.apache.org/SpamAssassin/>
276
278 The SpamAssassin(tm) Project <http://spamassassin.apache.org/>
279
281 SpamAssassin is distributed under the Apache License, Version 2.0, as
282 described in the file "LICENSE" included with the distribution.
283
284
285
286perl v5.26.3 2018-09-14 spamassassin-run(3)