@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow "bin/mail send-test" to accept raw email addresses via "--to"

Summary: Ref T12372. This supports testing the `wordwrap()` patch discussed in that task.

Test Plan:
- Ran `bin/mail send-test --to email@domain.com`
- Ran `bin/mail send-test --to username`

Reviewers: chad, lvital

Reviewed By: lvital

Maniphest Tasks: T12372

Differential Revision: https://secure.phabricator.com/D17489

+17 -1
+17 -1
src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
··· 93 93 ->execute(); 94 94 $users = mpull($users, null, 'getUsername'); 95 95 96 + $raw_tos = array(); 96 97 foreach ($tos as $key => $username) { 98 + // If the recipient has an "@" in any noninitial position, treat this as 99 + // a raw email address. 100 + if (preg_match('/.@/', $username)) { 101 + $raw_tos[] = $username; 102 + unset($tos[$key]); 103 + continue; 104 + } 105 + 97 106 if (empty($users[$username])) { 98 107 throw new PhutilArgumentUsageException( 99 108 pht("No such user '%s' exists.", $username)); ··· 122 131 $body = file_get_contents('php://stdin'); 123 132 124 133 $mail = id(new PhabricatorMetaMTAMail()) 125 - ->addTos($tos) 126 134 ->addCCs($ccs) 127 135 ->setSubject($subject) 128 136 ->setBody($body) 129 137 ->setIsBulk($is_bulk) 130 138 ->setMailTags($tags); 139 + 140 + if ($tos) { 141 + $mail->addTos($tos); 142 + } 143 + 144 + if ($raw_tos) { 145 + $mail->addRawTos($raw_tos); 146 + } 131 147 132 148 if ($args->getArg('html')) { 133 149 $mail->setBody(