mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2026-02-14 04:48:32 +00:00
Other: Disable perma-delete for expunge on Spam folder
This commit is contained in:
@ -326,7 +326,7 @@ func (conn *imapConnector) RemoveMessagesFromMailbox(ctx context.Context, messag
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if mailboxID == proton.SpamLabel || mailboxID == proton.TrashLabel || mailboxID == proton.DraftsLabel {
|
if mailboxID == proton.TrashLabel || mailboxID == proton.DraftsLabel {
|
||||||
var metadata []proton.MessageMetadata
|
var metadata []proton.MessageMetadata
|
||||||
|
|
||||||
// There's currently no limit on how many IDs we can filter on,
|
// There's currently no limit on how many IDs we can filter on,
|
||||||
|
|||||||
@ -6,8 +6,8 @@ Feature: IMAP remove messages from Trash
|
|||||||
| mbox | folder |
|
| mbox | folder |
|
||||||
| label | label |
|
| label | label |
|
||||||
|
|
||||||
Scenario Outline: Message in Trash or Spam and some other label is not permanently deleted
|
Scenario Outline: Message in Trash and some other label is not permanently deleted
|
||||||
Given the address "user@pm.me" of account "user@pm.me" has the following messages in "<mailbox>":
|
Given the address "user@pm.me" of account "user@pm.me" has the following messages in "Trash":
|
||||||
| from | to | subject | body |
|
| from | to | subject | body |
|
||||||
| john.doe@mail.com | user@pm.me | foo | hello |
|
| john.doe@mail.com | user@pm.me | foo | hello |
|
||||||
| jane.doe@mail.com | name@pm.me | bar | world |
|
| jane.doe@mail.com | name@pm.me | bar | world |
|
||||||
@ -15,27 +15,22 @@ Feature: IMAP remove messages from Trash
|
|||||||
And the user logs in with username "user@pm.me" and password "password"
|
And the user logs in with username "user@pm.me" and password "password"
|
||||||
And user "user@pm.me" finishes syncing
|
And user "user@pm.me" finishes syncing
|
||||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||||
And IMAP client "1" selects "<mailbox>"
|
And IMAP client "1" selects "Trash"
|
||||||
When IMAP client "1" copies the message with subject "foo" from "<mailbox>" to "Labels/label"
|
When IMAP client "1" copies the message with subject "foo" from "Trash" to "Labels/label"
|
||||||
Then it succeeds
|
Then it succeeds
|
||||||
When IMAP client "1" marks the message with subject "foo" as deleted
|
When IMAP client "1" marks the message with subject "foo" as deleted
|
||||||
Then it succeeds
|
Then it succeeds
|
||||||
And IMAP client "1" sees 2 messages in "<mailbox>"
|
And IMAP client "1" sees 2 messages in "Trash"
|
||||||
And IMAP client "1" sees 2 messages in "All Mail"
|
And IMAP client "1" sees 2 messages in "All Mail"
|
||||||
And IMAP client "1" sees 1 messages in "Labels/label"
|
And IMAP client "1" sees 1 messages in "Labels/label"
|
||||||
When IMAP client "1" expunges
|
When IMAP client "1" expunges
|
||||||
Then it succeeds
|
Then it succeeds
|
||||||
And IMAP client "1" sees 1 messages in "<mailbox>"
|
And IMAP client "1" sees 1 messages in "Trash"
|
||||||
And IMAP client "1" sees 2 messages in "All Mail"
|
And IMAP client "1" sees 2 messages in "All Mail"
|
||||||
And IMAP client "1" sees 1 messages in "Labels/label"
|
And IMAP client "1" sees 1 messages in "Labels/label"
|
||||||
|
|
||||||
Examples:
|
Scenario Outline: Message in Trash only is permanently deleted
|
||||||
| mailbox |
|
Given the address "user@pm.me" of account "user@pm.me" has the following messages in "Trash":
|
||||||
| Spam |
|
|
||||||
| Trash |
|
|
||||||
|
|
||||||
Scenario Outline: Message in Trash or Spam only is permanently deleted
|
|
||||||
Given the address "user@pm.me" of account "user@pm.me" has the following messages in "<mailbox>":
|
|
||||||
| from | to | subject | body |
|
| from | to | subject | body |
|
||||||
| john.doe@mail.com | user@pm.me | foo | hello |
|
| john.doe@mail.com | user@pm.me | foo | hello |
|
||||||
| jane.doe@mail.com | name@pm.me | bar | world |
|
| jane.doe@mail.com | name@pm.me | bar | world |
|
||||||
@ -43,17 +38,12 @@ Feature: IMAP remove messages from Trash
|
|||||||
And the user logs in with username "user@pm.me" and password "password"
|
And the user logs in with username "user@pm.me" and password "password"
|
||||||
And user "user@pm.me" finishes syncing
|
And user "user@pm.me" finishes syncing
|
||||||
And user "user@pm.me" connects and authenticates IMAP client "1"
|
And user "user@pm.me" connects and authenticates IMAP client "1"
|
||||||
And IMAP client "1" selects "<mailbox>"
|
And IMAP client "1" selects "Trash"
|
||||||
When IMAP client "1" marks the message with subject "foo" as deleted
|
When IMAP client "1" marks the message with subject "foo" as deleted
|
||||||
Then it succeeds
|
Then it succeeds
|
||||||
And IMAP client "1" sees 2 messages in "<mailbox>"
|
And IMAP client "1" sees 2 messages in "Trash"
|
||||||
And IMAP client "1" sees 2 messages in "All Mail"
|
And IMAP client "1" sees 2 messages in "All Mail"
|
||||||
When IMAP client "1" expunges
|
When IMAP client "1" expunges
|
||||||
Then it succeeds
|
Then it succeeds
|
||||||
And IMAP client "1" sees 1 messages in "<mailbox>"
|
And IMAP client "1" sees 1 messages in "Trash"
|
||||||
And IMAP client "1" eventually sees 1 messages in "All Mail"
|
And IMAP client "1" eventually sees 1 messages in "All Mail"
|
||||||
|
|
||||||
Examples:
|
|
||||||
| mailbox |
|
|
||||||
| Spam |
|
|
||||||
| Trash |
|
|
||||||
|
|||||||
Reference in New Issue
Block a user