]> 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 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-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 * \--database
50
51 The name of the database (or file, if SQLite) to which we should
52 connect.
53
54 Default: The name of the current user (Postgres only).
55
56 * \--detail
57
58 Produce a detailed report listing all mailboxes by domain.
59
60 * \--detail-query
61
62 SQL query used to produce the detail report. This should return the
63 set of all (domain, username) pairs. See the default value for an
64 example.
65
66 Default: \"SELECT domain,username FROM mailbox ORDER BY domain;\"
67
68 * \--host
69
70 Hostname where the database is located (Postgres-only).
71
72 Default: None, a UNIX domain socket connection is attempted
73 (Postgres only)
74
75 * \--password
76
77 Password used to connect to the database (Postgres-only).
78
79 Default: None (assumes passwordless authentication)
80
81 * \--port
82
83 Port number used to connect to the database (Postgres-only).
84
85 Default: None, a UNIX domain socket connection is attempted
86 (Postgres only)
87
88 * \--summary-query
89
90 SQL query used to produce the summary report. This should return
91 (domain, user count) pairs. See the default value for an
92 example.
93
94 Default: \"SELECT domain,COUNT(username) FROM mailbox GROUP BY domain
95 ORDER BY domain;\"
96
97 * \--username
98
99 Username used to connect to the database (Postgres-only).
100
101 Default: The current user
102
103 /Examples/:
104
105 The default summary report:
106
107 @
108 $ mailbox-count --database=postfixadmin.sqlite3
109 Summary (number of mailboxes per domain)
110 \----------------------------------------
111 example.com: 3
112 example.invalid: 1
113 example.net: 2
114 example.org: 1
115 @
116
117 The more detailed report:
118
119 @
120 $ mailbox-count --detail --database=postfixadmin.sqlite3
121 Detail (list of all mailboxes by domain)
122 \----------------------------------------
123 example.com (3):
124 &#x20; user1
125 &#x20; user3
126 &#x20; user5
127
128 example.invalid (1):
129 &#x20; user7
130
131 example.net (2):
132 &#x20; user2
133 &#x20; user4
134
135 example.org (1):
136 &#x20; user6
137 @
138
139
140
141 executable mailbox-count
142 build-depends:
143 base >= 4.15 && < 5,
144 cmdargs >= 0.10,
145 configurator >= 0.2,
146 containers >= 0.5,
147 directory >= 1.2,
148 filepath >= 1.3,
149 HDBC >= 2.4,
150 HDBC-postgresql >= 2.3,
151 HDBC-sqlite3 >= 2.3,
152 MissingH >= 1.2,
153 tasty >= 0.8,
154 tasty-hunit >= 0.8
155
156 default-language:
157 Haskell2010
158
159 main-is:
160 Main.hs
161
162 hs-source-dirs:
163 src/
164
165 other-modules:
166 Configuration
167 CommandLine
168 OptionalConfiguration
169 Paths_mailbox_count
170 Report
171
172 autogen-modules:
173 Paths_mailbox_count
174
175 test-suite testsuite
176 type: exitcode-stdio-1.0
177 hs-source-dirs: src test
178 default-language: Haskell2010
179 main-is: TestSuite.hs
180
181 other-modules:
182 Configuration
183 OptionalConfiguration
184 Paths_mailbox_count
185 Report
186
187 autogen-modules:
188 Paths_mailbox_count
189
190 build-depends:
191 base >= 4.15 && < 5,
192 cmdargs >= 0.10,
193 configurator >= 0.2,
194 containers >= 0.5,
195 directory >= 1.2,
196 filepath >= 1.3,
197 HDBC >= 2.4,
198 HDBC-sqlite3 >= 2.3,
199 MissingH >= 1.2,
200 tasty >= 0.8,
201 tasty-hunit >= 0.8
202
203
204 test-suite doctests
205 type: exitcode-stdio-1.0
206 hs-source-dirs: test
207 default-language: Haskell2010
208 main-is: Doctests.hs
209 build-depends:
210 base >= 4.15 && < 5,
211 -- Additional test dependencies.
212 doctest >= 0.9,
213 filemanip >= 0.3.6
214
215
216
217 source-repository head
218 type: git
219 location: http://gitweb.michael.orlitzky.com/mailbox-count.git
220 branch: master