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