mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 05:06:51 +00:00
Integration test of sending and manual appending to Sent mailbox
This commit is contained in:
50
test/features/bridge/smtp/send/send_append.feature
Normal file
50
test/features/bridge/smtp/send/send_append.feature
Normal file
@ -0,0 +1,50 @@
|
||||
Feature: SMTP sending with APPENDing to Sent
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "Sent"
|
||||
And there is SMTP client logged in as "user"
|
||||
|
||||
Scenario: Send message and append to Sent
|
||||
# First do sending.
|
||||
When SMTP client sends message
|
||||
"""
|
||||
To: Internal Bridge <bridgetest@protonmail.com>
|
||||
Subject: Manual send and append
|
||||
Message-ID: bridgemessage42
|
||||
|
||||
hello
|
||||
|
||||
"""
|
||||
Then SMTP response is "OK"
|
||||
And mailbox "Sent" for "user" has 1 messages
|
||||
And mailbox "Sent" for "user" has messages
|
||||
| externalid | from | to | subject |
|
||||
| bridgemessage42 | [userAddress] | bridgetest@protonmail.com | Manual send and append |
|
||||
And message is sent with API call:
|
||||
"""
|
||||
{
|
||||
"Message": {
|
||||
"Subject": "Manual send and append",
|
||||
"ExternalID": "bridgemessage42"
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
# Then simulate manual append to Sent mailbox - message should be detected as a duplicate.
|
||||
When IMAP client imports message to "Sent"
|
||||
"""
|
||||
To: Internal Bridge <bridgetest@protonmail.com>
|
||||
Subject: Manual send and append
|
||||
Message-ID: bridgemessage42
|
||||
|
||||
hello
|
||||
|
||||
"""
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "Sent" for "user" has 1 messages
|
||||
|
||||
# Check that the external ID was not lost in the process.
|
||||
When IMAP client sends command "FETCH 1 body.peek[header]"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response contains "bridgemessage42"
|
||||
@ -211,6 +211,10 @@ func messagesContainsMessageRow(account *accounts.TestAccount, allMessages []int
|
||||
if message.ID != id {
|
||||
matches = false
|
||||
}
|
||||
case "externalid":
|
||||
if message.ExternalID != cell.Value {
|
||||
matches = false
|
||||
}
|
||||
case "from": //nolint[goconst]
|
||||
address := ctx.EnsureAddress(account.Username(), cell.Value)
|
||||
if !areAddressesSame(message.Sender.Address, address) {
|
||||
|
||||
Reference in New Issue
Block a user