From 5823e3a99ff4986a64bf210144d721f111372c51 Mon Sep 17 00:00:00 2001 From: Gjorgji Slamkov Date: Wed, 25 Oct 2023 11:39:16 +0000 Subject: [PATCH] test(GODT-2723): Add importing a message with remote content --- tests/features/imap/message/import.feature | 81 ++++++++++++++++ tests/features/smtp/send/html.feature | 105 +++++++++++++++++++++ 2 files changed, 186 insertions(+) diff --git a/tests/features/imap/message/import.feature b/tests/features/imap/message/import.feature index 69e0150b..82b8e463 100644 --- a/tests/features/imap/message/import.feature +++ b/tests/features/imap/message/import.feature @@ -377,3 +377,84 @@ Feature: IMAP import messages } } """ + + @regression + Scenario: Import message with remote content + When IMAP client "1" appends the following message to "Inbox": + """ + Date: 01 Jan 1980 00:00:00 +0000 + To: Bridge Test + From: Bridge Second Test + Subject: MESSAGE WITH REMOTE CONTENT + Content-Type: multipart/alternative; + boundary="------------vUMV7TiM65KWBg30p6OgD3Vp" + + This is a multi-part message in MIME format. + --------------vUMV7TiM65KWBg30p6OgD3Vp + Content-Type: text/plain; charset=utf-8; format=flowed + Content-Transfer-Encoding: 7bit + + Remote content + + + Bridge + + + Remote content + + + --------------vUMV7TiM65KWBg30p6OgD3Vp + Content-Type: text/html; charset=utf-8 + Content-Transfer-Encoding: 7bit + + + + + + + + +

Remote content

+


+

+

Bridge

+


+

+

Remote content
+

+
+ + + + --------------vUMV7TiM65KWBg30p6OgD3Vp-- + + """ + Then it succeeds + And IMAP client "1" eventually sees the following message in "Inbox" with this structure: + """ + { + "date": "01 Jan 80 00:00 +0000", + "to": "Bridge Test ", + "from": "Bridge Second Test ", + "subject": "MESSAGE WITH REMOTE CONTENT", + "content": { + "content-type": "multipart/alternative", + "sections":[ + { + "content-type": "text/plain", + "content-type-charset": "utf-8", + "transfer-encoding": "7bit", + "body-is": "Remote content\n\n\nBridge\n\n\nRemote content" + }, + { + "content-type": "text/html", + "content-type-charset": "utf-8", + "transfer-encoding": "7bit", + "body-is": "\n\n \n\n \n \n \n

Remote content

\n


\n

\n

\n


\n

\n

Remote content
\n

\n
\n \n" + } + ] + } + } + """ diff --git a/tests/features/smtp/send/html.feature b/tests/features/smtp/send/html.feature index e18255e5..663b61f9 100644 --- a/tests/features/smtp/send/html.feature +++ b/tests/features/smtp/send/html.feature @@ -124,6 +124,39 @@ Feature: SMTP sending of plain messages } } """ + And IMAP client "1" eventually sees the following message in "Sent" with this structure: + """ + { + "date": "01 Jan 01 00:00 +0000", + "to": "External Bridge ", + "from": "Bridge Test <[user:user]@[domain]>", + "subject": "Html Inline External", + "content": { + "content-type": "multipart/mixed", + "sections":[ + { + "content-type": "multipart/related", + "sections":[ + { + "content-type": "text/html", + "content-type-charset": "utf-8", + "transfer-encoding": "quoted-printable", + "body-is": "\r\n\r\n\r\n\r\n


\r\n

\r\n

Behold! An inline 3D\"\"
\r\n

\r\n\r\n\r\n" + }, + { + "content-type": "image/gif", + "content-type-name": "email-action-left.gif", + "content-disposition": "inline", + "content-disposition-filename": "email-action-left.gif", + "transfer-encoding": "base64", + "body-is": "R0lGODlhGAAYANUAACcsKOHs4kppTH6tgYWxiIq0jTVENpG5lDI/M7bRuEaJSkqOTk2RUU+PU16l\r\nYl+lY2iva262cXS6d3rDfYLNhWeeamKTZGSVZkNbRGqhbOPt4////+7u7qioqFZWVlNTUyIiIgAA\r\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAGAAYAAAG/8CNcLjRJAqVRqNS\r\nSGiI0GFgoKhar4NAdHioMhyRCYUyiTgY1cOWUH1ILgIDAGAQXCSPKgHaXUAyGCCCg4IYGRALCmpC\r\nAVUQFgiEkiAIFhBVWhtUDxmRk5IIGXkDRQoMEoGfHpIYEmhGCg4XnyAdHB+SFw4KRwoRArQdG7eE\r\nAhEKSAoTBoIdzs/Cw7iCBhMKSQoUAIJbQ8QgABQKStnbIN1C3+HjFcrMtdDO6dMg1dcFvsCfwt+C\r\nxsgJYs3a10+QLl4aTKGitYpQq1eaFHDyREtQqFGMHEGqSMkSJi4K/ACiZQiRIihsJL6JM6fOnTwK\r\n9kTpYgqMGDJm0JzsNuWKTw0FWdANMYJECRMnW4IAADs=" + } + ] + } + ] + } + } + """ Scenario: HTML message with alternative inline to internal account When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:user2]@[domain]": @@ -375,3 +408,75 @@ Feature: SMTP sending of plain messages } } """ + + # It is expected for the structure check to look a bit different. More info on GODT-3011 + @regression + Scenario: HTML message with remote content in Body + When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]": + """ + Date: 01 Jan 1980 00:00:00 +0000 + To: Internal Bridge Test <[user:to]@[domain]> + From: Bridge Test <[user:user]@[domain]> + Subject: MESSAGE WITH REMOTE CONTENT SENT + Content-Type: multipart/alternative; + boundary="------------vUMV7TiM65KWBg30p6OgD3Vp" + + This is a multi-part message in MIME format. + --------------vUMV7TiM65KWBg30p6OgD3Vp + Content-Type: text/plain; charset=utf-8; format=flowed + Content-Transfer-Encoding: 7bit + + Remote content + + + Bridge + + + Remote content + + + --------------vUMV7TiM65KWBg30p6OgD3Vp + Content-Type: text/html; charset=utf-8 + Content-Transfer-Encoding: 7bit + + + + + + + + +

Remote content

+


+

+

Bridge

+


+

+

Remote content
+

+
+ + + + --------------vUMV7TiM65KWBg30p6OgD3Vp-- + + """ + Then it succeeds + When user "[user:user]" connects and authenticates IMAP client "1" + And IMAP client "1" eventually sees the following message in "Sent" with this structure: + """ + { + "date": "01 Jan 01 00:00 +0000", + "to": "Internal Bridge Test <[user:to]@[domain]>", + "from": "Bridge Test <[user:user]@[domain]>", + "subject": "MESSAGE WITH REMOTE CONTENT SENT", + "content": { + "content-type": "text/html", + "content-type-charset": "utf-8", + "transfer-encoding": "quoted-printable", + "body-is": "\n\n \n \n \n

Remote content

\n


\n

\n

\"Bridge\"

\n


\n

\n

Remote content
\n

\n
\n \n\n" + } + } + """