protected function _getFrom($from, $headers)
    {
        /* Since few MTAs are going to allow this header to be forged unless
         * it's in the MAIL FROM: exchange, we'll use Return-Path instead of
         * From: if it's set. */
        foreach (array_keys($headers) as $hdr) {
            if (strcasecmp($hdr, 'Return-Path') === 0) {
                $from = $headers[$hdr];
                break;
            }
        }

        if (!strlen($from)) {
            throw new Horde_Mail_Exception('No from address provided.');
        }

        $from = new Horde_Mail_Rfc822_Address($from);

        return $from->bare_address_idn;
    }
protected function _getFrom($from, $headers)
    {
        /* Since few MTAs are going to allow this header to be forged unless
         * it's in the MAIL FROM: exchange, we'll use Return-Path instead of
         * From: if it's set. */
        foreach (array_keys($headers) as $hdr) {
            if (strcasecmp($hdr, 'Return-Path') === 0) {
                $from = $headers[$hdr];
                break;
            }
        }

        if (!strlen($from)) {
            throw new Horde_Mail_Exception('No from address provided.');
        }

        $from = new Horde_Mail_Rfc822_Address($from);

        return $from->bare_address_idn;
    }
protected function _getFrom ( $ from , $ headers ) { /* Since few MTAs are going to allow this header to be forged unless
         * it's in the MAIL FROM: exchange, we'll use Return-Path instead of
         * From: if it's set. */ foreach ( array_keys ( $ headers ) as $ hdr ) { if ( strcasecmp ( $ hdr , 'Return-Path' ) === 0 ) { $ from = $ headers [ $ hdr ] ; break ; } } if ( ! strlen ( $ from ) ) { throw new Horde_Mail_Exception ( 'No from address provided.' ) ; } $ from = new Horde_Mail_Rfc822_Address ( $ from ) ; return $ from -> bare_address_idn ; }
Get the from address.

@param string $from    From address.
@param array $headers  Headers array.

@return string  Address object.
@throws Horde_Mail_Exception
Get the from address .