message: refactor/improve attachment heuristic a bit

Also check for X-MS-Has-Attach
This commit is contained in:
Dirk-Jan C. Binnema
2022-06-10 00:43:47 +03:00
parent 39dcd08fbe
commit 9bf580de3d
4 changed files with 112 additions and 43 deletions

View File

@ -105,13 +105,23 @@ public:
/**
* Does this part have an "attachment" disposition? Otherwise it is
* "inline". Note that does *not* map 1:1 to a message's HasAttachment
* flag.
* flag (which uses looks_like_attachment())
*
* @return true or false.
*/
bool is_attachment() const noexcept;
/**
* Does this part appear to be an attachment from an end-users point of
* view? This uses some heuristics to guess. Some parts for which
* is_attachment() is true may not "really" be attachments, and
* vice-versa
*
* @return true or false.
*/
bool looks_like_attachment() const noexcept;
/**
* Is this part signed?
*