]> Sergey Matveev's repositories - public-inbox.git/blob - Documentation/public-inbox-learn.pod
3c92b1cc698b7f206fc9c4549cdafc15bfe05b81
[public-inbox.git] / Documentation / public-inbox-learn.pod
1 =head1 NAME
2
3 public-inbox-learn - spam trainer and remover for public-inbox
4
5 =head1 SYNOPSIS
6
7   public-inbox-learn <spam|ham|rm> </path/to/RFC2822_message
8
9 =head1 DESCRIPTION
10
11 public-inbox-learn can remove spam or inject ham messages into
12 an inbox while training a SpamAssassin instance.
13
14 It is intended for users of L<public-inbox-mda(1)> or
15 L<public-inbox-watch(1)>, but not users relying on
16 L<git-fetch(1)> to mirror inboxes.
17
18 It reads one message from standard input and operates on it
19 depending on the command given:
20
21 =head1 COMMANDS
22
23 public-inbox-learn takes one of the following commands as its
24 first and only argument:
25
26 =over 8
27
28 =item spam
29
30 Treat the message as spam.  This will mark the message as
31 removed so it becomes inaccessible via NNTP or WWW endpoints
32 for all configured inboxes.
33
34 The message remains accessible in git history.
35
36 It will also be fed to L<spamc(1)> for training purposes unless
37 C<publicinboxmda.spamcheck> is C<none> in L<public-inbox-config(5)>.
38
39 =item ham
40
41 Treat standard input as ham.  This is useful for manually injecting
42 messages into the archives which failed the spam check run by
43 L<public-inbox-mda(1)> or L<public-inbox-watch(1)>.
44
45 It relies on the C<To:>, C<Cc:>, and C<List-ID:> headers
46 to match configured inbox addresses and C<listid> directives.
47
48 It will also be fed to L<spamc(1)> for training purposes unless
49 C<publicinboxmda.spamcheck> is C<none> in L<public-inbox-config(5)>.
50
51 =item rm
52
53 This is similar to the C<spam> command above, but does
54 not feed the message to L<spamc(1)> and only removes messages
55 which match on any of the C<To:>, C<Cc:>, and C<List-ID:> headers.
56
57 The C<--all> option may be used match C<spam> semantics in removing
58 the message from all configured inboxes.  C<--all> is only
59 available in public-inbox 1.6.0+.
60
61 =back
62
63 =head1 ENVIRONMENT
64
65 =over 8
66
67 =item PI_CONFIG
68
69 Per-user config file parseable by L<git-config(1)>.
70 See L<public-inbox-config(5)>.
71
72 Default: ~/.public-inbox/config
73
74 =back
75
76 =head1 CONTACT
77
78 Feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
79
80 The mail archives are hosted at L<https://public-inbox.org/meta/> and
81 L<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>
82
83 =head1 COPYRIGHT
84
85 Copyright 2019-2021 all contributors L<mailto:meta@public-inbox.org>
86
87 License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
88
89 =head1 SEE ALSO
90
91 L<spamc(1)>, L<public-inbox-mda(1)>, L<public-inbox-watch(1)>