Get the from address.

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

@return string  Address object.
@throws Horde_Mail_Exception
768653
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;
    }
1229489
public function from($address, $name = null)
    {
        if (is_array($address)) {
            $this->addAddressArray($address, 'from');
        } else {
            $this->from[$address] = $name;
        }

        return $this;
    }
1229442
public function from($address = null, $name = null)
    {
        if (!func_num_args()) {
            return $this->_from;
        }
        $class = $this->_classes['address'];
        $this->_from = new $class($address, $name);

        $headers = $this->headers();
        $headers['From'] = $this->_from->toString();
        return $this;
    }
453289
public function moveCell($fromAddress, $toAddress) {
		if ($fromAddress === $this->_currentObjectID) {
			$this->_currentObjectID = $toAddress;
		}

		$this->_deleteQuery->bindValue('id',$toAddress,SQLITE3_TEXT);
		$result = $this->_deleteQuery->execute();
		if ($result === false)
			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());

		$this->_updateQuery->bindValue('toid',$toAddress,SQLITE3_TEXT);
		$this->_updateQuery->bindValue('fromid',$fromAddress,SQLITE3_TEXT);
		$result = $this->_updateQuery->execute();
		if ($result === false)
			throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());

		return TRUE;
	}
982358
private function extractEncoderKey(array $headers): string
    {
        /** @var string $encoderKey */
        $encoderKey = $headers[Transport::SERVICE_BUS_SERIALIZER_HEADER] ?? self::DEFAULT_DECODER;

        return $encoderKey;
    }
1047284
private function getHeaders(array $headers)
    {
        $str = '';
        foreach ($headers as $key => $value) {
            $str .= sprintf("%s: %s\r\n", $key, $value);
        }

        return $str;
    }
707408
public function get($url, array $headers = array())
    {
        curl_setopt($this->handle, CURLOPT_HTTPGET, true);

        return $this->execute($url, $headers);
    }
354142
public function setFrom($from)
    {
	$result = $this->_senderResolver->resolve($from, $this->getStoreId());
        $this->setSenderMail($result);
        $this->message->setFrom($result['email'], $result['name']);
        
        return $this;
    }
824224
public static function fromArray(array $headers)
    {
        $instance = new static();

        if (isset($headers["content-type"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_CONTENT_TYPE;
            $instance->contentType = $headers["content-type"];
            unset($headers["content-type"]);
        }

        if (isset($headers["content-encoding"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_CONTENT_ENCODING;
            $instance->contentEncoding = $headers["content-encoding"];
            unset($headers["content-encoding"]);
        }

        if (isset($headers["delivery-mode"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_DELIVERY_MODE;
            $instance->deliveryMode = $headers["delivery-mode"];
            unset($headers["delivery-mode"]);
        }

        if (isset($headers["priority"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_PRIORITY;
            $instance->priority = $headers["priority"];
            unset($headers["priority"]);
        }

        if (isset($headers["correlation-id"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_CORRELATION_ID;
            $instance->correlationId = $headers["correlation-id"];
            unset($headers["correlation-id"]);
        }

        if (isset($headers["reply-to"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_REPLY_TO;
            $instance->replyTo = $headers["reply-to"];
            unset($headers["reply-to"]);
        }

        if (isset($headers["expiration"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_EXPIRATION;
            $instance->expiration = $headers["expiration"];
            unset($headers["expiration"]);
        }

        if (isset($headers["message-id"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_MESSAGE_ID;
            $instance->messageId = $headers["message-id"];
            unset($headers["message-id"]);
        }

        if (isset($headers["timestamp"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_TIMESTAMP;
            $instance->timestamp = $headers["timestamp"];
            unset($headers["timestamp"]);
        }

        if (isset($headers["type"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_TYPE;
            $instance->typeHeader = $headers["type"];
            unset($headers["type"]);
        }

        if (isset($headers["user-id"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_USER_ID;
            $instance->userId = $headers["user-id"];
            unset($headers["user-id"]);
        }

        if (isset($headers["app-id"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_APP_ID;
            $instance->appId = $headers["app-id"];
            unset($headers["app-id"]);
        }

        if (isset($headers["cluster-id"])) {
            $instance->flags |= ContentHeaderFrame::FLAG_CLUSTER_ID;
            $instance->clusterId = $headers["cluster-id"];
            unset($headers["cluster-id"]);
        }

        if (!empty($headers)) {
            $instance->flags |= ContentHeaderFrame::FLAG_HEADERS;
            $instance->headers = $headers;
        }

        return $instance;
    }
189310
public function moveCell($fromAddress, $toAddress)
    {
        if ($fromAddress === $this->currentObjectID) {
            $this->currentObjectID = $toAddress;
        }

        $query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$toAddress."'";
        $result = $this->DBHandle->exec($query);
        if ($result === false) {
            throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
        }

        $query = "UPDATE kvp_".$this->TableName." SET id='".$toAddress."' WHERE id='".$fromAddress."'";
        $result = $this->DBHandle->exec($query);
        if ($result === false) {
            throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
        }

        return true;
    }
274213
public function getHeaders()
    {
        if (isset($this->parts[1])) {
            $headers = $this->getPart('headers', $this->parts[1]);
            foreach ($headers as $name => &$value) {
                if (is_array($value)) {
                    foreach ($value as &$v) {
                        $v = $this->decodeSingleHeader($v);
                    }
                } else {
                    $value = $this->decodeSingleHeader($value);
                }
            }

            return $headers;
        } else {
            throw new Exception(
                'setPath() or setText() or setStream() must be called before retrieving email headers.'
            );
        }
    }
395230
public function headersToCurl(array $headers)
    {
        $this->formatedParameters = [];
        $curlHeaders              = '';

        foreach ($headers as $headerName => $values) {
            foreach ($values as $headerValue) {
                $curlHeaders .= sprintf('--header "%s: %s" ', $headerName, $headerValue);
            }
        }

        return substr($curlHeaders, 0, -1);
    }
912893
public function from($from, $from_name = '')
    {
        $this->from      = $from;
        $this->from_name = $from_name;
        return $this;
    }
51078
public function from($from, $name = null)
    {
        $this->from = ($name !== null) ? (ucwords($name) . " <{$from}>") : $from;

        return $this;
    }
1340679
public static function move($names, &$from, &$to)
    {
        if (is_array($from) && is_array($to)) {
            foreach ($names as $key) {
                if (isset($from[$key]) && !isset($to[$key])) {
                    $to[$key] = static::getValue($from, $key);
                    $moved[$key] = static::removeValue($from, $key);
                }
            }
        }
        return $moved;
    }
502101
public function moveCell($fromAddress, $toAddress)
    {
        if ($fromAddress === $this->currentObjectID) {
            $this->currentObjectID = $toAddress;
        }

        $this->deleteQuery->bindValue('id', $toAddress, SQLITE3_TEXT);
        $result = $this->deleteQuery->execute();
        if ($result === false) {
            throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
        }

        $this->updateQuery->bindValue('toid', $toAddress, SQLITE3_TEXT);
        $this->updateQuery->bindValue('fromid', $fromAddress, SQLITE3_TEXT);
        $result = $this->updateQuery->execute();
        if ($result === false) {
            throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
        }

        return true;
    }
181322
protected function findHeader(array $headers): string
    {
        $signature = '';
        foreach ($headers as $header) {
            if ($this->request->hasHeader($header)) {
                $value = $this->request->getHeader($header);
                $value = array_shift($value);
                if ($value !== null) {
                    $signature = $value;
                    continue;
                }
            }
        }

        return $signature;
    }