Skip to main content

Admin tool for running pymap instances.

Project description

pymap-admin

Build Status Coverage Status PyPI PyPI PyPI

The pymap-admin tool can be used to perform various admin functions against a running pymap server. This is a separate grpc service using grpclib listening on a socket.

API Documentation

Connections

By default, the pymap-admin command will attempt to interact with a pymap admin server over a UNIX socket, typically in /tmp/pymap/pymap-adin.sock. See the pymap-admin --help commands for other connection options, depending on how the pymap admin service is configured.

Most requests are authenticated using macaroon tokens. Tokens are read from ~/.pymaprc, $PYMAP_ADMIN_TOKEN, or the --token parameter.

Commands

API Documentation

login Command

Sends login credentials and gets a bearer token.

$ pymap-admin login -is user@example.com
user@example.com Password:
result {
  response: ". OK Login completed."
}
bearer_token: "MDAwZWxvY2F0aW9uIAowMDMwaWRlbnRpZmllciA0ZmM4MD..."

The -s flag causes the resulting token to be saved to the ~/.pymaprc config file.

ping Command

Pings the running server and reports its version string.

$ pymap-admin ping
server_version: "0.14.1"

append Command

To append a message directly to a mailbox, without using IMAP, use the append admin command. First, check out the help:

$ pymap-admin append --help

As a basic example, you can append a message to a like this:

$ cat <<EOF | pymap-admin append demouser
> From: user@example.com
>
> test message!
> EOF
mailbox: "INBOX"
validity: 1784302999
uid: 101

2.0.0 Message delivered

User Commands

These commands access and manipulate the users on the system:

$ pymap-admin set-user --help
$ pymap-admin get-user --help
$ pymap-admin delete-user --help

Passing a username to get-user will display that user's metadata, including the (securely hashed) password string. A username can be deleted with delete-user. The set-user command will create and update a username and its password.

If using pymap as part of the slimta-docker configuration, see its Address Management documentation for additional options.

The MIT License (MIT)

Copyright (c) 2019 Ian Good

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymap-admin-0.5.0.tar.gz (18.7 kB view hashes)

Uploaded Source

Built Distribution

pymap_admin-0.5.0-py3-none-any.whl (20.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page