I think this improves email a good deal, although it's hard to really test it

since Exchange has been down for like 30 minutes now. Push & Pray!

Summary:

Test Plan:

Reviewers:

CC:
This commit is contained in:
epriestley
2011-02-09 11:11:24 -08:00
parent e3a91902b7
commit 616c22eae2
4 changed files with 85 additions and 20 deletions

View File

@@ -69,7 +69,6 @@ class PhabricatorEmailLoginController extends PhabricatorAuthController {
array(
$target_user->getPHID(),
));
$mail->setReplyTo(PhabricatorEnv::getEnvConfig('metamta.noreply'));
$mail->setBody(
"blah blah blah ".
PhabricatorEnv::getURI('/login/etoken/'.$etoken.'/').'?email='.phutil_escape_uri($target_user->getEmail()));

View File

@@ -73,11 +73,16 @@ abstract class DifferentialMail {
$mail = new PhabricatorMetaMTAMail();
$handle = $this->getActorHandle();
$reply = $this->getReplyHandlerEmailAddress();
if ($handle) {
$mail->setFrom($handle->getPHID());
$mail->setReplyTo($this->getReplyHandlerEmailAddress());
if ($reply) {
$mail->setReplyTo($this->getReplyHandlerEmailAddress());
}
} else {
$mail->setFrom($this->getReplyHandlerEmailAddress());
if ($reply) {
$mail->setFrom($this->getReplyHandlerEmailAddress());
}
}
$mail
@@ -144,6 +149,7 @@ EOTEXT;
}
protected function getReplyHandlerEmailAddress() {
return null;
// TODO
$phid = $this->getRevision()->getPHID();
$server = 'todo.example.com';

View File

@@ -166,8 +166,21 @@ class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$params = $this->parameters;
$default = PhabricatorEnv::getEnvConfig('metamta.default-address');
if (empty($params['from'])) {
$mailer->setFrom($default);
} else if (!PhabricatorEnv::getEnvConfig('metamta.can-send-as-user')) {
$from = $params['from'];
if (empty($params['reply-to'])) {
$params['reply-to'] = $handles[$from]->getEmail();
}
$mailer->setFrom($default);
unset($params['from']);
}
foreach ($this->parameters as $key => $value) {
foreach ($params as $key => $value) {
switch ($key) {
case 'from':
$mailer->setFrom($handles[$value]->getEmail());