Skip to content

docs(lark-mail): document per-user allow/block sender lists#821

Open
infeng wants to merge 1 commit into
larksuite:mainfrom
infeng:harness/01kr69s0jf1vekkkdj7ktepezs
Open

docs(lark-mail): document per-user allow/block sender lists#821
infeng wants to merge 1 commit into
larksuite:mainfrom
infeng:harness/01kr69s0jf1vekkkdj7ktepezs

Conversation

@infeng
Copy link
Copy Markdown
Collaborator

@infeng infeng commented May 11, 2026

Summary

This PR is docs-only so the skill router picks up natural-language requests (信任发件人 / 屏蔽发件人 / allow sender / block sender) ahead of the auto-generated artifacts landing.

Changes

  • skills/lark-mail/SKILL.md
    • Frontmatter description extended with the new keywords
    • New core concept entry explaining per-user scope, the 2000-total / 100-per-call quotas, the black/white mutual exclusion, and the reason_code enum (INVALID / SELF_ADDRESS / SELF_DOMAIN / CONFLICT_BLOCK / QUOTA_EXCEEDED)
    • Two new API Resource sections — user_mailbox.allow_senders / user_mailbox.blocked_senders — each with batch_create / list / batch_delete
    • Permissions table extended with the 6 new methods reusing mail:user_mailbox.message:readonly/modify scopes

No new scopes were introduced; both lists reuse the existing user_mailbox.message:* scope family for parity with how the Lark email client manages these lists today.

Test plan

  • skills/lark-mail/SKILL.md renders cleanly in Claude Code's skill picker (visible new keywords trigger correctly)
  • Existing CI (markdown lint / link check) passes on skills/lark-mail/SKILL.md

Summary by CodeRabbit

  • Documentation
    • Enhanced Lark mail skill documentation with per-user sender management capabilities, including allow and block lists for managing trusted and blocked senders.
    • Documented new API resources supporting batch operations, listing, and management of allowed and blocked senders with associated permission scopes.

Review Change Stack

Surface the new user-level allow/block sender resources alongside the
upcoming Meta API + lark-cli registry entries (see lark/idl and
lark/larksuite-cli-registry branches harness/01kr69s0jf1vekkkdj7ktepezs).

- Update SKILL frontmatter description with 信任发件人/屏蔽发件人/allow
  sender/block sender keywords so the skill router picks up natural-
  language requests.
- Add a core concept entry that calls out the per-user scope, the 2000
  total / 100 per call quota, the black/white mutual exclusion, and the
  reason_code enum surfaced via failed_items.
- Add user_mailbox.allow_senders / user_mailbox.blocked_senders sections
  to the API Resources list, mirroring the parent path used by
  user_mailbox.message.*.
- Extend the permissions table with the six new methods reusing the
  mail:user_mailbox.message:readonly / :modify scopes.

The fully generated SKILL.md + meta_data.json that codegen produces from
lark/larksuite-cli-registry's make all project=mail will land in a
follow-up commit once IDL + Meta review are merged.
@github-actions github-actions Bot added domain/mail PR touches the mail domain size/M Single-domain feat or fix with limited business impact labels May 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

Documentation for a new per-user sender allow/block list feature added to the Lark Mail skill, including feature overview, core concept definitions covering matching rules and mutual exclusivity, API resource specifications for create/list/delete operations with batch constraints, and corresponding permission scope mappings.

Changes

Allow/Block Sender Documentation

Layer / File(s) Summary
Feature Overview
skills/lark-mail/SKILL.md
Top-level skill description extended to include per-user sender allow/block list management capabilities.
Core Concept Definition
skills/lark-mail/SKILL.md
New "黑白名单(Allow / Block Sender)" concept defines behavior: exact sender address or domain matching, auto-removal when an item conflicts between allow and block lists, quota and batch operation limits, and failed_items error reporting with standardized reason_codes.
API Resources
skills/lark-mail/SKILL.md
user_mailbox.allow_senders and user_mailbox.blocked_senders resources documented with batch_create, list, and batch_delete operations; constraints include max 100 items per batch request and page_size pagination limits.
Permission Scopes
skills/lark-mail/SKILL.md
Permissions matrix extended: mail:user_mailbox.message:readonly scope for list operations; mail:user_mailbox.message:modify scope for batch_create and batch_delete operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

documentation

Suggested reviewers

  • chanthuang
  • haidaodashushu

Poem

