Commit af6e318
committed
feat: add read receipt support
End-to-end read-receipt support covering both sides of the flow:
Request side (compose):
- Add --request-receipt flag to +send, +reply, +reply-all, +forward,
+draft-create, +draft-edit. When set, the outgoing EML carries a
Disposition-Notification-To header (RFC 3798) addressed to the
sender. Recipient mail clients may prompt the user, auto-send a
receipt, or silently ignore — delivery is not guaranteed.
Response side:
- Add +send-receipt shortcut. Given --message-id of a mail that
carries the READ_RECEIPT_REQUEST label (-607), it builds an auto-
generated reply whose subject, recipient, send time and read time
match the Lark client's receipt layout. Callers cannot customize
the body — receipt bodies are system-generated templates in the
industry norm; free-form notes belong in +reply.
- Subject prefix is picked by detectSubjectLang on the original
subject: "已读回执:" for CJK, "Read Receipt: " otherwise. Labels
are centralized in receiptMetaLabels(lang), mirroring the
quoteMetaLabels pattern used by +reply / +forward. For en receipts
to aggregate with the original mail in conversation view, the
backend TCC SubjectPrefixListForAdvancedSearch must include
"Read Receipt:"; zh is already configured.
- The outgoing EML carries the private header
X-Lark-Read-Receipt-Mail: 1. The data-access backend parses it
into BodyExtra.IsReadReceiptMail; DraftSend then applies
READ_RECEIPT_SENT (-608) and removes READ_RECEIPT_REQUEST (-607)
from the original message, closing the client-side Banner.
Guard rails against silent auto-sends:
- +send-receipt is marked Risk="high-risk-write" and requires --yes;
+send / +reply / +reply-all / +forward stay draft-by-default and
require --confirm-send, which is further gated by a dynamic scope
check for mail:user_mailbox.message:send (absent from the default
scope set).
- +message, +messages, +thread emit a stderr hint when a message
they surface carries READ_RECEIPT_REQUEST, explicitly telling
callers to ask the user before responding with +send-receipt --yes.
This avoids silent auto-sends from agent callers that skipped the
skill reference.
Docs: new reference page for +send-receipt; --request-receipt noted
on each compose-side reference; SKILL.md index updated.
Tests cover the emlbuilder DispositionNotificationTo /
IsReadReceiptMail helpers, receiptMetaLabels (zh / en / fallback),
buildReceiptSubject, text and HTML body generators, HTML escaping,
confirm-send scope validation, hint emission paths, and the
+send-receipt end-to-end flow.1 parent e6f3fa2 commit af6e318
31 files changed
Lines changed: 2591 additions & 31 deletions
File tree
- shortcuts/mail
- draft
- emlbuilder
- skill-template/domains
- skills/lark-mail
- references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
| |||
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
45 | 57 | | |
46 | 58 | | |
47 | 59 | | |
| |||
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
60 | 78 | | |
61 | 79 | | |
62 | 80 | | |
| |||
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
75 | 97 | | |
76 | 98 | | |
77 | 99 | | |
| |||
80 | 102 | | |
81 | 103 | | |
82 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
83 | 108 | | |
84 | 109 | | |
85 | 110 | | |
| |||
93 | 118 | | |
94 | 119 | | |
95 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
96 | 124 | | |
97 | 125 | | |
98 | 126 | | |
| |||
108 | 136 | | |
109 | 137 | | |
110 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
111 | 142 | | |
112 | 143 | | |
113 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
| |||
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
293 | 328 | | |
294 | 329 | | |
295 | 330 | | |
| |||
567 | 602 | | |
568 | 603 | | |
569 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
570 | 620 | | |
571 | 621 | | |
572 | 622 | | |
| |||
659 | 709 | | |
660 | 710 | | |
661 | 711 | | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
662 | 718 | | |
663 | 719 | | |
664 | 720 | | |
| |||
720 | 776 | | |
721 | 777 | | |
722 | 778 | | |
| 779 | + | |
723 | 780 | | |
724 | 781 | | |
725 | 782 | | |
| |||
0 commit comments