X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailbox-count.git;a=blobdiff_plain;f=doc%2Fman1%2Fmailbox-count.1;h=0c592405a790c759714d0a8f542223fba8bf4f44;hp=e674f556ec67627f9e8acb63053c2eae453de211;hb=9aeae00c4b7072e802190c6f0818df366372acde;hpb=bc4c3efd191f3cc5b7b9f046775bff706c491a7d diff --git a/doc/man1/mailbox-count.1 b/doc/man1/mailbox-count.1 index e674f55..0c59240 100644 --- a/doc/man1/mailbox-count.1 +++ b/doc/man1/mailbox-count.1 @@ -15,11 +15,103 @@ number of mailboxes per-domain contained in the database. .P The summary shows only the per-domain mailbox count, while the detailed report shows both the count and a list of mailboxes. +.SH DESCRIPTION +.P +Mailbox-count produces a simple count of mailboxes that exist +per-domain in some SQL database. The default queries are compatible +with the schema used by PostfixAdmin +, but it is possible to supply +your own queries via the \fI\-\-summary-query\fR and +\fI\-\-detail-query\fR options. +.P +The summary report lists each domain, along with the number of +mailboxes owned by that domain. The order is determined by the summary +query, which lists the domains alphabetically by default. +.P +The default detail report shows the same, but also contains a list of +each individual mailbox (again in alphabetical order) belonging to the +domains. .SH OPTIONS -.IP \fB\-\-detail\fR,\ \fB-d\fR +.IP \fB\-\-database\fR +The name of the database (or file, if SQLite) to which we should +connect. + +Default: The name of the current user (Postgres only). + +.IP \fB\-\-detail\fR Produce a detailed report listing all mailboxes by domain. +.IP \fB\-\-detail-query\fR +SQL query used to produce the detail report. This should return the +set of all (domain, username) pairs. See the default value for an +example. + +Default: \(dqSELECT domain,username FROM mailbox ORDER BY domain;\(dq + +.IP \fB\-\-host\fR +Hostname where the database is located (Postgres-only). + +Default: None, a UNIX domain socket connection is attempted (Postgres only) + +.IP \fB\-\-password\fR +Password used to connect to the database (Postgres-only). + +Default: None (assumes passwordless authentication) + +.IP \fB\-\-port\fR +Port number used to connect to the database (Postgres-only). + +Default: None, a UNIX domain socket connection is attempted (Postgres only) + +.IP \fB\-\-summary-query\fR +SQL query used to produce the summary report. This should return +(domain, user count) pairs. See the default value for an +example. + +Default: \(dqSELECT domain,COUNT(username) FROM mailbox GROUP BY domain ORDER BY domain;\(dq + +.IP \fB\-\-username\fR +Username used to connect to the database (Postgres-only). + +Default: The current user + +.SH EXAMPLES + +.IP \[bu] 2 +The default summary report: + +.nf +.I $ mailbox-count --database=postfixadmin.sqlite3 +Summary (number of mailboxes per domain) +---------------------------------------- +example.com: 3 +example.invalid: 1 +example.net: 2 +example.org: 1 +.fi +.IP \[bu] +The more detailed report: + +.nf +.I $ mailbox-count --detail --database=postfixadmin.sqlite3 +Detail (list of all mailboxes by domain) +---------------------------------------- +example.com (3): + user1 + user3 + user5 + +example.invalid (1): + user7 + +example.net (2): + user2 + user4 + +example.org (1): + user6 +.fi .SH BUGS .P Send bugs to michael@orlitzky.com.