|
|
@ -126,7 +126,9 @@ class enigma_mime_message extends Mail_mime
|
|
|
|
$_headers = $this->message->headers();
|
|
|
|
$_headers = $this->message->headers();
|
|
|
|
$headers = array();
|
|
|
|
$headers = array();
|
|
|
|
|
|
|
|
|
|
|
|
if ($_headers['Content-Transfer-Encoding']) {
|
|
|
|
if ($_headers['Content-Transfer-Encoding']
|
|
|
|
|
|
|
|
&& stripos($_headers['Content-Type'], 'multipart') === false
|
|
|
|
|
|
|
|
) {
|
|
|
|
$headers[] = 'Content-Transfer-Encoding: ' . $_headers['Content-Transfer-Encoding'];
|
|
|
|
$headers[] = 'Content-Transfer-Encoding: ' . $_headers['Content-Transfer-Encoding'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$headers[] = 'Content-Type: ' . $_headers['Content-Type'];
|
|
|
|
$headers[] = 'Content-Type: ' . $_headers['Content-Type'];
|
|
|
@ -142,8 +144,10 @@ class enigma_mime_message extends Mail_mime
|
|
|
|
public function addPGPSignature($body)
|
|
|
|
public function addPGPSignature($body)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->signature = $body;
|
|
|
|
$this->signature = $body;
|
|
|
|
|
|
|
|
|
|
|
|
// Reset Content-Type to be overwritten with valid boundary
|
|
|
|
// Reset Content-Type to be overwritten with valid boundary
|
|
|
|
unset($this->headers['Content-Type']);
|
|
|
|
unset($this->headers['Content-Type']);
|
|
|
|
|
|
|
|
unset($this->headers['Content-Transfer-Encoding']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -154,8 +158,10 @@ class enigma_mime_message extends Mail_mime
|
|
|
|
public function setPGPEncryptedBody($body)
|
|
|
|
public function setPGPEncryptedBody($body)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->encrypted = $body;
|
|
|
|
$this->encrypted = $body;
|
|
|
|
|
|
|
|
|
|
|
|
// Reset Content-Type to be overwritten with valid boundary
|
|
|
|
// Reset Content-Type to be overwritten with valid boundary
|
|
|
|
unset($this->headers['Content-Type']);
|
|
|
|
unset($this->headers['Content-Type']);
|
|
|
|
|
|
|
|
unset($this->headers['Content-Transfer-Encoding']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -193,7 +199,9 @@ class enigma_mime_message extends Mail_mime
|
|
|
|
$headers = $this->message->headers();
|
|
|
|
$headers = $this->message->headers();
|
|
|
|
$params = array('content_type' => $headers['Content-Type']);
|
|
|
|
$params = array('content_type' => $headers['Content-Type']);
|
|
|
|
|
|
|
|
|
|
|
|
if ($headers['Content-Transfer-Encoding']) {
|
|
|
|
if ($headers['Content-Transfer-Encoding']
|
|
|
|
|
|
|
|
&& stripos($headers['Content-Type'], 'multipart') === false
|
|
|
|
|
|
|
|
) {
|
|
|
|
$params['encoding'] = $headers['Content-Transfer-Encoding'];
|
|
|
|
$params['encoding'] = $headers['Content-Transfer-Encoding'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -243,18 +251,24 @@ class enigma_mime_message extends Mail_mime
|
|
|
|
if ($filename) {
|
|
|
|
if ($filename) {
|
|
|
|
// Append mimePart message headers and body into file
|
|
|
|
// Append mimePart message headers and body into file
|
|
|
|
$headers = $message->encodeToFile($filename, $boundary, $skip_head);
|
|
|
|
$headers = $message->encodeToFile($filename, $boundary, $skip_head);
|
|
|
|
|
|
|
|
|
|
|
|
if ($this->isError($headers)) {
|
|
|
|
if ($this->isError($headers)) {
|
|
|
|
return $headers;
|
|
|
|
return $headers;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->headers = array_merge($this->headers, $headers);
|
|
|
|
$this->headers = array_merge($this->headers, $headers);
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
$output = $message->encode($boundary, $skip_head);
|
|
|
|
$output = $message->encode($boundary, $skip_head);
|
|
|
|
|
|
|
|
|
|
|
|
if ($this->isError($output)) {
|
|
|
|
if ($this->isError($output)) {
|
|
|
|
return $output;
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->headers = array_merge($this->headers, $output['headers']);
|
|
|
|
$this->headers = array_merge($this->headers, $output['headers']);
|
|
|
|
|
|
|
|
|
|
|
|
return $output['body'];
|
|
|
|
return $output['body'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|