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