summaryrefslogtreecommitdiff
path: root/maildaemon.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-21 00:23:02 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-21 00:23:02 -0400
commitc2aaa22ffb0c38a8601418f207babaf4c2867f3b (patch)
tree3130d1380f58cef6206ed369f6479a2467a42522 /maildaemon.php
parenta4edf5daef8cf4cc4c519781478b994272212f6f (diff)
use smsemail stored value
darcs-hash:20080721042302-84dde-b077675affa13a761ba07b4c5ac4ff667cf00eb2.gz
Diffstat (limited to 'maildaemon.php')
-rwxr-xr-xmaildaemon.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/maildaemon.php b/maildaemon.php
index 59659b990..4c03b151d 100755
--- a/maildaemon.php
+++ b/maildaemon.php
@@ -31,6 +31,9 @@ require_once(INSTALLDIR . '/lib/common.php');
require_once(INSTALLDIR . '/lib/mail.php');
require_once('Mail/mimeDecode.php');
+# FIXME: we use both Mail_mimeDecode and mailparse
+# Need to move everything to mailparse
+
class MailerDaemon {
function __construct() {
@@ -49,12 +52,16 @@ class MailerDaemon {
}
if (!$this->user_match_to($user, $to)) {
$this->error($from, _('Sorry, that is not your incoming email address.'));
+ return false;
}
if (!$user->emailpost) {
+ $this->error($from, _('Sorry, no incoming email allowed.'));
+ return false;
}
$response = $this->handle_command($user, $msg);
if ($response) {
$this->respond($from, $to, $response);
+ return true;
}
$msg = $this->cleanup_msg($msg);
$this->add_notice($user, $msg);
@@ -71,7 +78,12 @@ class MailerDaemon {
return NULL;
}
$from = $froms[0];
- return User::staticGet('email', common_canonical_email($from['address']));
+ $addr = common_canonical_email($from['address']);
+ $user = User::staticGet('email', $addr);
+ if (!$user) {
+ $user = User::staticGet('smsemail', $addr);
+ }
+ return $user;
}
function user_match_to($user, $to_hdr) {