-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enrich ImapFolderAgent payload #2076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
@@ -54,6 +54,8 @@ class ImapFolderAgent < Agent | |||
|
|||
Set `mark_as_read` to true to mark found mails as read. | |||
|
|||
Set `include_rfc822` to true to include a raw unencoded mail in each created event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe swap rfc822
and raw
in the option name and description, include_raw_data
and to true to include the rfc822 formatted mail in each created event
? But I don't feel strongly as I am familiar how common the terms are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense. I'll rename it to raw_mail
. Thanks!
148c587
to
4665c30
Compare
@dsander Considering that a raw mail is not always a valid UTF-8 byte stream, should we encode it in some way, like Base64? |
@knu Tricky I guess it depends what one wants to do with the raw data. How are you using the feature? If we would |
Sorry for the delay... I pass raw email data to Unix commands like sendmail/procmail/formail, so I have no problem if the data is encoded in base64. I just need to pipe it through a decoder like base64(1) and openssl(1). |
I guess it could be an option, woudln't we run into a ruby exception when the email contained invalid UTF-8? |
Emails are often in a "legacy" (non-UTF-8) encoding and JSON is not capable of storing binary data, so I believe this feature, to expose raw data as is, was a mere mistake in the first place. I guess I could pretend I'm the only user and go fix it. 🤣 |
Oh I see, you only want to base encode the raw data, yeah that makes sense 😄 |
This adds
message_id
andrfc822
(optional) to the payload format of ImapFolderAgent.A Message-Id value is certainly useful for identifying a mail, and the raw "RFC822" data can be used for further processing or copying to another storage/mailbox.