]> gitweb.michael.orlitzky.com - mailbox-count.git/blob - mailbox-count.cabal
c495ca2cff93cad3f34d519f641e2ee3c34c2c35
[mailbox-count.git] / mailbox-count.cabal
1 cabal-version: 3.0
2 name: mailbox-count
3 version: 0.0.6
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 license: AGPL-3.0-or-later
7 license-file: doc/LICENSE
8 homepage: https://michael.orlitzky.com/code/mailbox-count.xhtml
9 bug-reports: mailto:michael@orlitzky.com
10 category: Mail, Utils
11 build-type: Simple
12 extra-source-files:
13 doc/COPYING
14 doc/mailbox-countrc.example
15 doc/man1/mailbox-count.1
16 test/fixtures/postfixadmin.sqlite3
17 synopsis:
18 Count mailboxes in a SQL database
19 description:
20 /Usage/:
21
22 @
23 mailbox-count [OPTIONS]
24 @
25
26 Mailbox-count produces a simple count of mailboxes that exist
27 per-domain in some SQL database. The default queries are compatible
28 with the schema used by PostfixAdmin <https://postfixadmin.sourceforge.net/>,
29 but it is possible to supply your own queries via the @--summary-query@
30 and @--detail-query@ options.
31
32 The summary report lists each domain, along with the number of
33 mailboxes owned by that domain. The order is determined by the summary
34 query, which lists the domains alphabetically by default.
35
36 The default detail report shows the same, but also contains a list of
37 each individual mailbox (again in alphabetical order) belonging to the
38 domains.
39
40 /Input/:
41
42 None.
43
44 /Output/:
45
46 Either a summary, or detailed report (with @--detail@) of the
47 number of mailboxes per-domain contained in the database.
48
49 /Options/:
50
51 * \--database
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 * \--detail
59
60 Produce a detailed report listing all mailboxes by domain.
61
62 * \--detail-query
63
64 SQL query used to produce the detail report. This should return the
65 set of all (domain, username) pairs. See the default value for an
66 example.
67
68 Default: \"SELECT domain,username FROM mailbox ORDER BY domain;\"
69
70 * \--host
71
72 Hostname where the database is located (Postgres-only).
73
74 Default: None, a UNIX domain socket connection is attempted
75 (Postgres only)
76
77 * \--password
78
79 Password used to connect to the database (Postgres-only).
80
81 Default: None (assumes passwordless authentication)
82
83 * \--port
84
85 Port number used to connect to the database (Postgres-only).
86
87 Default: None, a UNIX domain socket connection is attempted
88 (Postgres only)
89
90 * \--summary-query
91
92 SQL query used to produce the summary report. This should return
93 (domain, user count) pairs. See the default value for an
94 example.
95
96 Default: \"SELECT domain,COUNT(username) FROM mailbox GROUP BY domain
97 ORDER BY domain;\"
98
99 * \--username
100
101 Username used to connect to the database (Postgres-only).
102
103 Default: The current user
104
105 /Examples/:
106
107 The default summary report:
108
109 @
110 $ mailbox-count --database=postfixadmin.sqlite3
111 Summary (number of mailboxes per domain)
112 \----------------------------------------
113 example.com: 3
114 example.invalid: 1
115 example.net: 2
116 example.org: 1
117 @
118
119 The more detailed report:
120
121 @
122 $ mailbox-count --detail --database=postfixadmin.sqlite3
123 Detail (list of all mailboxes by domain)
124 \----------------------------------------
125 example.com (3):
126 &#x20; user1
127 &#x20; user3
128 &#x20; user5
129
130 example.invalid (1):
131 &#x20; user7
132
133 example.net (2):
134 &#x20; user2
135 &#x20; user4
136
137 example.org (1):
138 &#x20; user6
139 @
140
141
142
143 executable mailbox-count
144 build-depends:
145 base >= 4.15 && < 5,
146 cmdargs >= 0.10,
147 configurator >= 0.2,
148 containers >= 0.5,
149 directory >= 1.2,
150 filepath >= 1.3,
151 HDBC >= 2.4,
152 HDBC-postgresql >= 2.3,
153 HDBC-sqlite3 >= 2.3,
154 MissingH >= 1.2,
155 tasty >= 0.8,
156 tasty-hunit >= 0.8
157
158 default-language:
159 Haskell2010
160
161 main-is:
162 Main.hs
163
164 hs-source-dirs:
165 src/
166
167 other-modules:
168 Configuration
169 CommandLine
170 OptionalConfiguration
171 Paths_mailbox_count
172 Report
173
174 autogen-modules:
175 Paths_mailbox_count
176
177 test-suite testsuite
178 type: exitcode-stdio-1.0
179 hs-source-dirs: src test
180 default-language: Haskell2010
181 main-is: TestSuite.hs
182
183 other-modules:
184 Configuration
185 OptionalConfiguration
186 Paths_mailbox_count
187 Report
188
189 autogen-modules:
190 Paths_mailbox_count
191
192 build-depends:
193 base >= 4.15 && < 5,
194 cmdargs >= 0.10,
195 configurator >= 0.2,
196 containers >= 0.5,
197 directory >= 1.2,
198 filepath >= 1.3,
199 HDBC >= 2.4,
200 HDBC-sqlite3 >= 2.3,
201 MissingH >= 1.2,
202 tasty >= 0.8,
203 tasty-hunit >= 0.8
204
205
206 test-suite doctests
207 type: exitcode-stdio-1.0
208 hs-source-dirs: test
209 default-language: Haskell2010
210 main-is: Doctests.hs
211 build-depends:
212 base >= 4.15 && < 5,
213 -- Additional test dependencies.
214 doctest >= 0.9,
215 filemanip >= 0.3.6
216
217
218
219 source-repository head
220 type: git
221 location: https://gitweb.michael.orlitzky.com/mailbox-count.git
222 branch: master