4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
7 license-file: doc/LICENSE
8 homepage: https://michael.orlitzky.com/code/mailbox-count.xhtml
9 bug-reports: mailto:michael@orlitzky.com
13 doc/mailbox-countrc.example
14 doc/man1/mailbox-count.1
15 test/fixtures/postfixadmin.sqlite3
17 Count mailboxes in a SQL database.
22 mailbox-count [OPTIONS]
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.
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.
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
45 Either a summary, or detailed report (with @--detail@) of the
46 number of mailboxes per-domain contained in the database.
52 The name of the database (or file, if SQLite) to which we should
55 Default: The name of the current user (Postgres only).
59 Produce a detailed report listing all mailboxes by domain.
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
67 Default: \"SELECT domain,username FROM mailbox ORDER BY domain;\"
71 Hostname where the database is located (Postgres-only).
73 Default: None, a UNIX domain socket connection is attempted
78 Password used to connect to the database (Postgres-only).
80 Default: None (assumes passwordless authentication)
84 Port number used to connect to the database (Postgres-only).
86 Default: None, a UNIX domain socket connection is attempted
91 SQL query used to produce the summary report. This should return
92 (domain, user count) pairs. See the default value for an
95 Default: \"SELECT domain,COUNT(username) FROM mailbox GROUP BY domain
100 Username used to connect to the database (Postgres-only).
102 Default: The current user
106 The default summary report:
109 $ mailbox-count --database=postfixadmin.sqlite3
110 Summary (number of mailboxes per domain)
111 \----------------------------------------
118 The more detailed report:
121 $ mailbox-count --detail --database=postfixadmin.sqlite3
122 Detail (list of all mailboxes by domain)
123 \----------------------------------------
142 executable mailbox-count
151 HDBC-postgresql >= 2.3,
169 OptionalConfiguration
177 type: exitcode-stdio-1.0
178 hs-source-dirs: src test
179 default-language: Haskell2010
180 main-is: TestSuite.hs
184 OptionalConfiguration
206 type: exitcode-stdio-1.0
208 default-language: Haskell2010
212 -- Additional test dependencies.
218 source-repository head
220 location: https://gitweb.michael.orlitzky.com/mailbox-count.git