]> gitweb.michael.orlitzky.com - mailbox-count.git/blob - mailbox-count.cabal
Add a cabal description and remove the TODO.
[mailbox-count.git] / mailbox-count.cabal
1 name: mailbox-count
2 version: 0.0.2
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/mailbox-countrc.example
13 doc/man1/mailbox-count.1
14 test/fixtures/postfixadmin.sqlite3
15 synopsis:
16 Count mailboxes in a SQL database.
17 description:
18 /Usage/:
19 .
20 @
21 mailbox-count [OPTIONS]
22 @
23 .
24 Mailbox-count produces a simple count of mailboxes that exist
25 per-domain in some SQL database. The default queries are compatible
26 with the schema used by PostfixAdmin <http://postfixadmin.sourceforge.net/>,
27 but it is possible to supply your own queries via the @--summary-query@
28 and @--detail-query@ options.
29 .
30 The summary report lists each domain, along with the number of
31 mailboxes owned by that domain. The order is determined by the summary
32 query, which lists the domains alphabetically by default.
33 .
34 The default detail report shows the same, but also contains a list of
35 each individual mailbox (again in alphabetical order) belonging to the
36 domains.
37 .
38 /Input/:
39 .
40 None.
41 .
42 /Output/:
43 .
44 Either a summary, or detailed report (with @--detail@) of the
45 number of mailboxes per-domain contained in the database.
46 .
47 /Options/:
48 .
49 @
50 \--database
51 @
52 .
53 The name of the database (or file, if SQLite) to which we should
54 connect.
55 .
56 Default: The name of the current user (Postgres only).
57 .
58 @
59 \--detail
60 @
61 .
62 Produce a detailed report listing all mailboxes by domain.
63 .
64 @
65 \--detail-query
66 @
67 .
68 SQL query used to produce the detail report. This should return the
69 set of all (domain, username) pairs. See the default value for an
70 example.
71 .
72 Default: \"SELECT domain,username FROM mailbox ORDER BY domain;\"
73 .
74 @
75 \--host
76 @
77 .
78 Hostname where the database is located (Postgres-only).
79 .
80 Default: None, a UNIX domain socket connection is attempted (Postgres only)
81 .
82 @
83 \--password
84 @
85 .
86 Password used to connect to the database (Postgres-only).
87 .
88 Default: None (assumes passwordless authentication)
89 .
90 @
91 \--port
92 @
93 Port number used to connect to the database (Postgres-only).
94 .
95 Default: None, a UNIX domain socket connection is attempted (Postgres only)
96 .
97 @
98 \--summary-query
99 @
100 .
101 SQL query used to produce the summary report. This should return
102 (domain, user count) pairs. See the default value for an
103 example.
104 .
105 Default: \"SELECT domain,COUNT(username) FROM mailbox GROUP BY domain
106 ORDER BY domain;\"
107 .
108 @
109 \--username
110 @
111 .
112 Username used to connect to the database (Postgres-only).
113 .
114 Default: The current user
115 .
116 /Examples/:
117 .
118 The default summary report:
119 .
120 @
121 $ mailbox-count --database=postfixadmin.sqlite3
122 Summary (number of mailboxes per domain)
123 \----------------------------------------
124 example.com: 3
125 example.invalid: 1
126 example.net: 2
127 example.org: 1
128 @
129 .
130 The more detailed report:
131 .
132 @
133 $ mailbox-count --detail --database=postfixadmin.sqlite3
134 Detail (list of all mailboxes by domain)
135 \----------------------------------------
136 example.com (3):
137 &#x20; user1
138 &#x20; user3
139 &#x20; user5
140
141 example.invalid (1):
142 &#x20; user7
143
144 example.net (2):
145 &#x20; user2
146 &#x20; user4
147
148 example.org (1):
149 &#x20; user6
150 @
151
152
153
154 executable mailbox-count
155 build-depends:
156 base >= 4.6 && < 5,
157 cmdargs >= 0.10,
158 configurator >= 0.2,
159 containers >= 0.5,
160 directory >= 1.2,
161 filepath >= 1.3,
162 HDBC >= 2.4,
163 HDBC-postgresql >= 2.3,
164 HDBC-sqlite3 >= 2.3,
165 MissingH >= 1.2,
166 tasty >= 0.8,
167 tasty-hunit >= 0.8
168 main-is:
169 Main.hs
170
171 hs-source-dirs:
172 src/
173
174 other-modules:
175 Configuration
176 CommandLine
177 OptionalConfiguration
178 Report
179
180 ghc-options:
181 -Wall
182 -fwarn-hi-shadowing
183 -fwarn-missing-signatures
184 -fwarn-name-shadowing
185 -fwarn-orphans
186 -fwarn-type-defaults
187 -fwarn-tabs
188 -fwarn-incomplete-record-updates
189 -fwarn-monomorphism-restriction
190 -fwarn-unused-do-bind
191 -rtsopts
192 -threaded
193 -optc-O3
194 -optc-march=native
195
196
197 test-suite testsuite
198 type: exitcode-stdio-1.0
199 hs-source-dirs: src test
200 main-is: TestSuite.hs
201 build-depends:
202 base >= 4.6 && < 5,
203 cmdargs >= 0.10,
204 configurator >= 0.2,
205 containers >= 0.5,
206 directory >= 1.2,
207 filepath >= 1.3,
208 HDBC >= 2.4,
209 HDBC-postgresql >= 2.3,
210 HDBC-sqlite3 >= 2.3,
211 MissingH >= 1.2,
212 tasty >= 0.8,
213 tasty-hunit >= 0.8
214
215 -- It's not entirely clear to me why I have to reproduce all of this.
216 ghc-options:
217 -Wall
218 -fwarn-hi-shadowing
219 -fwarn-missing-signatures
220 -fwarn-name-shadowing
221 -fwarn-orphans
222 -fwarn-type-defaults
223 -fwarn-tabs
224 -fwarn-incomplete-record-updates
225 -fwarn-monomorphism-restriction
226 -fwarn-unused-do-bind
227 -O2
228
229
230 test-suite doctests
231 type: exitcode-stdio-1.0
232 hs-source-dirs: test
233 main-is: Doctests.hs
234 build-depends:
235 base >= 4.6 && < 5,
236 -- Additional test dependencies.
237 doctest >= 0.9,
238 filemanip >= 0.3.6
239
240 -- It's not entirely clear to me why I have to reproduce all of this.
241 ghc-options:
242 -Wall
243 -fwarn-hi-shadowing
244 -fwarn-missing-signatures
245 -fwarn-name-shadowing
246 -fwarn-orphans
247 -fwarn-type-defaults
248 -fwarn-tabs
249 -fwarn-incomplete-record-updates
250 -fwarn-monomorphism-restriction
251 -fwarn-unused-do-bind
252 -rtsopts
253 -threaded
254 -optc-O3
255 -optc-march=native
256
257
258 source-repository head
259 type: git
260 location: http://michael.orlitzky.com/git/mailbox-count.git
261 branch: master