]> gitweb.michael.orlitzky.com - mailbox-count.git/blob - mailbox-count.cabal
fb2e6b2a160487d4c952c06214809aea7918907c
[mailbox-count.git] / mailbox-count.cabal
1 cabal-version: 3.0
2 name: mailbox-count
3 version: 0.0.5
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 license: AGPL-3.0-only
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.15 && < 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
169 default-language:
170 Haskell2010
171
172 main-is:
173 Main.hs
174
175 hs-source-dirs:
176 src/
177
178 other-modules:
179 Configuration
180 CommandLine
181 OptionalConfiguration
182 Paths_mailbox_count
183 Report
184
185 autogen-modules:
186 Paths_mailbox_count
187
188 test-suite testsuite
189 type: exitcode-stdio-1.0
190 hs-source-dirs: src test
191 default-language: Haskell2010
192 main-is: TestSuite.hs
193
194 other-modules:
195 Configuration
196 OptionalConfiguration
197 Paths_mailbox_count
198 Report
199
200 autogen-modules:
201 Paths_mailbox_count
202
203 build-depends:
204 base >= 4.15 && < 5,
205 cmdargs >= 0.10,
206 configurator >= 0.2,
207 containers >= 0.5,
208 directory >= 1.2,
209 filepath >= 1.3,
210 HDBC >= 2.4,
211 HDBC-postgresql >= 2.3,
212 HDBC-sqlite3 >= 2.3,
213 MissingH >= 1.2,
214 tasty >= 0.8,
215 tasty-hunit >= 0.8
216
217
218 test-suite doctests
219 type: exitcode-stdio-1.0
220 hs-source-dirs: test
221 default-language: Haskell2010
222 main-is: Doctests.hs
223 build-depends:
224 base >= 4.15 && < 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