]> gitweb.michael.orlitzky.com - mailbox-count.git/blob - doc/man1/mailbox-count.1
Add man page description and fix some options/examples.
[mailbox-count.git] / doc / man1 / mailbox-count.1
1 .TH mailbox-count 1
2
3 .SH NAME
4 mailbox\-count \- Count mailboxes in a SQL database.
5 .SH SYNOPSIS
6
7 \fBmailbox-count\fR [\fIOPTIONS\fR]
8 .SH INPUT
9 .P
10 None.
11 .SH OUTPUT
12 .P
13 Either a summary, or detailed report (with \fI\-\-detail\fR) of the
14 number of mailboxes per-domain contained in the database.
15 .P
16 The summary shows only the per-domain mailbox count, while the
17 detailed report shows both the count and a list of mailboxes.
18 .SH DESCRIPTION
19 .P
20 Mailbox-count produces a simple count of mailboxes that exist
21 per-domain in some SQL database. The default queries are compatible
22 with the schema used by PostfixAdmin
23 <http://postfixadmin.sourceforge.net/>, but it is possible to supply
24 your own queries via the \fI\-\-summary-query\fR and
25 \fI\-\-detail-query\fR options.
26 .P
27 The summary report lists each domain, along with the number of
28 mailboxes owned by that domain. The order is determined by the summary
29 query, which lists the domains alphabetically by default.
30 .P
31 The default detail report shows the same, but also contains a list of
32 each individual mailbox (again in alphabetical order) belonging to the
33 domains.
34 .SH OPTIONS
35
36 .IP \fB\-\-database\fR
37 The name of the database (or file, if SQLite) to which we should
38 connect.
39
40 Default: The name of the current user (Postgres only).
41
42 .IP \fB\-\-detail\fR
43 Produce a detailed report listing all mailboxes by domain.
44
45 .IP \fB\-\-detail-query\fR
46 SQL query used to produce the detail report. This should return the
47 set of all (domain, username) pairs. See the default value for an
48 example.
49
50 Default: \(dqSELECT domain,username FROM mailbox ORDER BY domain;\(dq
51
52 .IP \fB\-\-host\fR
53 Hostname where the database is located (Postgres-only).
54
55 Default: None, a UNIX domain socket connection is attempted (Postgres only)
56
57 .IP \fB\-\-password\fR
58 Password used to connect to the database (Postgres-only).
59
60 Default: None (assumes passwordless authentication)
61
62 .IP \fB\-\-port\fR
63 Port number used to connect to the database (Postgres-only).
64
65 Default: None, a UNIX domain socket connection is attempted (Postgres only)
66
67 .IP \fB\-\-summary-query\fR
68 SQL query used to produce the summary report. This should return
69 (domain, user count) pairs. See the default value for an
70 example.
71
72 Default: \(dqSELECT domain,COUNT(username) FROM mailbox GROUP BY domain ORDER BY domain;\(dq
73
74 .IP \fB\-\-username\fR
75 Username used to connect to the database (Postgres-only).
76
77 Default: The current user
78
79 .SH EXAMPLES
80
81 .IP \[bu] 2
82 The default summary report:
83
84 .nf
85 .I $ mailbox-count --database=postfixadmin.sqlite3
86 Summary (number of mailboxes per domain)
87 ----------------------------------------
88 example.com: 3
89 example.invalid: 1
90 example.net: 2
91 example.org: 1
92 .fi
93 .IP \[bu]
94 The more detailed report:
95
96 .nf
97 .I $ mailbox-count --detail --database=postfixadmin.sqlite3
98 Detail (list of all mailboxes by domain)
99 ----------------------------------------
100 example.com (3):
101 user1
102 user3
103 user5
104
105 example.invalid (1):
106 user7
107
108 example.net (2):
109 user2
110 user4
111
112 example.org (1):
113 user6
114 .fi
115 .SH BUGS
116 .P
117 Send bugs to michael@orlitzky.com.