]> gitweb.michael.orlitzky.com - mailbox-count.git/blob - mailbox-count.cabal
mailbox-count.cabal: bump version to 0.0.3.
[mailbox-count.git] / mailbox-count.cabal
1 name: mailbox-count
2 version: 0.0.3
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 license: AGPL-3
7 license-file: doc/LICENSE
8 bug-reports: mailto:michael@orlitzky.com
9 category: Mail, Utils
10 build-type: Simple
11 extra-source-files:
12 doc/mailbox-countrc.example
13 doc/man1/mailbox-count.1
14 test/fixtures/postfixadmin.sqlite3
15 synopsis:
16 Count mailboxes in a SQL database.
17 description:
18 /Usage/:
19 .
20 @
21 mailbox-count [OPTIONS]
22 @
23 .
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 <http://postfixadmin.sourceforge.net/>,
27 but it is possible to supply your own queries via the @--summary-query@
28 and @--detail-query@ options.
29 .
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.
33 .
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
36 domains.
37 .
38 /Input/:
39 .
40 None.
41 .
42 /Output/:
43 .
44 Either a summary, or detailed report (with @--detail@) of the
45 number of mailboxes per-domain contained in the database.
46 .
47 /Options/:
48 .
49 @
50 \--database
51 @
52 .
53 The name of the database (or file, if SQLite) to which we should
54 connect.
55 .
56 Default: The name of the current user (Postgres only).
57 .
58 @
59 \--detail
60 @
61 .
62 Produce a detailed report listing all mailboxes by domain.
63 .
64 @
65 \--detail-query
66 @
67 .
68 SQL query used to produce the detail report. This should return the
69 set of all (domain, username) pairs. See the default value for an
70 example.
71 .
72 Default: \"SELECT domain,username FROM mailbox ORDER BY domain;\"
73 .
74 @
75 \--host
76 @
77 .
78 Hostname where the database is located (Postgres-only).
79 .
80 Default: None, a UNIX domain socket connection is attempted (Postgres only)
81 .
82 @
83 \--password
84 @
85 .
86 Password used to connect to the database (Postgres-only).
87 .
88 Default: None (assumes passwordless authentication)
89 .
90 @
91 \--port
92 @
93 Port number used to connect to the database (Postgres-only).
94 .
95 Default: None, a UNIX domain socket connection is attempted (Postgres only)
96 .
97 @
98 \--summary-query
99 @
100 .
101 SQL query used to produce the summary report. This should return
102 (domain, user count) pairs. See the default value for an
103 example.
104 .
105 Default: \"SELECT domain,COUNT(username) FROM mailbox GROUP BY domain
106 ORDER BY domain;\"
107 .
108 @
109 \--username
110 @
111 .
112 Username used to connect to the database (Postgres-only).
113 .
114 Default: The current user
115 .
116 /Examples/:
117 .
118 The default summary report:
119 .
120 @
121 $ mailbox-count --database=postfixadmin.sqlite3
122 Summary (number of mailboxes per domain)
123 \----------------------------------------
124 example.com: 3
125 example.invalid: 1
126 example.net: 2
127 example.org: 1
128 @
129 .
130 The more detailed report:
131 .
132 @
133 $ mailbox-count --detail --database=postfixadmin.sqlite3
134 Detail (list of all mailboxes by domain)
135 \----------------------------------------
136 example.com (3):
137 &#x20; user1
138 &#x20; user3
139 &#x20; user5
140
141 example.invalid (1):
142 &#x20; user7
143
144 example.net (2):
145 &#x20; user2
146 &#x20; user4
147
148 example.org (1):
149 &#x20; user6
150 @
151
152
153
154 executable mailbox-count
155 build-depends:
156 base >= 4.6 && < 5,
157 cmdargs >= 0.10,
158 configurator >= 0.2,
159 containers >= 0.5,
160 directory >= 1.2,
161 filepath >= 1.3,
162 HDBC >= 2.4,
163 HDBC-postgresql >= 2.3,
164 HDBC-sqlite3 >= 2.3,
165 MissingH >= 1.2,
166 tasty >= 0.8,
167 tasty-hunit >= 0.8
168 main-is:
169 Main.hs
170
171 hs-source-dirs:
172 src/
173
174 other-modules:
175 Configuration
176 CommandLine
177 OptionalConfiguration
178 Report
179
180
181 test-suite testsuite
182 type: exitcode-stdio-1.0
183 hs-source-dirs: src test
184 main-is: TestSuite.hs
185 build-depends:
186 base >= 4.6 && < 5,
187 cmdargs >= 0.10,
188 configurator >= 0.2,
189 containers >= 0.5,
190 directory >= 1.2,
191 filepath >= 1.3,
192 HDBC >= 2.4,
193 HDBC-postgresql >= 2.3,
194 HDBC-sqlite3 >= 2.3,
195 MissingH >= 1.2,
196 tasty >= 0.8,
197 tasty-hunit >= 0.8
198
199
200
201 test-suite doctests
202 type: exitcode-stdio-1.0
203 hs-source-dirs: test
204 main-is: Doctests.hs
205 build-depends:
206 base >= 4.6 && < 5,
207 -- Additional test dependencies.
208 doctest >= 0.9,
209 filemanip >= 0.3.6
210
211
212
213 source-repository head
214 type: git
215 location: http://gitweb.michael.orlitzky.com/mailbox-count.git
216 branch: master