-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter-prepend.8
74 lines (73 loc) · 2.2 KB
/
filter-prepend.8
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
.\" Copyright (C) 2020 Mildis <[email protected]>
.\" All rights reserved.
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.Dd June 04, 2020
.Dt FILTER-PREPEND 8
.Os
.Sh NAME
.Nm filter-prepend
.Nd OpenSMTPD filter which prepends token to subject if not present
.Sh SYNOPSIS
.Nm filter-prepend
.Op Fl prefix Ar string
.Op Fl encode
.Sh DESCRIPTION
The
.Nm
filter for the OpenSMTPD
.Pq Xr smtpd 8
server prepends a string token to the mail's subject if not already present.
Its options are:
.Bl -tag -width "encode" -offset indent
.It Fl prefix Ar string
Use
.Ar string
as the token to search and add.
The default is
.Ar [*EXT*] .
.It Fl encode
Always encode the token in the subject, whether the incoming subject is encoded or not.
The default is
.Ar false .
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Adding the following to
.Pa smtpd.conf
enables
.Nm
for all incoming connections, changes the default prefix to
.Em '[EXTERNAL]'
and forcibly encodes it.
.Pp
Be warned that a too generic prefix could match legitimate wording and thus it won't be added to the Subject.
.Bd -literal -offset indent
filter "prepend" proc-exec \\
"/usr/local/libexec/smtpd/filter-prepend \\
-prefix '[EXTERNAL]' -encode"
listen on all filter "prepend"
.Ed
.Sh KNOWN LIMITATIONS
.Bl -dash
.It
If Subject is too long and spans between multiple datalines, only the begining will be analyzed for prefix token
.It
RFC2047 Subject won't be decoded if 1/ happens inside an encoded string
.El
.Sh SEE ALSO
.Xr smtpd.conf 5
.Sh AUTHORS
.An Mildis Aq Mt [email protected]
.Sh BUGS
None known.