4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
7 license-file: doc/LICENSE
8 bug-reports: mailto:michael@orlitzky.com
12 doc/mailbox-countrc.example
13 doc/man1/mailbox-count.1
14 test/fixtures/postfixadmin.sqlite3
16 Count mailboxes in a SQL database.
21 mailbox-count [OPTIONS]
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 <https://postfixadmin.sourceforge.net/>,
27 but it is possible to supply your own queries via the @--summary-query@
28 and @--detail-query@ options.
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.
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
44 Either a summary, or detailed report (with @--detail@) of the
45 number of mailboxes per-domain contained in the database.
51 The name of the database (or file, if SQLite) to which we should
54 Default: The name of the current user (Postgres only).
58 Produce a detailed report listing all mailboxes by domain.
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
66 Default: \"SELECT domain,username FROM mailbox ORDER BY domain;\"
70 Hostname where the database is located (Postgres-only).
72 Default: None, a UNIX domain socket connection is attempted
77 Password used to connect to the database (Postgres-only).
79 Default: None (assumes passwordless authentication)
83 Port number used to connect to the database (Postgres-only).
85 Default: None, a UNIX domain socket connection is attempted
90 SQL query used to produce the summary report. This should return
91 (domain, user count) pairs. See the default value for an
94 Default: \"SELECT domain,COUNT(username) FROM mailbox GROUP BY domain
99 Username used to connect to the database (Postgres-only).
101 Default: The current user
105 The default summary report:
108 $ mailbox-count --database=postfixadmin.sqlite3
109 Summary (number of mailboxes per domain)
110 \----------------------------------------
117 The more detailed report:
120 $ mailbox-count --detail --database=postfixadmin.sqlite3
121 Detail (list of all mailboxes by domain)
122 \----------------------------------------
141 executable mailbox-count
150 HDBC-postgresql >= 2.3,
168 OptionalConfiguration
176 type: exitcode-stdio-1.0
177 hs-source-dirs: src test
178 default-language: Haskell2010
179 main-is: TestSuite.hs
183 OptionalConfiguration
205 type: exitcode-stdio-1.0
207 default-language: Haskell2010
211 -- Additional test dependencies.
217 source-repository head
219 location: https://gitweb.michael.orlitzky.com/mailbox-count.git