mailpot/docs/mpot.1

20 KiB

mpot(1)                     General Commands Manual                    mpot(1)



NAME
       mpot - mailing list manager

SYNOPSIS
       mpot [-d|--debug] [-c|--config] [-q|--quiet] [-v|--verbose]...
       [-t|--ts] [-h|--help] [-V|--version] <subcommands>

DESCRIPTION
       Tool for mailpot mailing list management.

       -d, --debug
              Print logs.

       -c, --config CONFIG
              Configuration file to use.

       -q, --quiet
              Silence all output.

       -v, --verbose
              Verbose mode (-v, -vv, -vvv, etc).

       -t, --ts TS
              Debug log timestamp (sec, ms, ns, none).

QUICK START
       mailpot saves its data in a sqlite3 file. To define the location of the
       sqlite3 file we need a configuration file, which can be generated with:

       mpot sample-config > conf.toml

       Mailing lists can now be created:

       mpot -c conf.toml create-list --name "my first list" --id mylist
       --address mylist@example.com

       You can list all the mailing lists with:

       mpot -c conf.toml list-lists

       You should add yourself as the list owner:

       mpot -c conf.toml list mylist add-list-owner --address
       myself@example.com --name "Nemo"

       And also enable posting and subscriptions by setting list policies:

       mpot -c conf.toml list mylist add-policy --subscriber-only

       mpot -c conf.toml list mylist add-subscribe-policy --request
       --send-confirmation

       To post on a mailing list or submit a list request, pipe a raw e-mail
       into STDIN:

       mpot -c conf.toml post

       You can configure your mail server to redirect e-mails addressed to
       your mailing lists to this command.

       For postfix, you can automatically generate this configuration with:

       mpot -c conf.toml print-postfix-config --user myself --binary-path
       /path/to/mpot

       This will print the following:

       - content of `transport_maps` and `local_recipient_maps`

       The output must be saved in a plain text file.  Map output should be
       added to transport_maps and local_recipient_maps parameters in
       postfix's main.cf.  To make postfix be able to read them, the postmap
       application must be executed with the path to the map file as its sole
       argument.

       postmap /path/to/mylist_maps

       postmap is usually distributed along with the other postfix binaries.

       - `master.cf` service entry The output must be entered in the master.cf
       file.  See <https://www.postfix.org/master.5.html>.


