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