Coder Social home page Coder Social logo

doveadm-http-cli's Introduction

Python CLI client for Doveadm HTTP API

doveadm-http-cli is an experimental PoC client for Dovecot doveadm HTTP API written in python. On startup it will connect to the API and fetch all available commands and their accepted parameters. Tab completion is available.

Usage

First enable doveadm HTTP api

Then run the client:

./doveadm_cli.py --apikey doveadm_apikey --apiurl http://host:port/doveadm/v1

or

./doveadm_cli.py --password doveadm_password --apiurl http://host:port/doveadm/v1

Use tab to expand commands/parameters.

Advanced

Use command debug to enable printing curl commands for API calls

Example

$ ./doveadm_cli.py --apikey someapikey --apiurl http://127.0.0.1:8080/doveadm/v1
=== Doveadm HTTP CLI ===
 - Array type parameters should be comma separated
 - EOF can be specified as a special value for multiline input.
 - Command 'debug' can be used to enable debug printing curl command for each command.
 - 'commands' can be used to display all available commands.
 - Use tab to complete commands/parameters.

(doveadm) debug
Debug set to True
(doveadm) mailboxStatus user=testuser1 mailboxMask=INBOX field=messages

curl -H "Authorization: X-Dovecot-API anV1c3RvNjY2" -H "Content-Type: application/json" -d '[["mailboxStatus", {"field": ["messages"], "mailboxMask": ["INBOX"], "user": "testuser1"}, "c01"]]' http://10.211.55.7:8080/doveadm/v1

[
    {
        "mailbox": "INBOX",
        "messages": "35"
    }
]
Results: 1

TODO

  • Create pypi package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.