SUBCOMMANDS
   mpot sample-config

       mpot sample-config [--with-smtp WITH_SMTP]

       Prints a sample config file to STDOUT.

       --with-smtp
              Use an SMTP connection instead of a shell process.

   mpot dump-database

       Dumps database data to STDOUT.

   mpot list-lists

       Lists all registered mailing lists.

   mpot list

       mpot list LIST_ID

       Mailing list management.

       LIST_ID
              Selects mailing list to operate on.

   mpot list subscriptions

       List subscriptions of list.

   mpot list add-subscription

       mpot list add-subscription --address ADDRESS [--name NAME] [--digest
       DIGEST] [--hide-address HIDE_ADDRESS] [--verified VERIFIED]
       [--receive-confirmation RECEIVE_CONFIRMATION] [--receive-duplicates
       RECEIVE_DUPLICATES] [--receive-own-posts RECEIVE_OWN_POSTS] [--enabled
       ENABLED]

       Add subscription to list.

       --address ADDRESS
              E-mail address.

       --name NAME
              Name.

       --digest DIGEST [default: false]
              Send messages as digest.


              [possible values: true, false]

       --hide-address HIDE_ADDRESS [default: false]
              Hide message from list when posting.


              [possible values: true, false]

       --verified VERIFIED [default: false]
              Hide message from list when posting. E-mail address verification
              status.


              [possible values: true, false]

       --receive-confirmation RECEIVE_CONFIRMATION [default: true]
              Receive confirmation email when posting.


              [possible values: true, false]

       --receive-duplicates RECEIVE_DUPLICATES [default: true]
              Receive posts from list even if address exists in To or Cc
              header.


              [possible values: true, false]

       --receive-own-posts RECEIVE_OWN_POSTS [default: false]
              Receive own posts from list.


              [possible values: true, false]

       --enabled ENABLED [default: true]
              Is subscription enabled.


              [possible values: true, false]

   mpot list remove-subscription

       mpot list remove-subscription --address ADDRESS

       Remove subscription from list.

       --address ADDRESS
              E-mail address.

   mpot list update-subscription

       mpot list update-subscription [--name NAME] [--digest DIGEST]
       [--hide-address HIDE_ADDRESS] [--verified VERIFIED]
       [--receive-confirmation RECEIVE_CONFIRMATION] [--receive-duplicates
       RECEIVE_DUPLICATES] [--receive-own-posts RECEIVE_OWN_POSTS] [--enabled
       ENABLED] ADDRESS

       Update subscription info.

       ADDRESS
              Address to edit.

       --name NAME
              Name.

       --digest DIGEST [default: false]
              Send messages as digest.


              [possible values: true, false]

       --hide-address HIDE_ADDRESS [default: false]
              Hide message from list when posting.


              [possible values: true, false]

       --verified VERIFIED [default: false]
              Hide message from list when posting. E-mail address verification
              status.


              [possible values: true, false]

       --receive-confirmation RECEIVE_CONFIRMATION [default: true]
              Receive confirmation email when posting.


              [possible values: true, false]

       --receive-duplicates RECEIVE_DUPLICATES [default: true]
              Receive posts from list even if address exists in To or Cc
              header.


              [possible values: true, false]

       --receive-own-posts RECEIVE_OWN_POSTS [default: false]
              Receive own posts from list.


              [possible values: true, false]

       --enabled ENABLED [default: true]
              Is subscription enabled.


              [possible values: true, false]

   mpot list add-post-policy

       mpot list add-post-policy [--announce-only ANNOUNCE_ONLY]
       [--subscription-only SUBSCRIPTION_ONLY] [--approval-needed
       APPROVAL_NEEDED] [--open OPEN] [--custom CUSTOM]

       Add a new post policy.

       --announce-only
              Only list owners can post.

       --subscription-only
              Only subscriptions can post.

       --approval-needed
              Subscriptions can post. Other posts must be approved by list
              owners.

       --open Anyone can post without restrictions.

       --custom
              Allow posts, but handle it manually.

   mpot list remove-post-policy

       mpot list remove-post-policy --pk PK


       --pk PK
              Post policy primary key.

   mpot list add-subscription-policy

       mpot list add-subscription-policy [--send-confirmation
       SEND_CONFIRMATION] [--open OPEN] [--manual MANUAL] [--request REQUEST]
       [--custom CUSTOM]

       Add subscription policy to list.

       --send-confirmation
              Send confirmation e-mail when subscription is finalized.

       --open Anyone can subscribe without restrictions.

       --manual
              Only list owners can manually add subscriptions.

       --request
              Anyone can request to subscribe.

       --custom
              Allow subscriptions, but handle it manually.

   mpot list remove-subscription-policy

       mpot list remove-subscription-policy --pk PK


       --pk PK
              Subscription policy primary key.

   mpot list add-list-owner

       mpot list add-list-owner --address ADDRESS [--name NAME]

       Add list owner to list.

       --address ADDRESS


       --name NAME


   mpot list remove-list-owner

       mpot list remove-list-owner --pk PK


       --pk PK
              List owner primary key.

   mpot list enable-subscription

       mpot list enable-subscription ADDRESS

       Alias for update-subscription --enabled true.

       ADDRESS
              Subscription address.

   mpot list disable-subscription

       mpot list disable-subscription ADDRESS

       Alias for update-subscription --enabled false.

       ADDRESS
              Subscription address.

   mpot list update

       mpot list update [--name NAME] [--id ID] [--address ADDRESS]
       [--description DESCRIPTION] [--archive-url ARCHIVE_URL]
       [--owner-local-part OWNER_LOCAL_PART] [--request-local-part
       REQUEST_LOCAL_PART] [--verify VERIFY] [--hidden HIDDEN] [--enabled
       ENABLED]

       Update mailing list details.

       --name NAME
              New list name.

       --id ID
              New List-ID.

       --address ADDRESS
              New list address.

       --description DESCRIPTION
              New list description.

       --archive-url ARCHIVE_URL
              New list archive URL.

       --owner-local-part OWNER_LOCAL_PART
              New owner address local part. If empty, it defaults to '+owner'.

       --request-local-part REQUEST_LOCAL_PART
              New request address local part. If empty, it defaults to
              '+request'.

       --verify VERIFY
              Require verification of e-mails for new subscriptions.

              Subscriptions that are initiated from the subscription's address
              are verified automatically.


              [possible values: true, false]

       --hidden HIDDEN
              Public visibility of list.

              If hidden, the list will not show up in public APIs unless
              requests to it won't work.


              [possible values: true, false]

       --enabled ENABLED
              Enable or disable the list's functionality.

              If not enabled, the list will continue to show up in the
              database but e-mails and requests to it won't work.


              [possible values: true, false]

   mpot list health

       Show mailing list health status.

   mpot list info

       Show mailing list info.

   mpot list import-members

       mpot list import-members --url URL --username USERNAME --password
       PASSWORD --list-id LIST_ID [--dry-run DRY_RUN] [--skip-owners
       SKIP_OWNERS]

       Import members in a local list from a remote mailman3 REST API
       instance.

       --url URL
              REST HTTP endpoint e.g. http://localhost:9001/3.0/.

       --username USERNAME
              REST HTTP Basic Authentication username.

       --password PASSWORD
              REST HTTP Basic Authentication password.

       --list-id LIST_ID
              List ID of remote list to query.

       --dry-run
              Show what would be inserted without performing any changes.

       --skip-owners
              Don't import list owners.

   mpot create-list

       mpot create-list --name NAME --id ID --address ADDRESS [--description
       DESCRIPTION] [--archive-url ARCHIVE_URL]

       Create new list.

       --name NAME
              List name.

       --id ID
              List ID.

       --address ADDRESS
              List e-mail address.

       --description DESCRIPTION
              List description.

       --archive-url ARCHIVE_URL
              List archive URL.

   mpot post

       mpot post [--dry-run DRY_RUN]

       Post message from STDIN to list.

       --dry-run
              Show e-mail processing result without actually consuming it.

   mpot flush-queue

       mpot flush-queue [--dry-run DRY_RUN]

       Flush outgoing e-mail queue.

       --dry-run
              Show e-mail processing result without actually consuming it.

   mpot error-queue

       Mail that has not been handled properly end up in the error queue.

   mpot error-queue list

       List.

   mpot error-queue print

       mpot error-queue print [--index INDEX]

       Print entry in RFC5322 or JSON format.

       --index INDEX
              index of entry.

   mpot error-queue delete

       mpot error-queue delete [--index INDEX] [--quiet QUIET]

       Delete entry and print it in stdout.

       --index INDEX
              index of entry.

       --quiet
              Do not print in stdout.

   mpot queue

       mpot queue --queue QUEUE

       Mail that has not been handled properly end up in the error queue.

       --queue QUEUE


   mpot queue list

       List.

   mpot queue print

       mpot queue print [--index INDEX]

       Print entry in RFC5322 or JSON format.

       --index INDEX
              index of entry.

   mpot queue delete

       mpot queue delete [--index INDEX] [--quiet QUIET]

       Delete entry and print it in stdout.

       --index INDEX
              index of entry.

       --quiet
              Do not print in stdout.

   mpot import-maildir

       mpot import-maildir --maildir-path MAILDIR_PATH LIST_ID

       Import a maildir folder into an existing list.

       LIST_ID
              List-ID or primary key value.

       --maildir-path MAILDIR_PATH
              Path to a maildir mailbox. Must contain {cur, tmp, new} folders.

   mpot update-postfix-config

       mpot update-postfix-config [-p MASTER_CF|--master-cf] {-u USER|--user}
       [-g GROUP|--group] --binary-path BINARY_PATH [--process-limit
       PROCESS_LIMIT] [--map-output-path MAP_OUTPUT_PATH] [--transport-name
       TRANSPORT_NAME]

       Update postfix maps and master.cf (probably needs root permissions).

       -p, --master-cf MASTER_CF
              Override location of master.cf file (default:
              /etc/postfix/master.cf).

       -u, --user USER
              User that runs mailpot when postfix relays a message.

              Must not be the `postfix` user. Must have permissions to access
              the database file and the data directory.

       -g, --group GROUP
              Group that runs mailpot when postfix relays a message. Optional.

       --binary-path BINARY_PATH
              The path to the mailpot binary postfix will execute.

       --process-limit PROCESS_LIMIT [default: 1]
              Limit the number of mailpot instances that can exist at the same
              time.

              Default is 1.

       --map-output-path MAP_OUTPUT_PATH
              The directory in which the map files are saved.

              Default is `data_path` from
              [`Configuration`](mailpot::Configuration).

       --transport-name TRANSPORT_NAME
              The name of the postfix service name to use. Default is
              `mailpot`.

              A postfix service is a daemon managed by the postfix process.
              Each entry in the `master.cf` configuration file defines a
              single service.

              The `master.cf` file is documented in
              [`master(5)`](https://www.postfix.org/master.5.html):
              <https://www.postfix.org/master.5.html>.

   mpot print-postfix-config

       mpot print-postfix-config {-u USER|--user} [-g GROUP|--group]
       --binary-path BINARY_PATH [--process-limit PROCESS_LIMIT]
       [--map-output-path MAP_OUTPUT_PATH] [--transport-name TRANSPORT_NAME]

       Print postfix maps and master.cf entry to STDOUT.

       -u, --user USER
              User that runs mailpot when postfix relays a message.

              Must not be the `postfix` user. Must have permissions to access
              the database file and the data directory.

       -g, --group GROUP
              Group that runs mailpot when postfix relays a message. Optional.

       --binary-path BINARY_PATH
              The path to the mailpot binary postfix will execute.

       --process-limit PROCESS_LIMIT [default: 1]
              Limit the number of mailpot instances that can exist at the same
              time.

              Default is 1.

       --map-output-path MAP_OUTPUT_PATH
              The directory in which the map files are saved.

              Default is `data_path` from
              [`Configuration`](mailpot::Configuration).

       --transport-name TRANSPORT_NAME
              The name of the postfix service name to use. Default is
              `mailpot`.

              A postfix service is a daemon managed by the postfix process.
              Each entry in the `master.cf` configuration file defines a
              single service.

              The `master.cf` file is documented in
              [`master(5)`](https://www.postfix.org/master.5.html):
              <https://www.postfix.org/master.5.html>.

   mpot accounts

       All Accounts.

   mpot account-info

       mpot account-info ADDRESS

       Account info.

       ADDRESS
              Account address.

   mpot add-account

       mpot add-account --address ADDRESS --password PASSWORD [--name NAME]
       [--public-key PUBLIC_KEY] [--enabled ENABLED]

       Add account.

       --address ADDRESS
              E-mail address.

       --password PASSWORD
              SSH public key for authentication.

       --name NAME
              Name.

       --public-key PUBLIC_KEY
              Public key.

       --enabled ENABLED
              Is account enabled.


              [possible values: true, false]

   mpot remove-account

       mpot remove-account --address ADDRESS

       Remove account.

       --address ADDRESS
              E-mail address.

   mpot update-account

       mpot update-account [--password PASSWORD] [--name NAME] [--public-key
       PUBLIC_KEY] [--enabled ENABLED] ADDRESS

       Update account info.

       ADDRESS
              Address to edit.

       --password PASSWORD
              Public key for authentication.

       --name NAME
              Name.

       --public-key PUBLIC_KEY
              Public key.

       --enabled ENABLED
              Is account enabled.


              [possible values: true, false]

   mpot repair

       mpot repair [--fix FIX] [--all ALL] [--datetime-header-value
       DATETIME_HEADER_VALUE] [--remove-empty-accounts REMOVE_EMPTY_ACCOUNTS]
       [--remove-accepted-subscription-requests
       REMOVE_ACCEPTED_SUBSCRIPTION_REQUESTS] [--warn-list-no-owner
       WARN_LIST_NO_OWNER]

       Show and fix possible data mistakes or inconsistencies.

       --fix  Fix errors (default: false).

       --all  Select all tests (default: false).

       --datetime-header-value
              Post `datetime` column must have the Date: header value, in
              RFC2822 format.

       --remove-empty-accounts
              Remove accounts that have no matching subscriptions.

       --remove-accepted-subscription-requests
              Remove subscription requests that have been accepted.

       --warn-list-no-owner
              Warn if a list has no owners.

AUTHORS
       Manos Pitsidianakis <el13635@mail.ntua.gr>



                                  mpot 0.1.1                           mpot(1)