Esempio n. 1
0
 function rcptOK($user)
 {
     global $domains;
     list($uname, $dom) = explode('@', $user);
     if (empty($uname) || empty($dom)) {
         return false;
     }
     if (AtmailGlobal::isset_chk($domains[$dom])) {
         // Check for non-existant local users
         if (!$this->sql->sqlgetfield("select Account from UserSession where Account=?", $user)) {
             return false;
         }
         // Check if recipient has whitelist on
         $res = $this->sql->sqlgetfield('select distinct value from SpamSettings where (username=? or username="******") and preference="whitelist_only" and value="1"', $user);
         if ($res == 1) {
             // Whitelisting is on so check for sender
             $query = 'SELECT DISTINCT value from SpamSettings where ( username=? or username="******" ) and preference="whitelist_from" and ( value=? OR value=? )';
             $senderDom = strstr($this->EmailFrom, '@');
             $data = array($user, $this->EmailFrom, $senderDom);
             $res = $this->sql->sqlgetfield($query, $data);
             if (empty($res)) {
                 return false;
             }
         }
     }
     return true;
 }
Esempio n. 2
0
            // Add the new entry into the database
            $abook->addgroup($var['UserGroup'], $user);
        }
        // Record we have already read this user
        $tmp[$user]++;
    }
}
// Update any record
if ($_REQUEST['update']) {
    $abook->update($var);
    $var['status'] = "Updated {$var['Email']} - ";
}
// Add a new record to the addressbook
if (AtmailGlobal::isset_chk($_REQUEST['add'])) {
    // Update the users prefs to show images in messages from users within the abook
    if (AtmailGlobal::isset_chk($_REQUEST['AbookAllow'])) {
        $atmail->update_settings_displayimages();
    }
    $var['AddRecipients'] = $_REQUEST['AddRecipients'];
    if ($var['AddRecipients']) {
        if (preg_match('/(;|,)/', $var['AddRecipients'], $m)) {
            $recipients = explode($m[1], $var['AddRecipients']);
        } else {
            $recipients = array($var['AddRecipients']);
        }
        foreach ($recipients as $addr) {
            $addr = html_entity_decode($addr);
            $exp = '/([^":\\s<>()\\/;]*@[^":\\s<>()\\/;]*)/';
            // Load the users email address from the string
            preg_match($exp, $addr, $match);
            $email = $match[1];