From 7f6db276185bd0ae55f4d494fd4320d6f8d74b25 Mon Sep 17 00:00:00 2001 From: Danny Adams Date: Thu, 2 Feb 2023 08:35:07 -0500 Subject: [PATCH] Non-doctored bytes for message. --- src/internal/connector/mockconnector/mock_data_message.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/internal/connector/mockconnector/mock_data_message.go b/src/internal/connector/mockconnector/mock_data_message.go index da06cbaab..4e3761280 100644 --- a/src/internal/connector/mockconnector/mock_data_message.go +++ b/src/internal/connector/mockconnector/mock_data_message.go @@ -359,3 +359,10 @@ func GetMockMessageWithItemAttachmentEvent(subject string) []byte { return []byte(message) } + +func GetMockMessageWithItemAttachmentMessage(subject string) []byte { + //nolint:lll + message := "{\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#users('f435c656-f8b2-4d71-93c3-6e092f52a167')/messages(attachments())/$entity\",\"@odata.etag\":\"W/\\\"CQAAABYAAAB8wYc0thTTTYl3RpEYIUq+AADFK4Xf\\\"\",\"id\":\"AAMkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4NWRlZDA2Y2UxOABGAAAAAAAPvVwUramXT7jlSGpVU8_7BwB8wYc0thTTTYl3RpEYIUq_AAAAAAEMAAB8wYc0thTTTYl3RpEYIUq_AADFfThQAAA=\",\"createdDateTime\":\"2023-02-02T03:50:45Z\",\"lastModifiedDateTime\":\"2023-02-02T03:50:46Z\",\"changeKey\":\"CQAAABYAAAB8wYc0thTTTYl3RpEYIUq+AADFK4Xf\",\"categories\":[],\"receivedDateTime\":\"2023-02-02T03:50:45Z\",\"sentDateTime\":\"2023-02-02T03:50:43Z\",\"hasAttachments\":true,\"internetMessageId\":\"\",\"subject\":\"FlagThisfailure\",\"bodyPreview\":\"It'sunclearwhenthisfailedbutweshouldknowmore\",\"importance\":\"normal\",\"parentFolderId\":\"AQMkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4ADVkZWQwNmNlMTgALgAAAw_9XBStqZdPuOVIalVTz7sBAHzBhzS2FNNNiXdGkRghSr4AAAIBDAAAAA==\",\"conversationId\":\"AAQkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4NWRlZDA2Y2UxOAAQAHEmjyZHbYdDoFWHwNKyo8c=\",\"conversationIndex\":\"AQHZNrl6cSaPJkdth0OgVYfA0rKjxw==\",\"isDeliveryReceiptRequested\":false,\"isReadReceiptRequested\":false,\"isRead\":false,\"isDraft\":false,\"webLink\":\"https://outlook.office365.com/owa/?ItemID=AAMkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4NWRlZDA2Y2UxOABGAAAAAAAPvVwUramXT7jlSGpVU8%2B7BwB8wYc0thTTTYl3RpEYIUq%2BAAAAAAEMAAB8wYc0thTTTYl3RpEYIUq%2BAADFfThQAAA%3D&exvsurl=1&viewmodel=ReadMessageItem\",\"inferenceClassification\":\"focused\",\"body\":{\"contentType\":\"html\",\"content\":\"\\r\\n\\r\\n\\r\\nIt'sunclearwhenthisfailedbutweshouldknowmore\"},\"sender\":{\"emailAddress\":{\"name\":\"DustinAbbot\",\"address\":\"dustina@8qzvrj.onmicrosoft.com\"}},\"from\":{\"emailAddress\":{\"name\":\"DustinAbbot\",\"address\":\"dustina@8qzvrj.onmicrosoft.com\"}},\"toRecipients\":[{\"emailAddress\":{\"name\":\"DustinAbbot\",\"address\":\"dustina@8qzvrj.onmicrosoft.com\"}}],\"ccRecipients\":[],\"bccRecipients\":[],\"replyTo\":[],\"flag\":{\"flagStatus\":\"notFlagged\"},\"attachments\":[{\"@odata.type\":\"#microsoft.graph.itemAttachment\",\"id\":\"AAMkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4NWRlZDA2Y2UxOABGAAAAAAAPvVwUramXT7jlSGpVU8_7BwB8wYc0thTTTYl3RpEYIUq_AAAAAAEMAAB8wYc0thTTTYl3RpEYIUq_AADFfThQAAABEgAQAMl2d2fzwp5Fg-M5x1BbmoQ=\",\"lastModifiedDateTime\":\"2023-02-02T03:50:45Z\",\"name\":\"Refactor\",\"contentType\":null,\"size\":54919,\"isInline\":false,\"item@odata.associationLink\":\"https://graph.microsoft.com/v1.0/users('f435c656-f8b2-4d71-93c3-6e092f52a167')/messages('')/$ref\",\"item@odata.navigationLink\":\"https://graph.microsoft.com/v1.0/users('f435c656-f8b2-4d71-93c3-6e092f52a167')/messages('')\",\"item\":{\"@odata.type\":\"#microsoft.graph.message\",\"id\":\"\",\"createdDateTime\":\"2023-02-02T03:50:45Z\",\"lastModifiedDateTime\":\"2023-02-02T03:50:45Z\",\"receivedDateTime\":\"2022-09-23T18:13:05Z\",\"sentDateTime\":\"2022-09-23T18:13:02Z\",\"hasAttachments\":false,\"internetMessageId\":\"<65ceafcd-05cd-413f-9bc3-0a106c0198c7@SJ0PR17MB5622.namprd17.prod.outlook.com>\",\"subject\":\"Undeliverable:Refactor\",\"bodyPreview\":\"Deliveryhasfailedtotheserecipientsorgroups:\\r\\n\\r\\nJoniS@8qzvrj.onmicrosoft.com\\r\\nYourmessagewasn'tdeliveredbecausetherecipient'semailproviderrejectedit.\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\nDiagnosticinformationforadministrators:\\r\\n\\r\\nGeneratingserver:SJ0PR17\",\"importance\":\"normal\",\"conversationId\":\"AAQkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4NWRlZDA2Y2UxOAAQAPfztRdG_MdNgCGWLnpaLxw=\",\"conversationIndex\":\"AQHYz3gf9/O1F0b4x02AIZYuelovHA==\",\"isReadReceiptRequested\":false,\"isRead\":true,\"isDraft\":false,\"webLink\":\"https://outlook.office365.com/owa/?AttachmentItemID=AAMkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4NWRlZDA2Y2UxOABGAAAAAAAPvVwUramXT7jlSGpVU8%2B7BwB8wYc0thTTTYl3RpEYIUq%2BAAAAAAEMAAB8wYc0thTTTYl3RpEYIUq%2BAADFfThQAAABEgAQAMl2d2fzwp5Fg%2FM5x1BbmoQ%3D&exvsurl=1&viewmodel=ItemAttachment\",\"internetMessageHeaders\":[{\"name\":\"Received\",\"value\":\"fromSJ0PR17MB4335.namprd17.prod.outlook.com(::1)bySJ0PR17MB5622.namprd17.prod.outlook.comwithHTTPS;Fri,23Sep202218:13:03+0000\"},{\"name\":\"Received\",\"value\":\"fromSJ0PR17MB5622.namprd17.prod.outlook.com(2603:10b6:a03:392::20)bySJ0PR17MB4335.namprd17.prod.outlook.com(2603:10b6:a03:2a2::20)withMicrosoftSMTPServer(version=TLS1_2,cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384)id15.20.5654.20;Fri,23Sep202218:13:02+0000\"},{\"name\":\"Authentication-Results\",\"value\":\"dkim=none(messagenotsigned)header.d=none;dmarc=noneaction=noneheader.from=8qzvrj.onmicrosoft.com;\"},{\"name\":\"MIME-Version\",\"value\":\"1.0\"},{\"name\":\"From\",\"value\":\"\\\"MicrosoftOutlook\\\"\"},{\"name\":\"To\",\"value\":\"\"},{\"name\":\"Date\",\"value\":\"Fri,23Sep202218:13:02+0000\"},{\"name\":\"Content-Type\",\"value\":\"multipart/report\"},{\"name\":\"X-MS-Exchange-Organization-SCL\",\"value\":\"-1\"},{\"name\":\"Content-Language\",\"value\":\"en-US\"},{\"name\":\"Message-ID\",\"value\":\"<65ceafcd-05cd-413f-9bc3-0a106c0198c7@SJ0PR17MB5622.namprd17.prod.outlook.com>\"},{\"name\":\"Subject\",\"value\":\"Undeliverable:Refactor\"},{\"name\":\"Auto-Submitted\",\"value\":\"auto-replied\"},{\"name\":\"X-MS-Exchange-Organization-AuthSource\",\"value\":\"SJ0PR17MB5622.namprd17.prod.outlook.com\"},{\"name\":\"X-MS-Exchange-Organization-AuthAs\",\"value\":\"Internal\"},{\"name\":\"X-MS-Exchange-Organization-AuthMechanism\",\"value\":\"05\"},{\"name\":\"X-MS-Exchange-Organization-Network-Message-Id\",\"value\":\"d9b0c65c-e9a8-44cd-793d-08da9d8f40f2\"},{\"name\":\"Return-Path\",\"value\":\"<>\"},{\"name\":\"X-MS-Exchange-Organization-ExpirationStartTime\",\"value\":\"23Sep202218:13:02.3424(UTC)\"},{\"name\":\"X-MS-Exchange-Organization-ExpirationStartTimeReason\",\"value\":\"OriginalSubmit\"},{\"name\":\"X-MS-Exchange-Organization-ExpirationInterval\",\"value\":\"1:00:00:00.0000000\"},{\"name\":\"X-MS-Exchange-Organization-ExpirationIntervalReason\",\"value\":\"OriginalSubmit\"},{\"name\":\"X-MS-Exchange-Organization-MessageDirectionality\",\"value\":\"Originating\"},{\"name\":\"X-MS-Office365-Filtering-Correlation-Id\",\"value\":\"d9b0c65c-e9a8-44cd-793d-08da9d8f40f2\"},{\"name\":\"X-MS-PublicTrafficType\",\"value\":\"Email\"},{\"name\":\"X-MS-TrafficTypeDiagnostic\",\"value\":\"SJ0PR17MB4335:EE_\"},{\"name\":\"X-Microsoft-Antispam\",\"value\":\"BCL:0;\"},{\"name\":\"X-Forefront-Antispam-Report\",\"value\":\"CIP:255.255.255.255;CTRY:;LANG:en;SCL:-1;SRV:;IPV:NLI;SFV:SKI;H:SJ0PR17MB5622.namprd17.prod.outlook.com;PTR:;CAT:NONE;SFS:;DIR:INB;\"},{\"name\":\"X-MS-Exchange-CrossTenant-OriginalArrivalTime\",\"value\":\"23Sep202218:13:02.1863(UTC)\"},{\"name\":\"X-MS-Exchange-CrossTenant-FromEntityHeader\",\"value\":\"Hosted\"},{\"name\":\"X-MS-Exchange-CrossTenant-AuthSource\",\"value\":\"SJ0PR17MB5622.namprd17.prod.outlook.com\"},{\"name\":\"X-MS-Exchange-CrossTenant-AuthAs\",\"value\":\"Internal\"},{\"name\":\"X-MS-Exchange-CrossTenant-Network-Message-Id\",\"value\":\"d9b0c65c-e9a8-44cd-793d-08da9d8f40f2\"},{\"name\":\"X-MS-Exchange-CrossTenant-Id\",\"value\":\"4d603060-18d6-4764-b9be-4cb794d32b69\"},{\"name\":\"X-MS-Exchange-Transport-CrossTenantHeadersStamped\",\"value\":\"SJ0PR17MB4335\"},{\"name\":\"X-MS-Exchange-Transport-EndToEndLatency\",\"value\":\"00:00:01.7979308\"},{\"name\":\"X-MS-Exchange-Processed-By-BccFoldering\",\"value\":\"15.20.5654.020\"},{\"name\":\"X-Microsoft-Antispam-Mailbox-Delivery\",\"value\":\"ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(4710097)(4711095)(920097)(425001)(930097);\"},{\"name\":\"X-Microsoft-Antispam-Message-Info\",\"value\":\"OtazeeZYzto+ScfvQuPPDZ2U425kuGb+xfZvAgGC8p38mFp/gjE9S7/6s/Ws/rs3II/74t4RtYQ5QmQQO6uznWpRKU8UZXg/Q+NcWqNRtSaddbG4h8DO5SluZFNoZlRE5QAPYK4h7mOoadTOFrlWPWFNoxLoA9cC+ap4+ifXd8HxXuXTSKvWsnY2o4t8PlL7UAsWz+bGmbJRg/tYoPaNkizPJl8E6mVFxNuFZ7C69hU2uHAA1C/v8f+HgAZjYAr8vC8hXK/EGIPLRRm0vP3FBwTp+LxjkH+KTJ/rrpsBd+redIIpmkXHv9rKcpnaECiALOlSNRuVmiXfa9wVO/PVyFnxiz/VSl7DtvDS6URRnhjw1Re7AnszfgaDNqcdK2uLeSCv8CBQ9A6+cD0X+tA4Qnqm73XavXqzi2APl/uqgR5J8kecViSto5wat7cFzvL8wsNXcNKiLcwo/eOMmvp0NX+RzR95W6ftRb0aK87nPqvALJ1h0jz5/7DCIxeBZLm/d8qoCNCAy0d+kwT30U8u8Yp4QBRHifS3ZKPHuBx9SfWaYrusUGK/E5OBtW647BSG/HVcE1ByHepczgeMWvRedpKyojQSeJBkhuAX0C0NeeOFRWiddfERmnRbdxEYqqZjkEOhjCuqdV5fASj7JszNpIpZ+gJGo4LtSXJUgbRty71YUh7vX3BIctdIFrzA1BJ3MzvhU+fqtXo9QrwvKhn6s5Z2Z3ffsdHFJ9JefE8huzVlhM0EuYcqDk+5yVnCTCzK/fkDTbxXMePCmVLL15Be1lzhkB5iOJzslAEL+mrtIW/N2lb1La2xtlR6poZZB/xRBoTGtnNmB7aeFClqm7QCSif1h3DHBnGnoLMRQ7UjWp5XSvH4UBUKlcScFIvC6LPz\"}],\"body\":{\"contentType\":\"html\",\"content\":\"\\r\\n

Deliveryhasfailedtotheserecipientsorgroups:

JoniS@8qzvrj.onmicrosoft.com
Yourmessagewasn'tdeliveredbecausetherecipient'semailproviderrejectedit.







Diagnosticinformationforadministrators:

Generatingserver:SJ0PR17MB5622.namprd17.prod.outlook.com

JoniS@8qzvrj.onmicrosoft.com
RemoteServerreturned'5505.7.708Serviceunavailable.Accessdenied,trafficnotacceptedfromthisIP.Formoreinformationpleasegotohttp://go.microsoft.com/fwlink/?LinkId=526653AS(7230)[SJ0PR17MB4335.namprd17.prod.outlook.com]'

Originalmessageheaders:

Received:fromSJ0PR17MB5622.namprd17.prod.outlook.com\\r\\n([fe80::d5cf:6dae:9970:c56f])bySJ0PR17MB5622.namprd17.prod.outlook.com\\r\\n([fe80::d5cf:6dae:9970:c56f%7])withmapiid15.20.5654.020;Fri,23Sep2022\\r\\n18:13:02+0000\\r\\nMIME-Version:1.0\\r\\nContent-Type:text/plain\\r\\nDate:Fri,23Sep202218:13:02+0000\\r\\nMessage-ID:\\r\\n\\t\\r\\nSubject:Refactor\\r\\n
\"},\"sender\":{\"emailAddress\":{\"name\":\"MicrosoftOutlook\",\"address\":\"MicrosoftExchange329e71ec88ae4615bbc36ab6ce41109e@8qzvrj.onmicrosoft.com\"}},\"from\":{\"emailAddress\":{\"name\":\"MicrosoftOutlook\",\"address\":\"MicrosoftExchange329e71ec88ae4615bbc36ab6ce41109e@8qzvrj.onmicrosoft.com\"}},\"toRecipients\":[{\"emailAddress\":{\"name\":\"JoniSherman\",\"address\":\"JoniS@8qzvrj.onmicrosoft.com\"}}],\"flag\":{\"flagStatus\":\"notFlagged\"},\"attachments\":[{\"@odata.type\":\"#microsoft.graph.itemAttachment\",\"id\":\"AAMkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4NWRlZDA2Y2UxOABGAAAAAAAPvVwUramXT7jlSGpVU8_7BwB8wYc0thTTTYl3RpEYIUq_AAAAAAEMAAB8wYc0thTTTYl3RpEYIUq_AADFfThQAAACEgAQAMl2d2fzwp5Fg-M5x1BbmoQSABAAXxD6E7XvOEa2Sawpnno1LA==\",\"lastModifiedDateTime\":\"2023-02-02T03:50:45Z\",\"name\":\"Refactor\",\"contentType\":\"message/rfc822\",\"size\":2884,\"isInline\":false,\"item@odata.associationLink\":\"https://graph.microsoft.com/v1.0/users('f435c656-f8b2-4d71-93c3-6e092f52a167')/messages('')/$ref\",\"item@odata.navigationLink\":\"https://graph.microsoft.com/v1.0/users('f435c656-f8b2-4d71-93c3-6e092f52a167')/messages('')\",\"item\":{\"@odata.type\":\"#microsoft.graph.message\",\"id\":\"\",\"createdDateTime\":\"2023-02-02T03:50:45Z\",\"lastModifiedDateTime\":\"2023-02-02T03:50:45Z\",\"receivedDateTime\":\"2022-09-23T18:13:02Z\",\"sentDateTime\":\"2022-09-23T18:13:02Z\",\"hasAttachments\":false,\"internetMessageId\":\"\",\"subject\":\"Refactor\",\"conversationId\":\"AAQkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4NWRlZDA2Y2UxOAAQAFNSce2z0XclfJ0zHmBdxBY=\",\"conversationIndex\":\"AQHYz3gfefdV23+O30a2vOs4JSP4PA==\",\"isReadReceiptRequested\":false,\"isRead\":true,\"isDraft\":false,\"webLink\":\"https://outlook.office365.com/owa/?AttachmentItemID=AAMkAGQ1NzViZTdhLTEwMTMtNGJjNi05YWI2LTg4NWRlZDA2Y2UxOABGAAAAAAAPvVwUramXT7jlSGpVU8%2B7BwB8wYc0thTTTYl3RpEYIUq%2BAAAAAAEMAAB8wYc0thTTTYl3RpEYIUq%2BAADFfThQAAACEgAQAMl2d2fzwp5Fg%2FM5x1BbmoQSABAAXxD6E7XvOEa2Sawpnno1LA%3D%3D&exvsurl=1&viewmodel=ItemAttachment\",\"internetMessageHeaders\":[{\"name\":\"Received\",\"value\":\"fromSJ0PR17MB5622.namprd17.prod.outlook.com([fe80::d5cf:6dae:9970:c56f])bySJ0PR17MB5622.namprd17.prod.outlook.com([fe80::d5cf:6dae:9970:c56f%7])withmapiid15.20.5654.020;Fri,23Sep202218:13:02+0000\"},{\"name\":\"MIME-Version\",\"value\":\"1.0\"},{\"name\":\"Content-Type\",\"value\":\"text/plain\"},{\"name\":\"Date\",\"value\":\"Fri,23Sep202218:13:02+0000\"},{\"name\":\"Message-ID\",\"value\":\"\"},{\"name\":\"Subject\",\"value\":\"Refactor\"}],\"body\":{\"contentType\":\"text\",\"content\":\"\"},\"flag\":{\"flagStatus\":\"notFlagged\"}}}]}}]}" + + return []byte(message) +}