示例#1
0
function getEmailIdFromString($mystring)
{
    // $mystring may be 'Chandu Nannapaneni <*****@*****.**>' or '*****@*****.**'
    $pos = strpos($mystring, '<');
    if ($pos === false) {
        return trim($mystring);
    } else {
        // get string between '<' and '>'
        return strBetweenXY($mystring, '<', '>');
    }
    return trim($mystring);
}
示例#2
0
} else {
    $thisemail_body = $Parser->getMessageBody('text');
}
$pos = strpos(strtolower($thisemail_toAddress), '@discreteevents.com');
if ($pos === false) {
    $pos = strpos(strtolower($thisemail_ccAddress), '@discreteevents.com');
    if ($pos === false) {
        // wonder what to do with this email ? calling quits
        exit(0);
    } else {
        list($before_underscore) = explode('_', $thisemail_ccAddress);
        $SUBDOMAIN = strBetweenXY($thisemail_ccAddress, '_', '@');
    }
} else {
    list($before_underscore) = explode('_', $thisemail_toAddress);
    $SUBDOMAIN = strBetweenXY($thisemail_toAddress, '_', '@');
}
// check for valid subdomain
$query = mysql_query("select dbname as CLIENTDBNAME, timezone as myTimeZone, package as pkgid, status as subdomainStatus from subdomains where subdomain='{$SUBDOMAIN}'");
if (@mysql_num_rows($query) == 0) {
    $processemail_debugoutput = "Invalid Subdomain: Failed adding Task for \n {$thisemail_subject}";
    exit(0);
}
while ($row = @mysql_fetch_array($query)) {
    extract($row);
}
// $CLIENTDBNAME, $pkgid, $subdomainStatus, $myTimeZone
// Set TimeZone
putenv("TZ=" . $myTimeZone);
// Connect to this subdomain's database
if (!@mysql_select_db($CLIENTDBNAME)) {