mail: mail is now capable to read Mailer-Daemons and extract parts as attachment

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3782 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2017-06-16 13:58:57 +00:00
parent 18bbfb5f5b
commit b999bd7e5b

View File

@@ -916,13 +916,23 @@ class mail
continue; continue;
$disposition = $this->getHeaderValue ("Content-Disposition", $disposition = $this->getHeaderValue ("Content-Disposition",
$section["_headersArray"]); $section["_headersArray"]);
if ($disposition === false) if ($disposition !== false)
continue; {
if ($inline === true && substr ($disposition, 0, 6) === "inline") if ($inline === true && substr ($disposition, 0, 6) === "inline")
$res[] = $sectionID; $res[] = $sectionID;
elseif ($inline === false && elseif ($inline === false &&
substr ($disposition, 0, 10) === "attachment") substr ($disposition, 0, 10) === "attachment")
$res[] = $sectionID; $res[] = $sectionID;
continue;
}
// The Mailer-Daemons use Content-Type: message/XXXX
$contentType = $this->getHeaderValue ("Content-Type",
$section["_headersArray"]);
if ($contentType !== false && substr ($contentType, 0, 8) === "message/")
{
if ($inline === false)
$res[] = $sectionID;
}
} }
return $res; return $res;
} }