GODT-1817: Restore missing SMTP feature tests

Requires update to GPA to set disabled state on addresses.
This commit is contained in:
Leander Beernaert
2023-01-09 14:04:04 +01:00
parent 2562d1e77d
commit 0dcd4ca133
8 changed files with 160 additions and 239 deletions

View File

@ -1,65 +0,0 @@
Feature: SMTP auth
Scenario: Ask EHLO
Given there is connected user "user"
When SMTP client sends "EHLO example.com"
Then SMTP response is "OK"
Scenario: Authenticates successfully and EHLO successfully
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "EHLO example.com"
Then SMTP response is "OK"
Scenario: Authenticates with bad password
Given there is connected user "user"
When SMTP client authenticates "user" with bad password
Then SMTP response is "SMTP error: 454 4.7.0 backend/credentials: incorrect password"
Scenario: Authenticates with disconnected user
Given there is disconnected user "user"
When SMTP client authenticates "user"
Then SMTP response is "SMTP error: 454 4.7.0 account is logged out, use the app to login again"
Scenario: Authenticates with no user
When SMTP client authenticates with username "user@pm.me" and password "bridgepassword"
Then SMTP response is "SMTP error: 454 4.7.0 user user@pm.me not found"
Scenario: Authenticates with capital letter
Given there is connected user "userAddressWithCapitalLetter"
When SMTP client authenticates "userAddressWithCapitalLetter"
Then SMTP response is "OK"
Scenario: Authenticates with more addresses - primary one
Given there is connected user "userMoreAddresses"
When SMTP client authenticates "userMoreAddresses" with address "primary"
Then SMTP response is "OK"
Scenario: Authenticates with more addresses - secondary one
Given there is connected user "userMoreAddresses"
When SMTP client authenticates "userMoreAddresses" with address "secondary"
Then SMTP response is "OK"
Scenario: Authenticates with more addresses - disabled address
Given there is connected user "userMoreAddresses"
When SMTP client authenticates "userMoreAddresses" with address "disabled"
Then SMTP response is "SMTP error: 454 4.7.0 user .* not found"
@ignore-live
Scenario: Authenticates with secondary address of account with disabled primary address
Given there is connected user "userDisabledPrimaryAddress"
When SMTP client authenticates "userDisabledPrimaryAddress" with address "secondary"
Then SMTP response is "OK"
Scenario: Authenticates two users
Given there is connected user "user"
And there is connected user "userMoreAddresses"
When SMTP client "smtp1" authenticates "user"
Then SMTP response to "smtp1" is "OK"
When SMTP client "smtp2" authenticates "userMoreAddresses" with address "primary"
Then SMTP response to "smtp2" is "OK"
Scenario: Logs out user
Given there is connected user "user"
When SMTP client logs out
Then SMTP response is "OK"

View File

@ -1,90 +0,0 @@
Feature: SMTP initiation
Scenario: Empty FROM
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "MAIL FROM:<>"
Then SMTP response is "OK"
Scenario: Send without FROM and TO
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "DATA"
Then SMTP response is "SMTP error: 502 5.5.1 Missing RCPT TO command."
Scenario: Reset is the same as without FROM and TO
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "MAIL FROM:<[userAddress]>"
Then SMTP response is "OK"
When SMTP client sends "RCPT TO:<user@pm.me>"
Then SMTP response is "OK"
When SMTP client sends "RSET"
Then SMTP response is "OK"
When SMTP client sends "DATA"
Then SMTP response is "SMTP error: 502 5.5.1 Missing RCPT TO command"
Scenario: Send without FROM
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "RCPT TO:<user@pm.me>"
Then SMTP response is "SMTP error: 502 5.5.1 Missing MAIL FROM command."
Scenario: Send without TO
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "MAIL FROM:<[userAddress]>"
Then SMTP response is "OK"
When SMTP client sends "DATA"
Then SMTP response is "SMTP error: 502 5.5.1 Missing RCPT TO command."
Scenario: Send with empty FROM
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "MAIL FROM:<>"
Then SMTP response is "OK"
When SMTP client sends "RCPT TO:<user@pm.me>"
Then SMTP response is "OK"
When SMTP client sends "DATA"
Then SMTP response is "OK"
When SMTP client sends "hello\r\n."
Then SMTP response is "SMTP error: 554 5.0.0 Error: transaction failed, blame it on the weather: missing return path"
Scenario: Send with empty TO
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "MAIL FROM:<[userAddress]>"
Then SMTP response is "OK"
When SMTP client sends "RCPT TO:<>"
Then SMTP response is "OK"
When SMTP client sends "DATA"
Then SMTP response is "OK"
When SMTP client sends "hello\r\n."
Then SMTP response is "SMTP error: 554 5.0.0 Error: transaction failed, blame it on the weather: missing recipient"
Scenario: Allow BODY parameter of MAIL FROM command
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "MAIL FROM:<[userAddress]> BODY=7BIT"
Then SMTP response is "OK"
Scenario: Allow AUTH parameter of MAIL FROM command
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "MAIL FROM:<[userAddress]> AUTH=<>"
Then SMTP response is "OK"
Scenario: FROM not owned by user
Given there is connected user "user"
When SMTP client authenticates "user"
Then SMTP response is "OK"
When SMTP client sends "MAIL FROM:<user@pm.test>"
Then SMTP response is "SMTP error: 451 4.0.0 backend: invalid return path: not owned by user"