4718b35534331b0a5bd58ca1f9d54a44a1126cc7
[list-remote-forwards.git] / list-remote-forwards.cabal
1 name: list-remote-forwards
2 version: 0.0.1
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 license: GPL-3
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-forwards.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 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 Can be repeated to exclude more than one mail exchanger.
87 .
88 Default: [] (empty)
89 .
90 @
91 \--forward-query, -f
92 @
93 .
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 triples, where \"goto\" is the destination address; i.e. to where
97 the \"address\" forwards. The \"goto\" field may contain more
98 than one email address, separated by commas.
99 .
100 Default: \"SELECT address,goto FROM alias ORDER BY address;\"
101 .
102 @
103 \--host, -h
104 @
105 .
106 Hostname where the database is located (Postgres-only).
107 .
108 Default: None, a UNIX domain socket connection is attempted (Postgres only)
109 .
110 @
111 \--password
112 @
113 .
114 Password used to connect to the database (Postgres-only).
115 .
116 Default: None (assumes passwordless authentication)
117 .
118 @
119 \--port
120 @
121 Port number used to connect to the database (Postgres-only).
122 .
123 Default: None, a UNIX domain socket connection is attempted (Postgres only)
124 .
125 @
126 \--username, -u
127 @
128 .
129 Username used to connect to the database (Postgres-only).
130 .
131 Default: The current user
132 .
133 /Examples/:
134 .
135 @
136 $ list-remote-forwards --database=postfixadmin.sqlite3
137 user1@example.com -> user1@example.net
138 user2@example.com -> user1@example.org
139 user2@example.com -> user2@example.org
140 user2@example.com -> user3@example.org
141 user7@example.com -> user8@example.net
142 @
143
144 executable list-remote-forwards
145 build-depends:
146 base >= 4.6 && < 5,
147 bytestring >= 0.10,
148 cmdargs >= 0.10,
149 configurator >= 0.2,
150 containers >= 0.5,
151 dns >= 1.4,
152 directory >= 1.2,
153 filepath >= 1.3,
154 HDBC >= 2.4,
155 HDBC-postgresql >= 2.3,
156 HDBC-sqlite3 >= 2.3,
157 MissingH >= 1.2,
158 tasty >= 0.8,
159 tasty-hunit >= 0.8,
160 tasty-quickcheck >= 0.8
161 main-is:
162 Main.hs
163
164 hs-source-dirs:
165 src/
166
167 other-modules:
168 Configuration
169 CommandLine
170 DNS
171 OptionalConfiguration
172 MxList
173 Report
174
175 ghc-options:
176 -Wall
177 -fwarn-hi-shadowing
178 -fwarn-missing-signatures
179 -fwarn-name-shadowing
180 -fwarn-orphans
181 -fwarn-type-defaults
182 -fwarn-tabs
183 -fwarn-incomplete-record-updates
184 -fwarn-monomorphism-restriction
185 -fwarn-unused-do-bind
186 -rtsopts
187 -threaded
188 -optc-O3
189 -optc-march=native
190
191
192 test-suite testsuite
193 type: exitcode-stdio-1.0
194 hs-source-dirs: src test
195 main-is: TestSuite.hs
196 build-depends:
197 base >= 4.6 && < 5,
198 bytestring >= 0.10,
199 cmdargs >= 0.10,
200 configurator >= 0.2,
201 containers >= 0.5,
202 dns >= 1.4,
203 directory >= 1.2,
204 filepath >= 1.3,
205 HDBC >= 2.4,
206 HDBC-postgresql >= 2.3,
207 HDBC-sqlite3 >= 2.3,
208 MissingH >= 1.2,
209 tasty >= 0.8,
210 tasty-hunit >= 0.8,
211 tasty-quickcheck >= 0.8
212
213 -- It's not entirely clear to me why I have to reproduce all of this.
214 ghc-options:
215 -Wall
216 -fwarn-hi-shadowing
217 -fwarn-missing-signatures
218 -fwarn-name-shadowing
219 -fwarn-orphans
220 -fwarn-type-defaults
221 -fwarn-tabs
222 -fwarn-incomplete-record-updates
223 -fwarn-monomorphism-restriction
224 -fwarn-unused-do-bind
225 -O2
226
227
228 test-suite doctests
229 type: exitcode-stdio-1.0
230 hs-source-dirs: test
231 main-is: Doctests.hs
232 build-depends:
233 base == 4.*,
234 -- Additional test dependencies.
235 doctest >= 0.9,
236 filemanip >= 0.3.6
237
238 -- It's not entirely clear to me why I have to reproduce all of this.
239 ghc-options:
240 -Wall
241 -fwarn-hi-shadowing
242 -fwarn-missing-signatures
243 -fwarn-name-shadowing
244 -fwarn-orphans
245 -fwarn-type-defaults
246 -fwarn-tabs
247 -fwarn-incomplete-record-updates
248 -fwarn-monomorphism-restriction
249 -fwarn-unused-do-bind
250 -rtsopts
251 -threaded
252 -optc-O3
253 -optc-march=native
254
255
256 source-repository head
257 type: git
258 location: http://michael.orlitzky.com/git/list-remote-forwards.git
259 branch: master