test(GODT-2723): Add importing a message with remote content

This commit is contained in:
Gjorgji Slamkov 2023-10-25 11:39:16 +00:00
parent 26d866bbbd
commit 5823e3a99f
2 changed files with 186 additions and 0 deletions

View File

@ -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 <bridge@test.com>
From: Bridge Second Test <bridge_second@test.com>
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<p><tt>Remote content</tt></p>
<p><tt><br>
</tt></p>
<p><img
src="https://bridgeteam.protontech.ch/bridgeteam/tmp/bridge.jpg"
alt="Bridge" width="180" height="180"></p>
<p><br>
</p>
<p><tt>Remote content</tt><br>
</p>
<br>
</body>
</html>
--------------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 <bridge@test.com>",
"from": "Bridge Second Test <bridge_second@test.com>",
"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": "<!DOCTYPE html>\n<html>\n <head>\n\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n </head>\n <body>\n <p><tt>Remote content</tt></p>\n <p><tt><br>\n </tt></p>\n <p><img\n src=\"https://bridgeteam.protontech.ch/bridgeteam/tmp/bridge.jpg\"\n alt=\"Bridge\" width=\"180\" height=\"180\"></p>\n <p><br>\n </p>\n <p><tt>Remote content</tt><br>\n </p>\n <br>\n </body>\n</html>"
}
]
}
}
"""

View File

@ -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 <pm.bridge.qa@gmail.com>",
"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": "<html><head>\r\n<meta http-equiv=3D\"content-type\" content=3D\"text/html; charset=3DUTF-8\"/>\r\n</head>\r\n<body text=3D\"#000000\" bgcolor=3D\"#FFFFFF\">\r\n<p><br/>\r\n</p>\r\n<p>Behold! An inline <img moz-do-not-send=3D\"false\" src=3D\"cid:part1.D96BFA=\r\nE9.E2E1CAE3@protonmail.com\" alt=3D\"\" width=3D\"24\" height=3D\"24\"/><br/>\r\n</p>\r\n\r\n\r\n</body></html>"
},
{
"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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<p><tt>Remote content</tt></p>
<p><tt><br>
</tt></p>
<p><img
src="https://bridgeteam.protontech.ch/bridgeteam/tmp/bridge.jpg"
alt="Bridge" width="180" height="180"></p>
<p><br>
</p>
<p><tt>Remote content</tt><br>
</p>
<br>
</body>
</html>
--------------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": "<!DOCTYPE html><html><head>\n\n <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/>\n </head>\n <body>\n <p><tt>Remote content</tt></p>\n <p><tt><br/>\n </tt></p>\n <p><img src=\"https://bridgeteam.protontech.ch/bridgeteam/tmp/bridge.jpg\" alt=\"Bridge\" width=\"180\" height=\"180\"/></p>\n <p><br/>\n </p>\n <p><tt>Remote content</tt><br/>\n </p>\n <br/>\n \n\n</body></html>"
}
}
"""