-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathspf_update_pf.1
129 lines (129 loc) · 3.01 KB
/
spf_update_pf.1
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
.\" Copyright (c) 2016 Aaron Poffenberger <akp@hypernote.com>
.\"
.\" 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 $Mdocdate: Jul 10 2016 $
.Dt SPF_UPDATE_PF 1
.Os
.Sh NAME
.Nm spf_update_pf
.Nd updates a named
.Xr pf 4
table with ip addresses from
.Xr spf_fetch 1
.Sh SYNOPSIS
.Nm spf_update_pf
.Bk -words
.Op Fl afhprstv
.Op Fl a Ar spf_fetch_args
.Op Fl f Ar file
.Op Fl h
.Op Fl p Ar prefix
.Op Fl r
.Op Fl s Ar seconds
.Op Fl t Ar table
.Op Fl v
.Ek
.Sh DESCRIPTION
.Nm
calls
.Xr spf_fetch 1
with the specified file and updates a named
.Xr pf 4
table with the returned SPF records.
.Pp
Suitable for use with a daily
.Xr cron 8
job.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl a
Arguments to pass through to
.Xr spf_fetch 1 .
.It Fl f
File to use.
Default: /etc/mail/common_domains
.It Fl h
Help message.
.It Fl p
Prefix to use for file and table names with default path.
Default: common.
.It Fl r
Remove expired domains from the specified file by removing any entries
whose timestamp is less than current time minus the seconds specified.
.It Fl s
Seconds for removal.
Default: 3110400 (36 days)
.It Fl t
.Xr pf 4
table to load the addresses to.
Default: common_white.
.It Fl v
Print the version.
.El
.Sh FILES
.Bl -tag -width "file" -compact
.It Pa file
Formatted with one domain per line.
Comments begin with hash (#) and optionally includes the Unix
timestamp when it was added for later removal with -r.
.Pp
.Lk https://github.com/mailcheck/mailcheck/wiki/List-of-Popular-Domains "List of Popular Domains"
.Pp
.It Pa file_ips
File created in same directory as the input file to receive the SPF records from
.Xr spf_fetch 1 .
.El
.Sh EXAMPLES
Daily
.Xr cron 8
job:
.Bd -literal
@daily /usr/local/bin/spf_update_pf
.Ed
.Pp
Daily
.Xr cron 8
job with
.Xr spf_fetch 1
filter:
.Bd -literal
@daily /usr/local/bin/spf_update_pf -a '-t filters/filter_sipcalc'
.Ed
.Pp
Change the file and table prefixes:
.Bd -literal
/usr/local/bin/spf_update_pf -p mta
# sets -f to /etc/mail/mta_domains
# sets pf(4) table name to mta_white
.Ed
.Sh DIAGNOSTICS
.Nm
returns 0 on success, or >0 on error:
.Bd -literal
1: file not found,
2: table not found.
.Ed
.Sh SEE ALSO
.Xr spf_fetch 1 ,
.Xr pf 4
.Sh AUTHORS
.An -nosplit
The
.Nm
utility was written by
.An Aaron Poffenberger Aq Mt akp@hypernote.com .
.Sh BUGS
.Nm
should return error codes for conditions like failed look-ups.