📧 A rabbit hops through mail so bright,
With trust and block lists, all just right—
Allow the good, forbid the spam,
Per-user rules that give a dam! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: documenting per-user allow/block sender lists in the lark-mail skill.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description covers all required template sections with concrete details about changes, test plan, and context.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.91%. Comparing base (25c72ce) to head (279ddfc).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #821      +/-   ##
==========================================
+ Coverage   65.67%   65.91%   +0.23%     
==========================================
  Files         513      513              
  Lines       47655    48145     +490     
==========================================
+ Hits        31297    31734     +437     
- Misses      13652    13676      +24     
- Partials     2706     2735      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@279ddfc67dcd3c3b3b90d0ebc4f0108a6df3d1fa

🧩 Skill update

npx skills add infeng/cli#harness/01kr69s0jf1vekkkdj7ktepezs -y -g

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
skills/lark-mail/SKILL.md (1)

25-25: 💤 Low value

Excellent documentation of the allow/block sender feature.

This core concept entry provides comprehensive coverage of the feature's behavior:

  • Clear explanation of mutual exclusivity between allow and block lists
  • Explicit quota constraints (2000 total entries, 100 per batch)
  • Well-defined error handling with stable reason_code enum values
  • Important distinction from tenant-level resources noted

The documentation follows the established pattern from other core concept entries and provides all necessary information for users and developers to understand the feature's constraints and behavior.

Optional: Consider restructuring for improved readability

If desired, the dense paragraph could be broken into sub-bullets to improve scannability:

- **黑白名单(Allow / Block Sender)**:用户级「信任发件人 / 屏蔽发件人」配置,作用于该邮箱的收信链路。
  - **资源管理**:通过 `user_mailbox.allow_senders` / `user_mailbox.blocked_senders` 资源管理,支持 `batch_create` / `list` / `batch_delete`
  - **条目类型**:支持精确邮箱地址(`sender_type=1`)或整个域(`sender_type=2`- **互斥规则**:同一发件人不能同时在两个名单里,加入一侧会自动从对侧移除
  - **配额限制**:单用户黑白合计上限 2000,单次写入最多 100 条
  - **错误处理**:超限项以稳定的 `reason_code``INVALID` / `SELF_ADDRESS` / `SELF_DOMAIN` / `CONFLICT_BLOCK` / `QUOTA_EXCEEDED`)返回在 `failed_items`- **作用范围**:仅影响指定 `user_mailbox_id` 的邮箱,与租户级资源数据分离

However, keeping it as a single paragraph is also acceptable for maintaining consistency with other core concept entries.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-mail/SKILL.md` at line 25, The paragraph is clear but dense;
split it into a short header plus sub-bullets to improve scannability by
breaking out the key parts: "资源管理" referencing user_mailbox.allow_senders /
user_mailbox.blocked_senders and supported operations
(batch_create/list/batch_delete); "条目类型" referencing sender_type (1 = address, 2
= domain); "互斥规则" explaining automatic removal from the opposite list and
referencing CONFLICT_BLOCK; "配额限制" calling out the 2000 total and 100 per-batch
limits and QUOTA_EXCEEDED; and "错误处理/作用范围" referencing failed_items, reason_code
enum (INVALID / SELF_ADDRESS / SELF_DOMAIN / CONFLICT_BLOCK / QUOTA_EXCEEDED),
user_mailbox_id, and separation from tenant-level allowed_sender/blocked_sender
— keep the same content/terminology but convert to sub-bullets for readability.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@skills/lark-mail/SKILL.md`:
- Line 25: The paragraph is clear but dense; split it into a short header plus
sub-bullets to improve scannability by breaking out the key parts: "资源管理"
referencing user_mailbox.allow_senders / user_mailbox.blocked_senders and
supported operations (batch_create/list/batch_delete); "条目类型" referencing
sender_type (1 = address, 2 = domain); "互斥规则" explaining automatic removal from
the opposite list and referencing CONFLICT_BLOCK; "配额限制" calling out the 2000
total and 100 per-batch limits and QUOTA_EXCEEDED; and "错误处理/作用范围" referencing
failed_items, reason_code enum (INVALID / SELF_ADDRESS / SELF_DOMAIN /
CONFLICT_BLOCK / QUOTA_EXCEEDED), user_mailbox_id, and separation from
tenant-level allowed_sender/blocked_sender — keep the same content/terminology
but convert to sub-bullets for readability.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 20160d2d-a1bb-488f-9e69-7455d4816205

📥 Commits

Reviewing files that changed from the base of the PR and between 25c72ce and 279ddfc.

📒 Files selected for processing (1)
  • skills/lark-mail/SKILL.md

@infeng infeng closed this May 11, 2026
@infeng infeng reopened this May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/mail PR touches the mail domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant