Aleksander Machniak
2015-06-17 36a7f573458d03294ef489fd4c1104e92c01a530
Modify rcube_smtp::send_mail() so it is possible to send message by
specifying only the message stream no headers, it's for cases when
the stream already contains a complete message.
1 files modified
12 ■■■■■ changed files
program/lib/Roundcube/rcube_smtp.php 12 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_smtp.php
@@ -208,11 +208,6 @@
        else if (is_string($headers)) {
            $text_headers = $headers;
        }
        else {
            $this->reset();
            $this->response[] = "Invalid message headers";
            return false;
        }
        // exit if no from address is given
        if (!isset($from)) {
@@ -275,8 +270,11 @@
        if (is_resource($body)) {
            // file handle
            $data         = $body;
            $text_headers = preg_replace('/[\r\n]+$/', '', $text_headers);
            $data = $body;
            if ($text_headers) {
                $text_headers = preg_replace('/[\r\n]+$/', '', $text_headers);
            }
        }
        else {
            // Concatenate headers and body so it can be passed by reference to SMTP_CONN->data