]> gitweb.michael.orlitzky.com - list-remote-forwards.git/blob - list-remote-forwards.cabal
eae777bc0d0ac6f8c45fd55dfc920e7d2a225756
[list-remote-forwards.git] / list-remote-forwards.cabal
1 cabal-version: 3.0
2 name: list-remote-forwards
3 version: 0.0.1
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 license: AGPL-3.0-only
7 license-file: doc/LICENSE
8 bug-reports: mailto:michael@orlitzky.com
9 category: Mail, Utils
10 build-type: Simple
11 extra-source-files:
12 doc/list-remote-forwardsrc.example
13 doc/man1/list-remote-forwards.1
14 test/fixtures/postfixadmin.sqlite3
15 synopsis:
16 List all remote forwards for mail accounts stored in a SQL database.
17 description:
18 /Usage/:
19
20 @
21 list-remote-forwards [OPTIONS]
22 @
23
24 List all remote forwards for mail accounts stored in a SQL database.
25
26 A list of local domains is supplied to the program (more or less)
27 through the @--domain-query@ option. Any addresses which
28 forward to another address not contained in this list of local domains
29 is considered a remote forward. Remote forwards can cause problems for
30 a number of reasons, the most common of which are,
31
32 * If the sender has an SPF record authorizing his mail server to send
33 mail on his behalf, then when his message is forwarded by the
34 recipient's mail server, it will fail any subsequent SPF checks. This
35 will likely cause the message to be rejected, and the original
36 recipient's server will generate backscatter.
37
38 * If any spam makes it through the filter on the recipient's mail
39 server, that spam will then be forwarded to a remote destination. The
40 remote destination will blame the forwarding server for the spam, and
41 that can impact its reputation and potentially lead to a blacklisting
42 even though the spam did not originate on the recipient's server.
43
44 Whether or not these are an issue depends on the circumstances, but in
45 any case it is useful to know who is forwarding mail off-site.
46
47 /Input:/
48
49 None.
50
51 /Output:/
52
53 A list of addresses that are forwarded to remote domains.
54
55 /Options/:
56
57 @
58 \--database
59 @
60
61 The name of the database (or file, if SQLite) to which we should
62 connect.
63
64 Default: The name of the current user (Postgres only).
65
66 @
67 \--domain-query
68 @
69 SQL query used to produce a list of local domains. This should return
70 the set of all domains (i.e one column) that are local to the
71 server. See the default value for an example.
72
73 Default: \"SELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY domain;\"
74
75 @
76 \--exclude-mx, -e
77 @
78
79 The name of a mail exchanger, the forwards of whose domains we should
80 ignore. For example, if one mail exchanger, mx1.example.com, has
81 strict spam filtering, it may be acceptable to have remote forwarding
82 for domains that have mx1.example.com as their sole mail exchanger (MX
83 record). In that case, you might want to exclude those domains from
84 the report by naming mx1.example.com here.
85
86 A forward will be excluded from the report only if /all/ of its MX
87 records are contained in the given exclude list.
88
89 This option can be repeated to add mail exchangers to the exclude list.
90
91 Default: [] (empty)
92
93 @
94 \--forward-query, -f
95 @
96
97 SQL query used to produce a list of all forwards on the mail
98 system. This query should return the set of all (address, goto)
99 triples, where \"goto\" is the destination address; i.e. to where
100 the \"address\" forwards. The \"goto\" field may contain more
101 than one email address, separated by commas.
102
103 Default: \"SELECT address,goto FROM alias ORDER BY address;\"
104
105 @
106 \--host, -h
107 @
108
109 Hostname where the database is located (Postgres-only).
110
111 Default: None, a UNIX domain socket connection is attempted (Postgres only)
112
113 @
114 \--password
115 @
116
117 Password used to connect to the database (Postgres-only).
118
119 Default: None (assumes passwordless authentication)
120
121 @
122 \--port
123 @
124 Port number used to connect to the database (Postgres-only).
125
126 Default: None, a UNIX domain socket connection is attempted (Postgres only)
127
128 @
129 \--username, -u
130 @
131
132 Username used to connect to the database (Postgres-only).
133
134 Default: The current user
135
136 /Examples/:
137
138 @
139 $ list-remote-forwards --database=test\/fixtures\/postfixadmin.sqlite3
140 user1@example.com -> user1@example.net
141 user2@example.com -> user1@example.org
142 user2@example.com -> user2@example.org
143 user2@example.com -> user3@example.org
144 user7@example.com -> user8@example.net
145 @
146
147 executable list-remote-forwards
148 build-depends:
149 base >= 4.15 && < 5,
150 bytestring >= 0.10,
151 cmdargs >= 0.10,
152 configurator >= 0.2,
153 containers >= 0.5,
154 dns >= 1.4,
155 directory >= 1.2,
156 filepath >= 1.3,
157 HDBC >= 2.4,
158 HDBC-postgresql >= 2.3,
159 HDBC-sqlite3 >= 2.3,
160 MissingH >= 1.2,
161 tasty >= 0.8,
162 tasty-hunit >= 0.8
163
164 default-language:
165 Haskell2010
166
167 main-is:
168 Main.hs
169
170 hs-source-dirs:
171 src/
172
173 other-modules:
174 Configuration
175 CommandLine
176 DNS
177 Forward
178 MxList
179 OptionalConfiguration
180 Paths_list_remote_forwards
181 Report
182 String
183
184 autogen-modules:
185 Paths_list_remote_forwards
186
187 test-suite testsuite
188 type: exitcode-stdio-1.0
189 hs-source-dirs: src test
190 default-language: Haskell2010
191 main-is: TestSuite.hs
192
193 other-modules:
194 Configuration
195 DNS
196 Forward
197 MxList
198 OptionalConfiguration
199 Paths_list_remote_forwards
200 Report
201
202 autogen-modules:
203 Paths_list_remote_forwards
204
205 build-depends:
206 base >= 4.15 && < 5,
207 bytestring >= 0.10,
208 cmdargs >= 0.10,
209 configurator >= 0.2,
210 containers >= 0.5,
211 dns >= 1.4,
212 directory >= 1.2,
213 filepath >= 1.3,
214 HDBC >= 2.4,
215 HDBC-sqlite3 >= 2.3,
216 MissingH >= 1.2,
217 tasty >= 0.8,
218 tasty-hunit >= 0.8
219
220 test-suite doctests
221 type: exitcode-stdio-1.0
222 hs-source-dirs: test
223 default-language: Haskell2010
224 main-is: Doctests.hs
225 build-depends:
226 base >= 4.15 && < 5,
227 -- Additional test dependencies.
228 doctest >= 0.9,
229 filemanip >= 0.3.6
230
231 source-repository head
232 type: git
233 location: http://gitweb.michael.orlitzky.com/list-remote-forwards.git
234 branch: master