postal-mime 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +3 -2
- package/package.json +1 -1
- package/postal-mime.d.ts +2 -1
- package/src/postal-mime.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.3.2](https://github.com/postalsys/postal-mime/compare/v2.3.1...v2.3.2) (2024-09-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Modified README to trigger a new release (previous npm publish failed) ([f975ef4](https://github.com/postalsys/postal-mime/commit/f975ef4bc8403af72d8cd25ee2d4b3a12cdf82e4))
|
|
9
|
+
|
|
10
|
+
## [2.3.1](https://github.com/postalsys/postal-mime/compare/v2.3.0...v2.3.1) (2024-09-23)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **message/rfc822:** Added option 'forceRfc822Attachments' to handle all message/rfc822 nodes as attachments instead of inline content ([bf47621](https://github.com/postalsys/postal-mime/commit/bf47621da7c55a31acb39fb505f415b1ed4ce5e2))
|
|
16
|
+
|
|
3
17
|
## [2.3.0](https://github.com/postalsys/postal-mime/compare/v2.2.9...v2.3.0) (2024-09-23)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Email parser for browser and serverless environments.
|
|
4
4
|
|
|
5
|
-
PostalMime can be run in the main web thread or from Web Workers. It can also be used in serverless functions.
|
|
5
|
+
PostalMime can be run in the main web thread or from Web Workers. It can also be used in serverless functions like Cloudflare Email Workers.
|
|
6
6
|
|
|
7
7
|
> [!TIP]
|
|
8
8
|
> PostalMime is developed by the makers of **[EmailEngine](https://emailengine.app/?utm_source=github&utm_campaign=imapflow&utm_medium=readme-link)** – a self-hosted email gateway that allows making **REST requests against IMAP and SMTP servers**. EmailEngine also sends webhooks whenever something changes on the registered accounts.
|
|
@@ -98,7 +98,8 @@ Where:
|
|
|
98
98
|
|
|
99
99
|
- **email**: The RFC822 formatted email. This can be a string, an ArrayBuffer/Uint8Array, a Blob object, a Node.js Buffer, or a [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).
|
|
100
100
|
- **options**: An optional object containing configuration options.
|
|
101
|
-
- **rfc822Attachments**: A boolean (defaults to `false`). If set to `true`,
|
|
101
|
+
- **rfc822Attachments**: A boolean (defaults to `false`). If set to `true`, then treats `message/rfc822` attachments without a Content-Disposition declaration as attachments. By default, these messages are treated as inline values.
|
|
102
|
+
- **forceRfc822Attachments**: A boolean (defaults to `false`). If set to `true`, then treats all `message/rfc822` nodes as attachments.
|
|
102
103
|
|
|
103
104
|
This method parses an email message into a structured object with the following properties:
|
|
104
105
|
|
package/package.json
CHANGED
package/postal-mime.d.ts
CHANGED
package/src/postal-mime.js
CHANGED
|
@@ -339,6 +339,10 @@ export default class PostalMime {
|
|
|
339
339
|
|
|
340
340
|
// Check if this is a specially crafted report email where message/rfc822 content should not be inlined
|
|
341
341
|
forceRfc822Attachments() {
|
|
342
|
+
if (this.options.forceRfc822Attachments) {
|
|
343
|
+
return true;
|
|
344
|
+
}
|
|
345
|
+
|
|
342
346
|
let forceRfc822Attachments = false;
|
|
343
347
|
let walk = node => {
|
|
344
348
|
if (!node.contentType.multipart) {
|