roundcubemail/plugins/identity_select/identity_select.php
protected function get_email_from_header($message, $header)
    {
        $value = $message->headers->get($header, false);

        if (strtolower($header) == 'received') {
            // find first email address in all Received headers
            $email = null;
            foreach ((array) $value as $entry) {
                if (preg_match('/[\s\t]+for[\s\t]+<([^>]+)>/', $entry, $matches)) {
                    $email = $matches[1];
                    break;
                }
            }

            $value = $email;
        }

        return (array) $value;
    }
protected function get_email_from_header($message, $header)
    {
        $value = $message->headers->get($header, false);

        if (strtolower($header) == 'received') {
            // find first email address in all Received headers
            $email = null;
            foreach ((array) $value as $entry) {
                if (preg_match('/[\s\t]+for[\s\t]+<([^>]+)>/', $entry, $matches)) {
                    $email = $matches[1];
                    break;
                }
            }

            $value = $email;
        }

        return (array) $value;
    }
protected function get_email_from_header ( $ message , $ header ) { $ value = $ message -> headers -> get ( $ header , false ) ; if ( strtolower ( $ header ) == 'received' ) { // find first email address in all Received headers $ email = null ; foreach ( ( array ) $ value as $ entry ) { if ( preg_match ( '/[\s\t]+for[\s\t]+<([^>]+)>/' , $ entry , $ matches ) ) { $ email = $ matches [ 1 ] ; break ; } } $ value = $ email ; } return ( array ) $ value ; }
Extract email address from specified message header
Extract email address from specified message header