]> gitweb.michael.orlitzky.com - mailbox-count.git/commitdiff
mailbox-count.cabal: bump to version 0.0.8 master 0.0.8
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 26 Apr 2024 12:07:00 +0000 (08:07 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 26 Apr 2024 12:07:00 +0000 (08:07 -0400)
doc/COPYING [new file with mode: 0644]
doc/man1/mailbox-count.1
mailbox-count.cabal
makefile
src/Configuration.hs

diff --git a/doc/COPYING b/doc/COPYING
new file mode 100644 (file)
index 0000000..8c86f05
--- /dev/null
@@ -0,0 +1,15 @@
+mailbox-count: count mailboxes in a SQL database
+Copyright (C) 2024  Michael Orlitzky
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <https://www.gnu.org/licenses/>.
index 0c592405a790c759714d0a8f542223fba8bf4f44..b0e3bbe8f1e5ff23ecabbbbdc4876fccf4096bfd 100644 (file)
@@ -76,6 +76,15 @@ Username used to connect to the database (Postgres-only).
 
 Default: The current user
 
+.SH CONFIGURATION FILE
+
+Any of the options above can be placed in a configuration file rather
+than passed on the command line. An example config file
+\fIdoc/mailbox-countrc.example\fR is included with the source. You can
+edit it and rename it to either \fI$sysconfdir/mailbox-countrc\fR or
+\fI~/.mailbox-countrc\fR. The variable \fI$sysconfdir\fR is determined
+at build time and is typically \fI/etc\fR on UNIX systems.
+
 .SH EXAMPLES
 
 .IP \[bu] 2
index f9fb400580b9b0d554f26f149aa97dbe8aa9a08d..5ca9b541af99bd2844c2c882c07c6763ceb1ceed 100644 (file)
 cabal-version:  3.0
 name:           mailbox-count
-version:        0.0.5
+version:        0.0.8
 author:         Michael Orlitzky
-maintainer:    Michael Orlitzky <michael@orlitzky.com>
-license:        AGPL-3.0-only
+maintainer:     Michael Orlitzky <michael@orlitzky.com>
+license:        AGPL-3.0-or-later
 license-file:   doc/LICENSE
+homepage:       https://michael.orlitzky.com/code/mailbox-count.xhtml
 bug-reports:    mailto:michael@orlitzky.com
 category:       Mail, Utils
 build-type:     Simple
 extra-source-files:
+  doc/COPYING
   doc/mailbox-countrc.example
   doc/man1/mailbox-count.1
   test/fixtures/postfixadmin.sqlite3
 synopsis:
-  Count mailboxes in a SQL database.
+  Count mailboxes in a SQL database
 description:
-  /Usage/:
-
-  @
-  mailbox-count [OPTIONS]
-  @
-
-  Mailbox-count produces a simple count of mailboxes that exist
+  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 <http://postfixadmin.sourceforge.net/>,
-  but it is possible to supply your own queries via the @--summary-query@
-  and @--detail-query@ options.
+  with the [PostfixAdmin](https://postfixadmin.sourceforge.net/)
+  schema, but it is possible to supply your own queries.
 
   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.
-
-  The default detail report shows the same, but also contains a list of
-  each individual mailbox (again in alphabetical order) belonging to the
-  domains.
-
-  /Input/:
-
-  None.
-
-  /Output/:
-
-  Either a summary, or detailed report (with @--detail@) of the
-  number of mailboxes per-domain contained in the database.
-
-  /Options/:
-
-  * \--database
-
-      The name of the database (or file, if SQLite) to which we should
-      connect.
-
-      Default: The name of the current user (Postgres only).
-
-  * \--detail
-
-      Produce a detailed report listing all mailboxes by domain.
-
-  * \--detail-query
-
-      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: \"SELECT domain,username FROM mailbox ORDER BY domain;\"
-
-  * \--host
-
-      Hostname where the database is located (Postgres-only).
-
-      Default: None, a UNIX domain socket connection is attempted
-      (Postgres only)
-
-  * \--password
-
-      Password used to connect to the database (Postgres-only).
-
-      Default: None (assumes passwordless authentication)
-
-  * \--port
-
-      Port number used to connect to the database (Postgres-only).
-
-      Default: None, a UNIX domain socket connection is attempted
-      (Postgres only)
-
-  * \--summary-query
-
-      SQL query used to produce the summary report. This should return
-      (domain, user count) pairs. See the default value for an
-      example.
-
-      Default: \"SELECT domain,COUNT(username) FROM mailbox GROUP BY domain
-      ORDER BY domain;\"
-
-  * \--username
-
-      Username used to connect to the database (Postgres-only).
-
-      Default: The current user
-
-  /Examples/:
-
-  The default summary report:
-
-  @
-  $ mailbox-count --database=postfixadmin.sqlite3
-  Summary (number of mailboxes per domain)
-  \----------------------------------------
-  example.com:     3
-  example.invalid: 1
-  example.net:     2
-  example.org:     1
-  @
-
-  The more detailed report:
-
-  @
-  $ mailbox-count --detail --database=postfixadmin.sqlite3
-  Detail (list of all mailboxes by domain)
-  \----------------------------------------
-  example.com (3):
-  &#x20; user1
-  &#x20; user3
-  &#x20; user5
-
-  example.invalid (1):
-  &#x20; user7
-
-  example.net (2):
-  &#x20; user2
-  &#x20; user4
-
-  example.org (1):
-  &#x20; user6
-  @
+  mailboxes owned by that domain. The order is determined by the
+  summary query, which lists the domains alphabetically by
+  default. The default detail report shows the same, but also contains
+  a list of each individual mailbox (again in alphabetical order)
+  belonging to the domains.
 
+  A full set of options and examples can be found in the man page.
 
 
 executable mailbox-count
@@ -216,5 +110,5 @@ test-suite doctests
 
 source-repository head
   type: git
-  location: http://gitweb.michael.orlitzky.com/mailbox-count.git
+  location: https://gitweb.michael.orlitzky.com/mailbox-count.git
   branch: master
index 3f3584cf2f14f8d25acda4cd013074d1c29e7591..76b3c83afe1373cb82d0a7708e8f97383e30a8db 100644 (file)
--- a/makefile
+++ b/makefile
@@ -10,6 +10,7 @@ HCFLAGS += -Weverything \
            -Wno-prepositive-qualified-module \
            -Wno-missing-safe-haskell-mode \
            -Wno-missing-deriving-strategies \
+           -Wno-missing-kind-signatures \
            -rtsopts \
            -threaded
 
index 7e15a74a15926e745ab7da640d6a3745220fdb93..9b7be965e78e1728243d02a8f05af5d7bf181ad9 100644 (file)
@@ -45,7 +45,7 @@ instance Default Configuration where
     where
       def_summary_query = "SELECT domain,COUNT(username) " ++
                           "FROM mailbox " ++
-                          "GROUP BY domain "++
+                          "GROUP BY domain " ++
                           "ORDER BY domain;"
 
       def_detail_query = "SELECT domain,username " ++