定制 inboxcom/mailcore-cli 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

inboxcom/mailcore-cli

Composer 安装命令:

composer create-project inboxcom/mailcore-cli

包简介

Command-line interface for the Mailcore mail-server API.

README 文档

README

Latest Version License

Command-line interface for the Mailcore mail-server control API, built on Symfony Console.

Unofficial. Third-party tool; not published by Mailcore.

AI-assisted. Code, tests, and docs were written largely by AI (Claude Code) under human direction and review.

Built on the inboxcom/mailcore-php core client.

Install

As a project dependency:

composer require inboxcom/mailcore-cli
vendor/bin/mailcore list

…or globally, to get a mailcore command on your PATH:

composer global require inboxcom/mailcore-cli

Requires PHP >= 8.4.

Usage

The CLI covers every API operation — one command per endpoint, grouped as users:*, domains:*, mailboxplans:*, mailfilter:*, reports:*, datadump:*. Run mailcore list to see them all.

export MAILCORE_API_KEY=your-api-key

mailcore users:list --filter='*' --limit=0,100
mailcore users:get holger@example.com          # detail view
mailcore users:add new@example.com 4           # prompts for the password
mailcore users:new-password new@example.com    # prompts for the password
mailcore domains:list
mailcore mailboxplans:list
mailcore mailfilter:rbl-lookup 8.8.8.8         # exit 1 if listed
mailcore mailfilter:cdl-lookup 8.8.8.8         # exit 1 if listed; --email= is informational
mailcore datadump:fetch --output=dump.pgp

Configuration

Credentials are resolved in this order (first non-empty wins):

  1. Environment variables MAILCORE_API_KEY / MAILCORE_BASE_URI
  2. INI file at ~/.config/mailcore/config.ini (or $XDG_CONFIG_HOME/mailcore/config.ini)
  3. Built-in default (base URI only)
; ~/.config/mailcore/config.ini   (see config.ini.example)
api_key         = "your-api-key"
base_uri        = "https://api.example.com"   ; optional
timeout         = 30   ; optional, seconds (0 disables); raise for large data dumps
connect_timeout = 10   ; optional, seconds (0 disables)

The timeouts also accept env overrides MAILCORE_TIMEOUT / MAILCORE_CONNECT_TIMEOUT.

mkdir -p ~/.config/mailcore
cp config.ini.example ~/.config/mailcore/config.ini
chmod 600 ~/.config/mailcore/config.ini   # keep the key private

Conventions:

  • Credentials come from the environment or the config file above, never CLI flags, so the key stays out of shell history and ps.
  • Passwords are read from a hidden prompt unless --password= is given, for the same reason.
  • Predicate commands set a non-zero exit code on the "negative" result (verify-password, rbl-lookup) so they compose in scripts.
  • List commands render tables; datadump:fetch streams raw bytes to stdout (or --output to a file).

Development & full docs

This package is developed in the Fjordmail/mailcore-sdk monorepo (this repository is a read-only subtree split). Issues and contributions belong there.

License

MIT — see LICENSE.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固