Persist excluded recipients when saving mail
Summary:
Fixes T5185. The fundamental issue is that this excludePHIDs property was not saved, so the logic went like this:
- Generate excludePHIDs correctly.
- Pass excludePHIDs through the stack.
- Perform some other computations correctly.
- Queue the mail for the daemons, throwing it away.
- Daemons process mail with empty excludePHIDs list.
Store it in the persistent properties array instead.
Also remove the "override self mail" thing, since it's only used by bin/mail send-test and suffers from the same issue. I think it's too useless to fix, since even if you get caught by it, bin/mail makes it clear why the message was dropped.
Test Plan:
Notable:
- exclude present in properties
- Exclusion reason under RECIPIENTS header
1 | $ ./bin/mail show-outbound --id 22653 |
---|---|
2 | PROPERTIES |
3 | ID: 22653 |
4 | Status: queued |
5 | Related PHID: PHID-TASK-gdxfct3qqboudbmfye3h |
6 | Message: |
7 | |
8 | PARAMETERS |
9 | subject: T10000145: asdf |
10 | from: PHID-USER-lqiz3yd7wmk64ejugvov |
11 | subject-prefix: [Maniphest] |
12 | vary-subject-prefix: [Commented On] |
13 | thread-id: maniphest-task-PHID-TASK-gdxfct3qqboudbmfye3h |
14 | is-first-message: |
15 | exclude: ["PHID-USER-aeabc4ipqbifny3rw4ok"] |
16 | mailtags: ["maniphest-comment"] |
17 | is-bulk: 1 |
18 | parent-message-id: i4lboqya4tltd4qivqd4a2b4vxzvj4geythhmh2y7gi3uho4kuczrwttq7zoekj4 |
19 | cc: ["PHID-USER-aeabc4ipqbifny3rw4ok"] |
20 | reply-to: prefix+T10000145+public+caace40165701255@localderp.com |
21 | |
22 | HEADERS |
23 | Thread-Topic: T10000145: asdf |
24 | X-Herald-Rules: <51>, none |
25 | X-Phabricator-To: <PHID-USER-lqiz3yd7wmk64ejugvov> |
26 | X-Phabricator-Cc: <PHID-USER-aeabc4ipqbifny3rw4ok> |
27 | X-Phabricator-Cc: <PHID-USER-lqiz3yd7wmk64ejugvov> |
28 | |
29 | RECIPIENTS |
30 | ! duck (duck) |
31 | - This message is a response to another email message, and this recipient received the original email message, so we are not sending them this substantially similar message (for example, the sender used "Reply All" instead of "Reply" in response to mail from Phabricator). |
32 | |
33 | BODY |
34 | epriestley added a comment. |
35 | |
36 | quackquack |
37 | |
38 | TASK DETAIL |
39 | http://local.aphront.com:8080/T10000145 |
40 | |
41 | REPLY HANDLER ACTIONS |
42 | Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>. |
43 | |
44 | To: epriestley |
45 | Cc: duck, epriestley |
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T5185
Differential Revision: https://secure.phabricator.com/D10234