forked from huginn/huginn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
message_id
to the payload format of ImapFolderAgent
- Loading branch information
Showing
2 changed files
with
4 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ class ImapFolderAgent < Agent | |
Events look like this: | ||
{ | ||
"message_id": "...(Message-Id without angle brackets)...", | ||
"folder": "INBOX", | ||
"subject": "...", | ||
"from": "Nanashi <[email protected]>", | ||
|
@@ -265,6 +266,7 @@ def check | |
log 'Emitting an event for mail: %s' % message_id | ||
|
||
create_event :payload => { | ||
'message_id' => message_id, | ||
'folder' => mail.folder, | ||
'subject' => mail.scrubbed(:subject), | ||
'from' => mail.from_addrs.first, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ def body_parts(mime_types = %[text/plain text/enriched text/html]) | |
let(:expected_payloads) { | ||
[ | ||
{ | ||
'message_id' => '[email protected]', | ||
'folder' => 'INBOX', | ||
'from' => '[email protected]', | ||
'to' => ['[email protected]', '[email protected]'], | ||
|
@@ -73,6 +74,7 @@ def body_parts(mime_types = %[text/plain text/enriched text/html]) | |
'mime_type' => 'text/plain', | ||
}, | ||
{ | ||
'message_id' => '[email protected]', | ||
'folder' => 'INBOX', | ||
'from' => '[email protected]', | ||
'to' => ['[email protected]', '[email protected]'], | ||
|