{"id":19882422,"url":"https://github.com/derjd/python-mailcow","last_synced_at":"2025-05-02T14:32:11.824Z","repository":{"id":54773967,"uuid":"331812965","full_name":"derJD/python-mailcow","owner":"derJD","description":"Python wrapper interacting with MailCow API","archived":false,"fork":false,"pushed_at":"2022-10-05T16:38:28.000Z","size":62,"stargazers_count":16,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-11T04:37:50.782Z","etag":null,"topics":["api","mailcow","python"],"latest_commit_sha":null,"homepage":"https://der-jd.de/python-mailcow/intro/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derJD.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-22T02:22:20.000Z","updated_at":"2024-05-15T06:20:44.000Z","dependencies_parsed_at":"2022-08-14T02:20:50.977Z","dependency_job_id":null,"html_url":"https://github.com/derJD/python-mailcow","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derJD%2Fpython-mailcow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derJD%2Fpython-mailcow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derJD%2Fpython-mailcow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derJD%2Fpython-mailcow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derJD","download_url":"https://codeload.github.com/derJD/python-mailcow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224315085,"owners_count":17290992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","mailcow","python"],"created_at":"2024-11-12T17:17:21.212Z","updated_at":"2024-11-12T17:17:21.718Z","avatar_url":"https://github.com/derJD.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-mailcow\n\n[![PyPI version](https://badge.fury.io/py/python-mailcow.svg)](https://badge.fury.io/py/python-mailcow)\n[![PyPI downloads](https://img.shields.io/pypi/dm/python-mailcow)](https://pypi.org/project/python-mailcow/)\n[![pylint](https://gitlab.der-jd.de/python/mailcow/-/jobs/artifacts/main/raw/pylint.svg?job=lint:pylint)](#python-mailcow)\n\n`python-mailcow` allows you to interact with the [MailCow](https://mailcow.email/) API. It comes with a cli `mailcow`.\nAll arguments for the cli are generated by parsing your MailCow instance's OpenApi schema.\n\nSee [demo.mailcow.email](https://demo.mailcow.email/api/) as OpenAPI scheme example.\n\nThis means that you can `add`, `get`, `edit` and `delete` everything that the MailCow API allows and changes to the API should be usable immediately.\n\n...Famous last words... I know...\n\nBTW: The look and feel of the cli and configuration is inspired by the [python-gitlab](https://github.com/python-gitlab/python-gitlab) project.\n\n## Installation\n\n* from pypi: `pip install python-mailcow`\n* from github: `pip install git+https://github.com./derJD/python-mailcow.git`\n\n### Local Build\n\n```sh\ngit clone https://github.com/derJD/python-mailcow.git\ncd python-mailcow\npip install .\n```\n\n## Usage\n\n### quick start\n\n* Generate a API token in the MailCow UI\n* `mailcow --create-example-config`\n* Edit settings in `~/.config/python-mailcow.cfg` to match your MailCow UI\n* `mailcow --help` should now show all available options depending on your MailCow API version\n\n### Config\n\npython-mailcow read its settings from `~/.config/python-mailcow.cfg`.\nAn example configuration looks like this:\n\n```ini\n[defaults]\nserver = mailcow.example.com\nssl_verify = true\ntimeout = 5\n\n[mailcow.example.com]\nurl = https://mailcow.example.com\ntoken = 123456-abcde-123456-abcde-123456\n```\n\n| Argument | Type | Description |\n| -------- | ---- | ----------- |\n| `server` | String | Name of the section providing further server information |\n| `url`  | String | Base URL (MailCow UI location) for connection ie: `https://demo.mailcow.email` |\n| `token` | String | Token for API-Access |\n| `ssl_verify` | Boolean | Enable/Disable ssl verification |\n| `timeout` | Integer | Connection timeout |\n\n### CLI\n\nIf you installed python-mailcow for the first time you may run following\ncommand and change the settings according to your needs:\n\n```bash\nmailcow --create-example-config\n```\n\nAfter that you should be able to run commands like these:\n\n* `mailcow alias get --all/--id 5`\n* `mailcow alias add --address moep@example.com --goto goto@example.com --no-active`\n* `mailcow alias delete --items 5`\n\n**`mailcow --help`**:\n\n```help\nusage: test.py [-h] [--create-example-config] [--conf CONF] [--vertical] [--json] [--yaml] [--table] [--debug]\n               {alias,app-passwd,bcc,dkim,dkim_duplicate,domain,domain-admin,da-acl,domain-policy,fwdhost,mailbox,oauth2-client,recipient_map,relayhost,resource,syncjob,tls-policy-map,transport,mailq,qitem,fail2ban,pushover,quarantine_notification,user-acl,logs,policy_bl_domain,policy_wl_domain,quarantine,rl-mbox,rl-domain,status,syncjobs,spam-score}\n               ...\n\nInteract with mailcows API.\n\npositional arguments:\n  {alias,app-passwd,bcc,dkim,dkim_duplicate,domain,domain-admin,da-acl,domain-policy,fwdhost,mailbox,oauth2-client,recipient_map,relayhost,resource,syncjob,tls-policy-map,transport,mailq,qitem,fail2ban,pushover,quarantine_notification,user-acl,logs,policy_bl_domain,policy_wl_domain,quarantine,rl-mbox,rl-domain,status,syncjobs,spam-score}\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --create-example-config\n                        Create configuration file\n  --conf CONF, -c CONF  Defaults to: ~/.config/python-mailcow.conf\n  --vertical, -v        Print (table) results vertically\n  --json, -j            Print results as JSON\n  --yaml, -y            Print results as YAML\n  --table, -t           Print results as Table\n  --debug, -d           Enable debugging\n```\n\n## Documentation\n\n* [General documentation](https://der-jd.de/python-mailcow/intro/)\n* [CLI usage](https://der-jd.de/python-mailcow/cli/)\n* [API usage](https://der-jd.de/python-mailcow/python/)\n* [Reference](https://der-jd.de/python-mailcow/reference/mailcow/)\n\n## License\n\n* Code released under [GNU General Public License v3.0 or later](https://www.gnu.org/licenses/gpl-3.0.txt)\n\n## Author\n\n* [derJD](https://github.com/derJD/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderjd%2Fpython-mailcow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderjd%2Fpython-mailcow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderjd%2Fpython-mailcow/lists"}