Returns true if an address exists with the passed email address.

Comparison is done case insensitively.

@param string $email
@return boolean
519157
public function hasAddress($email)
    {
        foreach ($this->addresses as $addr) {
            if (strcasecmp($addr->getEmail(), $email) === 0) {
                return true;
            }
        }
        return false;
    }
594883
public static function verify_email_address($email) {
		$email = trim($email);
		if (!$email || strlen($email) > 64)
			return false;
		return filter_var($email, FILTER_VALIDATE_EMAIL);
	}
216288
public function findOneByEmailIgnoreHidden($email)
    {
        $query = $this->createQuery();
        $query->getQuerySettings()->setIgnoreEnableFields(TRUE);

        $query->matching(
            $query->equals('email', $email )
        );

        return $query->execute()->getFirst();
    }
916816
public static function validate($email)
    {
        $validate = new Email();
        foreach ($validate->getFilters() as $filter) {
            $v = $validate->{'check' . ucfirst($filter)}($email);
            if ($v) {
                $validate->setValid(true);
            } else {
                $validate->setValid(false);
                break;
            }
        }

        return $validate->isValid();
    }
1137852
public function exists($email)
    {
        $this->setDefaultImage('404');

        $url = $this->buildGravatarURL($email);
        $headers = get_headers($url, 1);

        return substr($headers[0], 9, 3) == '200';
    }
678650
public static function check_email($email, $dns_check=true)
    {
        // Check for invalid characters
        if (preg_match('/[\x00-\x1F\x7F-\xFF]/', $email)) {
            return false;
        }

        // Check for length limit specified by RFC 5321 (#1486453)
        if (strlen($email) > 254) {
            return false;
        }

        $email_array = explode('@', $email);

        // Check that there's one @ symbol
        if (count($email_array) < 2) {
            return false;
        }

        $domain_part = array_pop($email_array);
        $local_part  = implode('@', $email_array);

        // from PEAR::Validate
        $regexp = '&^(?:
            ("\s*(?:[^"\f\n\r\t\v\b\s]+\s*)+")|                             #1 quoted name
            ([-\w!\#\$%\&\'*+~/^`|{}=]+(?:\.[-\w!\#\$%\&\'*+~/^`|{}=]+)*))  #2 OR dot-atom (RFC5322)
            $&xi';

        if (!preg_match($regexp, $local_part)) {
            return false;
        }

        // Validate domain part
        if (preg_match('/^\[((IPv6:[0-9a-f:.]+)|([0-9.]+))\]$/i', $domain_part, $matches)) {
            return self::check_ip(preg_replace('/^IPv6:/i', '', $matches[1])); // valid IPv4 or IPv6 address
        }
        else {
            // If not an IP address
            $domain_array = explode('.', $domain_part);
            // Not enough parts to be a valid domain
            if (count($domain_array) < 2) {
                return false;
            }

            foreach ($domain_array as $part) {
                if (!preg_match('/^((xn--)?([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]))$/', $part)) {
                    return false;
                }
            }

            // last domain part
            $last_part = array_pop($domain_array);
            if (strpos($last_part, 'xn--') !== 0 && preg_match('/[^a-zA-Z]/', $last_part)) {
                return false;
            }

            $rcube = rcube::get_instance();

            if (!$dns_check || !function_exists('checkdnsrr') || !$rcube->config->get('email_dns_check')) {
                return true;
            }

            // Check DNS record(s)
            // Note: We can't use ANY (#6581)
            foreach (array('A', 'MX', 'CNAME', 'AAAA') as $type) {
                if (checkdnsrr($domain_part, $type)) {
                    return true;
                }
            }
        }

        return false;
    }
465745
public function validateEmail($email)
    {
        // Split email address up and disallow '..'
        $pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
        if ((strpos($email, '..') === false) && preg_match( $pattern, $email))
        {
            return true;
        }

        return false;
    }
986407
public function searchByEmailArray($email) {
		$results = $this->ldap->search($this->basedn,
			$this->search_mail_array . '=' . $email);
		return $results;
	}
800646
public function accountExists($email)
	{
		// E-Mail check
		$stmntEmailCheck = $this->db->prepare("SELECT ID FROM " . $this->settings['db_login_table'] . " WHERE email = ?");
		$resEmailCheck = $this->db->select($stmntEmailCheck, array($email));

		return (count($resEmailCheck) > 0)?$resEmailCheck[0]->ID:false;
	}
729495
public function searchByEmail($email) {
		$results = $this->ldap->search($this->basedn,
			$this->search_mail . '=' . $email);
		return $results;
	}
761552
private function checkMail($mail)
    {
        $host = substr($mail, strpos($mail, '@')+1);
        $ip = gethostbyname($host);
        if ($ip == $host)
        {
            Eresus_Kernel::app()->getPage()->addErrorMessage(sprintf(errNonexistedDomain, $host));
            return false;
        }
        return true;
    }
998263
public function isExample($email)
    {
        if (! $this->isEmail($email)) {
            return null;
        }

        $hostname = $this->hostnameFromEmail($email);

        if ($hostname) {
            if (in_array($hostname, $this->exampleDomains)) {
                return true;
            }

            foreach ($this->exampleTlds as $tld) {
                $length = strlen($tld);
                $subStr = substr($hostname, -$length);

                if ($subStr == $tld) {
                    return true;
                }
            }

            return false;
        }

        return null;
    }
1240637
public static function isEmail($email = null)
    {
        if (is_null($email) || !$email || !is_string($email)) {
            return false;
        }
        return (bool) (preg_match('/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/', $email) > 0);
    }
913511
public function isRole($email)
    {
        if (! $this->isEmail($email)) {
            return null;
        }

        $user = $this->userFromEmail($email);

        if ($user) {
            // Load disposable domains
            if (is_null($this->role)) {
                $this->role = include('data/role.php');
            }

            // Search array for hostname
            if (in_array($user, $this->role)) {
                return true;
            }

            return false;
        }

        return null;
    }
966962
protected function _prepareFromAddress($email)
    {
        $from = $email->getReturnPath();
        if (empty($from)) {
            $from = $email->getFrom();
        }

        return $from;
    }
1220824
private function checkHeadersForInjection(\sb\Email $email)
    {

        if (\preg_match("~\r|:~i", $email->to) || preg_match("~\r|:~i", $email->from)) {
            return true;
        }

        return false;
    }
583467
public final static boolean isValidEmail(String email) {
        if (email == null) {
            return false;
        } else {
            return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();
        }
    }