-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathspf_fetch.1
129 lines (124 loc) · 2.96 KB
/
spf_fetch.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_FETCH 1
.Os
.Sh NAME
.Nm spf_fetch
.Nd recursively looks up all the SPF records
.Sh SYNOPSIS
.Nm spf_fetch
.Bk -words
.Op Fl 46cdfhmtv
.Op Fl 4
.Op Fl 6
.Op Fl c
.Op Fl d Ar dns_server
.Op Fl f Ar file
.Op Fl h
.Op Fl m
.Op Fl t Ar filter
.Op Fl v
.Op Ar domain ...
.Ek
.Sh DESCRIPTION
.Nm
recursively looks up all the SPF records for the domains
listed in the file, on the command line and or received on
stdin.
Emits the results to stdout.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl 4
Look-up IPv4 records.
Default: IPv4 and IPv6.
.It Fl 6
Look-up IPv6 records.
Default: IPv4 and IPv6.
.It Fl c
Print domain as shell comment on single line before look-up results.
.It Fl d
DNS server to use for look-ups.
.It Fl f
File with domains to lookup.
.It Fl h
Help message.
.It Fl m
Do not print MX records if server has no SPF records.
.It Fl t
Filter to apply to ip addresses.
May be used to validate, transform or exclude addresses.
.Pp
Filters are called once for each ip address found and may validate,
transform or filter ip addresses.
.Pp
Filters must return empty string or one valid address or CIDR address
per line.
.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 (#).
.Pp
.Lk https://github.com/mailcheck/mailcheck/wiki/List-of-Popular-Domains "List of Popular Domains"
.El
.Sh EXAMPLES
Look-up a single domain:
.Bd -literal
spf_fetch example.com
.Ed
.Pp
Look-up a domain from a file:
.Bd -literal
cat domains
example.com
example.net
spf_fetch domains
.Ed
.Pp
Look-up IPv4 SPF records for a single domain:
.Bd -literal
spf_fetch -4 example.com
.Ed
.Pp
Look-up records for a single domain with filter:
.Bd -literal
cat filters/filter_sipcalc
#!/bin/sh
ip="$1"
is_err=$(sipcalc "$ip" | grep -i ERR)
if [ -z "$is_err" ] ; then
echo "$ip"
fi
spf_fetch -t filters/filter_sipcalc example.com
.Ed
.Sh DIAGNOSTICS
.Nm
utility always exits 0.
.Sh SEE ALSO
.Xr dig 1
.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.