]> gitweb.michael.orlitzky.com - mailbox-count.git/blob - mailbox-count.cabal
mailbox-count.cabal: add other-modules for the test suite.
[mailbox-count.git] / mailbox-count.cabal
1 name: mailbox-count
2 version: 0.0.3
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 license: AGPL-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.8 && < 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 semigroups >= 0.18,
167 tasty >= 0.8,
168 tasty-hunit >= 0.8
169 main-is:
170 Main.hs
171
172 hs-source-dirs:
173 src/
174
175 other-modules:
176 Configuration
177 CommandLine
178 OptionalConfiguration
179 -- WARNING: the Paths_mailbox_count module is automatically generated by
180 -- Cabal itself. We don't want it included in the release tarballs,
181 -- since we typically want the paths that the user has configured.
182 -- Nevertheless, Cabal will complain if we don't include it here.
183 Paths_mailbox_count
184 Report
185
186
187 test-suite testsuite
188 type: exitcode-stdio-1.0
189 hs-source-dirs: src test
190 main-is: TestSuite.hs
191
192 other-modules:
193 Configuration
194 OptionalConfiguration
195 -- WARNING: the Paths_mailbox_count module is automatically generated by
196 -- Cabal itself. We don't want it included in the release tarballs,
197 -- since we typically want the paths that the user has configured.
198 -- Nevertheless, Cabal will complain if we don't include it here.
199 Paths_mailbox_count
200 Report
201
202 build-depends:
203 base >= 4.8 && < 5,
204 cmdargs >= 0.10,
205 configurator >= 0.2,
206 containers >= 0.5,
207 directory >= 1.2,
208 filepath >= 1.3,
209 HDBC >= 2.4,
210 HDBC-postgresql >= 2.3,
211 HDBC-sqlite3 >= 2.3,
212 MissingH >= 1.2,
213 semigroups >= 0.18,
214 tasty >= 0.8,
215 tasty-hunit >= 0.8
216
217
218
219 test-suite doctests
220 type: exitcode-stdio-1.0
221 hs-source-dirs: test
222 main-is: Doctests.hs
223 build-depends:
224 base >= 4.8 && < 5,
225 -- Additional test dependencies.
226 doctest >= 0.9,
227 filemanip >= 0.3.6
228
229
230
231 source-repository head
232 type: git
233 location: http://gitweb.michael.orlitzky.com/mailbox-count.git
234 branch: master