2 name: list-remote-forwards
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 homepage: https://michael.orlitzky.com/code/list-remote-forwards.xhtml
7 license: AGPL-3.0-or-later
8 license-file: doc/LICENSE
9 bug-reports: mailto:michael@orlitzky.com
14 doc/list-remote-forwardsrc.example
15 doc/man1/list-remote-forwards.1
16 test/fixtures/postfixadmin.sqlite3
18 List all remote forwards for mail accounts stored in a SQL database.
23 list-remote-forwards [OPTIONS]
26 List all remote forwards for mail accounts stored in a SQL database.
28 A list of local domains is supplied to the program (more or less)
29 through the @--domain-query@ option. Any addresses which
30 forward to another address not contained in this list of local domains
31 is considered a remote forward. Remote forwards can cause problems for
32 a number of reasons, the most common of which are,
34 * If the sender has an SPF record authorizing his mail server to send
35 mail on his behalf, then when his message is forwarded by the
36 recipient's mail server, it will fail any subsequent SPF checks. This
37 will likely cause the message to be rejected, and the original
38 recipient's server will generate backscatter.
40 * If any spam makes it through the filter on the recipient's mail
41 server, that spam will then be forwarded to a remote destination. The
42 remote destination will blame the forwarding server for the spam, and
43 that can impact its reputation and potentially lead to a blacklisting
44 even though the spam did not originate on the recipient's server.
46 Whether or not these are an issue depends on the circumstances, but in
47 any case it is useful to know who is forwarding mail off-site.
55 A list of addresses that are forwarded to remote domains.
61 The name of the database (or file, if SQLite) to which we should
64 Default: The name of the current user (Postgres only).
68 SQL query used to produce a list of local domains. This should
69 return the set of all domains (i.e one column) that are local to the
70 server. See the default value for an example.
72 Default: \"SELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY
77 The name of a mail exchanger, the forwards of whose domains we
78 should ignore. For example, if one mail exchanger,
79 mx1.example.com, has strict spam filtering, it may be acceptable
80 to have remote forwarding for domains that have mx1.example.com
81 as their sole mail exchanger (MX record). In that case, you
82 might want to exclude those domains from the report by naming
85 A forward will be excluded from the report only if /all/ of its MX
86 records are contained in the given exclude list.
88 This option can be repeated to add mail exchangers to the exclude list.
92 * \--forward-query, -f
94 SQL query used to produce a list of all forwards on the mail
95 system. This query should return the set of all (address, goto)
96 pairs, where \"goto\" is the destination address; i.e. to
97 where the \"address\" forwards. The \"goto\" field may contain
98 more than one email address, separated by commas.
100 Default: \"SELECT address,goto FROM alias ORDER BY address;\"
104 Hostname where the database is located (Postgres-only).
106 Default: None, a UNIX domain socket connection is attempted
111 Password used to connect to the database (Postgres-only).
113 Default: None (assumes passwordless authentication)
117 Port number used to connect to the database (Postgres-only).
119 Default: None, a UNIX domain socket connection is attempted
124 Username used to connect to the database (Postgres-only).
126 Default: The current user
131 $ list-remote-forwards --database=test\/fixtures\/postfixadmin.sqlite3
132 user1@example.com -> user1@example.net
133 user2@example.com -> user1@example.org
134 user2@example.com -> user2@example.org
135 user2@example.com -> user3@example.org
136 user7@example.com -> user8@example.net
139 executable list-remote-forwards
150 HDBC-postgresql >= 2.3,
171 OptionalConfiguration
172 Paths_list_remote_forwards
177 Paths_list_remote_forwards
180 type: exitcode-stdio-1.0
181 hs-source-dirs: src test
182 default-language: Haskell2010
183 main-is: TestSuite.hs
190 OptionalConfiguration
191 Paths_list_remote_forwards
195 Paths_list_remote_forwards
213 type: exitcode-stdio-1.0
215 default-language: Haskell2010
219 -- Additional test dependencies.
223 source-repository head
225 location: https://gitweb.michael.orlitzky.com/list-remote-forwards.git