- Don't use mail_header_delimiter when saving mail in IMAP
| | |
| | | |
| | | // make sure mailbox exists |
| | | if ($this->mailbox_exists($mbox_name, true)) { |
| | | if ($is_file) { |
| | | $separator = rcmail::get_instance()->config->header_delimiter(); |
| | | $saved = $this->conn->appendFromFile($mailbox, $message, |
| | | $headers, $separator.$separator); |
| | | } |
| | | if ($is_file) |
| | | $saved = $this->conn->appendFromFile($mailbox, $message, $headers); |
| | | else |
| | | $saved = $this->conn->append($mailbox, $message); |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | function appendFromFile($folder, $path, $headers=null, $separator="\n\n") |
| | | function appendFromFile($folder, $path, $headers=null) |
| | | { |
| | | if (!$folder) { |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | |
| | | $body_separator = "\r\n\r\n"; |
| | | $len = filesize($path); |
| | | |
| | | if (!$len) { |
| | | return false; |
| | | } |
| | | |
| | | if ($headers) { |
| | | $headers = preg_replace('/[\r\n]+$/', '', $headers); |
| | | $len += strlen($headers) + strlen($separator); |
| | | $len += strlen($headers) + strlen($body_separator); |
| | | } |
| | | |
| | | // send APPEND command |
| | |
| | | |
| | | // send headers with body separator |
| | | if ($headers) { |
| | | $this->putLine($headers . $separator, false); |
| | | $this->putLine($headers . $body_separator, false); |
| | | } |
| | | |
| | | // send file |