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
14 doc/mailbox-countrc.example
15 doc/man1/mailbox-count.1
16 test/fixtures/postfixadmin.sqlite3
18 Count mailboxes in a SQL database
23 mailbox-count [OPTIONS]
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.
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.
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
46 Either a summary, or detailed report (with @--detail@) of the
47 number of mailboxes per-domain contained in the database.
53 The name of the database (or file, if SQLite) to which we should
56 Default: The name of the current user (Postgres only).
60 Produce a detailed report listing all mailboxes by domain.
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
68 Default: \"SELECT domain,username FROM mailbox ORDER BY domain;\"
72 Hostname where the database is located (Postgres-only).
74 Default: None, a UNIX domain socket connection is attempted
79 Password used to connect to the database (Postgres-only).
81 Default: None (assumes passwordless authentication)
85 Port number used to connect to the database (Postgres-only).
87 Default: None, a UNIX domain socket connection is attempted
92 SQL query used to produce the summary report. This should return
93 (domain, user count) pairs. See the default value for an
96 Default: \"SELECT domain,COUNT(username) FROM mailbox GROUP BY domain
101 Username used to connect to the database (Postgres-only).
103 Default: The current user
107 The default summary report:
110 $ mailbox-count --database=postfixadmin.sqlite3
111 Summary (number of mailboxes per domain)
112 \----------------------------------------
119 The more detailed report:
122 $ mailbox-count --detail --database=postfixadmin.sqlite3
123 Detail (list of all mailboxes by domain)
124 \----------------------------------------
143 executable mailbox-count
152 HDBC-postgresql >= 2.3,
170 OptionalConfiguration
178 type: exitcode-stdio-1.0
179 hs-source-dirs: src test
180 default-language: Haskell2010
181 main-is: TestSuite.hs
185 OptionalConfiguration
207 type: exitcode-stdio-1.0
209 default-language: Haskell2010
213 -- Additional test dependencies.
219 source-repository head
221 location: https://gitweb.michael.orlitzky.com/mailbox-count.git