Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15400061
D17489.id42058.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17489.id42058.diff
View Options
diff --git a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
@@ -93,7 +93,16 @@
->execute();
$users = mpull($users, null, 'getUsername');
+ $raw_tos = array();
foreach ($tos as $key => $username) {
+ // If the recipient has an "@" in any noninitial position, treat this as
+ // a raw email address.
+ if (preg_match('/.@/', $username)) {
+ $raw_tos[] = $username;
+ unset($tos[$key]);
+ continue;
+ }
+
if (empty($users[$username])) {
throw new PhutilArgumentUsageException(
pht("No such user '%s' exists.", $username));
@@ -122,13 +131,20 @@
$body = file_get_contents('php://stdin');
$mail = id(new PhabricatorMetaMTAMail())
- ->addTos($tos)
->addCCs($ccs)
->setSubject($subject)
->setBody($body)
->setIsBulk($is_bulk)
->setMailTags($tags);
+ if ($tos) {
+ $mail->addTos($tos);
+ }
+
+ if ($raw_tos) {
+ $mail->addRawTos($raw_tos);
+ }
+
if ($args->getArg('html')) {
$mail->setBody(
pht(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 9:26 AM (1 d, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7709597
Default Alt Text
D17489.id42058.diff (1 KB)
Attached To
Mode
D17489: Allow "bin/mail send-test" to accept raw email addresses via "--to"
Attached
Detach File
Event Timeline
Log In to Comment