2022-10-06 11:00:09 +00:00
|
|
|
Feature: SMTP wrong messages
|
|
|
|
Background:
|
2022-12-13 02:48:54 +00:00
|
|
|
Given there exists an account with username "[user:user]" and password "password"
|
2023-11-22 12:52:00 +00:00
|
|
|
And the account "[user:user]" has additional disabled address "[user:disabled]@[domain]"
|
2022-12-13 02:48:54 +00:00
|
|
|
And there exists an account with username "[user:to]" and password "password"
|
2023-05-22 11:16:56 +00:00
|
|
|
Then it succeeds
|
|
|
|
When bridge starts
|
2022-12-13 02:48:54 +00:00
|
|
|
And the user logs in with username "[user:user]" and password "password"
|
|
|
|
And user "[user:user]" connects and authenticates SMTP client "1"
|
2023-05-22 11:16:56 +00:00
|
|
|
Then it succeeds
|
2022-10-06 11:00:09 +00:00
|
|
|
|
|
|
|
Scenario: Message with attachment and wrong boundaries
|
2022-12-13 02:48:54 +00:00
|
|
|
When SMTP client "1" sends the following message from "[user:user]@[domain]" to "[user:to]@[domain]":
|
2022-10-06 11:00:09 +00:00
|
|
|
"""
|
2022-12-13 02:48:54 +00:00
|
|
|
From: Bridge Test <[user:user]@[domain]>
|
|
|
|
To: Internal Bridge <[user:to]@[domain]>
|
2022-10-06 11:00:09 +00:00
|
|
|
Subject: With attachment (wrong boundaries)
|
|
|
|
Content-Type: multipart/related; boundary=bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606
|
|
|
|
|
|
|
|
--bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606
|
|
|
|
Content-Disposition: inline
|
|
|
|
Content-Transfer-Encoding: quoted-printable
|
|
|
|
Content-Type: text/plain; charset=utf-8
|
|
|
|
|
|
|
|
This is body of mail with attachment
|
|
|
|
|
|
|
|
--bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606
|
|
|
|
Content-Disposition: attachment; filename=outline-light-instagram-48.png
|
|
|
|
Content-Id: <9114fe6f0adfaf7fdf7a@protonmail.com>
|
|
|
|
Content-Transfer-Encoding: base64
|
|
|
|
Content-Type: image/png
|
|
|
|
|
2024-01-15 13:10:22 +00:00
|
|
|
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQot
|
|
|
|
tAAAAABJRU5ErkJggg==
|
2022-10-06 11:00:09 +00:00
|
|
|
--bc5bd30245232f31b6c976adcd59bb0069c9b13f986f9e40c2571bb80aa16606
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
Then it fails
|
|
|
|
|
|
|
|
Scenario: Invalid from
|
2022-12-13 02:48:54 +00:00
|
|
|
When SMTP client "1" sends the following message from "unowned@[domain]" to "[user:to]@[domain]":
|
2022-10-06 11:00:09 +00:00
|
|
|
"""
|
2022-12-13 02:48:54 +00:00
|
|
|
From: Bridge Test <unowned@[domain]>
|
|
|
|
To: Internal Bridge <[user:to]@[domain]>
|
2022-10-06 11:00:09 +00:00
|
|
|
|
|
|
|
hello
|
|
|
|
|
|
|
|
"""
|
2023-11-22 12:52:00 +00:00
|
|
|
Then it fails with error "invalid return path"
|
|
|
|
|
2024-01-15 13:10:22 +00:00
|
|
|
Scenario: Send from a valid address that cannot send
|
|
|
|
When SMTP client "1" sends the following message from "[user:disabled]@[domain]" to "[user:to]@[domain]":
|
|
|
|
"""
|
|
|
|
From: Bridge Test Disabled <[user:disabled]@[domain]>
|
|
|
|
To: Internal Bridge <[user:to]@[domain]>
|
2023-11-22 12:52:00 +00:00
|
|
|
|
2024-01-15 13:10:22 +00:00
|
|
|
Hello
|
|
|
|
"""
|
|
|
|
And it fails with error "Error: can't send on address: [user:disabled]@[domain]"
|