]> gitweb.michael.orlitzky.com - mailbox-count.git/blob - doc/man1/mailbox-count.1
9cd9246f2303e54455b49d88a8b65867ee132f03
[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 per-domain in some SQL database. The user supplies the...
21 .SH OPTIONS
22
23 .IP \fB\-\-database\fR
24 The name of the database (or file, if SQLite) to which we should
25 connect.
26
27 Default: The name of the current user (Postgres only).
28
29 .IP \fB\-\-detail\fR,\ \fB-d\fR
30 Produce a detailed report listing all mailboxes by domain.
31
32 .IP \fB\-\-detail-query\fR
33 SQL query used to produce the detail report. This should return the
34 set of all (domain, username) pairs. See the default value for an
35 example.
36
37 Default: \(dqSELECT domain,username FROM mailbox ORDER BY domain;\(dq
38
39 .IP \fB\-\-hostname\fR
40 Hostname where the database is located (Postgres-only).
41
42 Default: None, a UNIX domain socket connection is attempted (Postgres only)
43
44 .IP \fB\-\-password\fR
45 Password used to connect to the database (Postgres-only).
46
47 Default: None (assumes passwordless authentication)
48
49 .IP \fB\-\-port\fR
50 Port number used to connect to the database (Postgres-only).
51
52 Default: None, a UNIX domain socket connection is attempted (Postgres only)
53
54 .IP \fB\-\-summary-query\fR
55 SQL query used to produce the summary report. This should return
56 (domain, user count) pairs. See the default value for an
57 example.
58
59 Default: \(dqSELECT domain,COUNT(username) FROM mailbox GROUP BY domain ORDER BY domain;\(dq
60
61 .IP \fB\-\-username\fR
62 Username used to connect to the database (Postgres-only).
63
64 Default: The current user
65
66 .SH EXAMPLES
67
68 .IP \[bu] 2
69 The default summary report:
70
71 .nf
72 .I $ mailbox-count postfixadmin.sqlite3
73 Summary (number of mailboxes per domain)
74 ----------------------------------------
75 example.com: 3
76 example.invalid: 1
77 example.net: 2
78 example.org: 1
79 .fi
80 .IP \[bu]
81 The more detailed report:
82
83 .nf
84 .I $ mailbox-count --detail postfixadmin.sqlite3
85 Detail (list of all mailboxes by domain)
86 ----------------------------------------
87 example.com (3):
88 user1
89 user3
90 user5
91
92 example.invalid (1):
93 user7
94
95 example.net (2):
96 user2
97 user4
98
99 example.org (1):
100 user6
101 .fi
102 .SH BUGS
103 .P
104 Send bugs to michael@orlitzky.com.