remove superflous auth files & shorten IMAP tests
This commit is contained in:
parent
aa6d0c5071
commit
2a477bfdd4
|
@ -1,4 +0,0 @@
|
|||
EHLO mail
|
||||
AUTH LOGIN YWRkZWRAbG9jYWxob3N0LmxvY2FsZG9tYWlu
|
||||
Bn3JKisq4HQ2RO==
|
||||
QUIT
|
|
@ -1,4 +0,0 @@
|
|||
EHLO mail
|
||||
AUTH LOGIN YWRkZWRAbG9jYWxob3N0LmxvY2FsZG9tYWlu
|
||||
bXlwYXNzd29yZA==
|
||||
QUIT
|
|
@ -1,3 +0,0 @@
|
|||
EHLO mail
|
||||
AUTH PLAIN YWRkZWRAbG9jYWxob3N0LmxvY2FsZG9tYWluAGFkZGVkQGxvY2FsaG9zdC5sb2NhbGRvbWFpbgBCQURQQVNTV09SRA==
|
||||
QUIT
|
|
@ -1,3 +0,0 @@
|
|||
EHLO mail
|
||||
AUTH PLAIN YWRkZWRAbG9jYWxob3N0LmxvY2FsZG9tYWluAGFkZGVkQGxvY2FsaG9zdC5sb2NhbGRvbWFpbgBteXBhc3N3b3Jk
|
||||
QUIT
|
|
@ -1,5 +0,0 @@
|
|||
EHLO mail
|
||||
AUTH LOGIN
|
||||
c29tZS51c2VyQGxvY2FsaG9zdC5sb2NhbGRvbWFpbg==
|
||||
c2VjcmV0
|
||||
QUIT
|
|
@ -1,4 +0,0 @@
|
|||
EHLO mail
|
||||
AUTH LOGIN dXNlcjFAbG9jYWxob3N0LmxvY2FsZG9tYWlu
|
||||
Bn3JKisq4HQ2RO==
|
||||
QUIT
|
|
@ -1,4 +0,0 @@
|
|||
EHLO mail
|
||||
AUTH LOGIN dXNlcjFAbG9jYWxob3N0LmxvY2FsZG9tYWlu
|
||||
bXlwYXNzd29yZA==
|
||||
QUIT
|
|
@ -1,3 +0,0 @@
|
|||
EHLO mail
|
||||
AUTH PLAIN WRONGPASSWORD
|
||||
QUIT
|
|
@ -1,3 +0,0 @@
|
|||
EHLO mail
|
||||
AUTH PLAIN dXNlcjFAbG9jYWxob3N0LmxvY2FsZG9tYWluAHVzZXIxQGxvY2FsaG9zdC5sb2NhbGRvbWFpbgBteXBhc3N3b3Jk
|
||||
QUIT
|
|
@ -101,6 +101,19 @@ function setup_file() {
|
|||
assert_success
|
||||
}
|
||||
|
||||
function _unsuccessful() {
|
||||
_send_email --port 465 --auth "${1}" --auth-user "${2}" --auth-password wrongpassword
|
||||
assert_failure
|
||||
assert_output --partial 'authentication failed'
|
||||
assert_output --partial 'No authentication type succeeded'
|
||||
}
|
||||
|
||||
function _successful() {
|
||||
_send_email --port 465 --auth "${1}" --auth-user "${2}" --auth-password mypassword --quit-after AUTH
|
||||
assert_success
|
||||
assert_output --partial 'Authentication successful'
|
||||
}
|
||||
|
||||
@test "should succeed at emptying mail queue" {
|
||||
# Try catch errors preventing emptying the queue ahead of waiting:
|
||||
_run_in_container mailq
|
||||
|
@ -111,44 +124,35 @@ function setup_file() {
|
|||
}
|
||||
|
||||
@test "should successfully authenticate with good password (plain)" {
|
||||
_nc_wrapper 'auth/smtp-auth-plain.txt' '-w 5 0.0.0.0 465'
|
||||
assert_output --partial 'Authentication successful'
|
||||
_successful PLAIN user1@localhost.localdomain
|
||||
}
|
||||
|
||||
@test "should fail to authenticate with wrong password (plain)" {
|
||||
_nc_wrapper 'auth/smtp-auth-plain-wrong.txt' '-w 20 0.0.0.0 465'
|
||||
assert_output --partial 'authentication failed'
|
||||
_unsuccessful PLAIN user1@localhost.localdomain
|
||||
}
|
||||
|
||||
@test "should successfully authenticate with good password (login)" {
|
||||
_nc_wrapper 'auth/smtp-auth-login.txt' '-w 5 0.0.0.0 465'
|
||||
assert_output --partial 'Authentication successful'
|
||||
_successful LOGIN user1@localhost.localdomain
|
||||
}
|
||||
|
||||
@test "should fail to authenticate with wrong password (login)" {
|
||||
_nc_wrapper 'auth/smtp-auth-login-wrong.txt' '-w 20 0.0.0.0 465'
|
||||
assert_output --partial 'authentication failed'
|
||||
_unsuccessful LOGIN user1@localhost.localdomain
|
||||
}
|
||||
|
||||
@test "[user: 'added'] should successfully authenticate with good password (plain)" {
|
||||
_nc_wrapper 'auth/added-smtp-auth-plain.txt' '-w 5 0.0.0.0 465'
|
||||
assert_output --partial 'Authentication successful'
|
||||
_successful PLAIN added@localhost.localdomain
|
||||
}
|
||||
|
||||
@test "[user: 'added'] should fail to authenticate with wrong password (plain)" {
|
||||
_nc_wrapper 'auth/added-smtp-auth-plain-wrong.txt' '-w 20 0.0.0.0 465'
|
||||
assert_output --partial 'authentication failed'
|
||||
_unsuccessful PLAIN added@localhost.localdomain
|
||||
}
|
||||
|
||||
@test "[user: 'added'] should successfully authenticate with good password (login)" {
|
||||
_nc_wrapper 'auth/added-smtp-auth-login.txt' '-w 5 0.0.0.0 465'
|
||||
assert_success
|
||||
assert_output --partial 'Authentication successful'
|
||||
_successful LOGIN added@localhost.localdomain
|
||||
}
|
||||
|
||||
@test "[user: 'added'] should fail to authenticate with wrong password (login)" {
|
||||
_nc_wrapper 'auth/added-smtp-auth-login-wrong.txt' '-w 20 0.0.0.0 465'
|
||||
assert_output --partial 'authentication failed'
|
||||
_unsuccessful LOGIN added@localhost.localdomain
|
||||
}
|
||||
|
||||
# TODO: Add a test covering case SPAMASSASSIN_SPAM_TO_INBOX=1 (default)
|
||||
|
|
|
@ -31,15 +31,29 @@ function teardown_file() { _default_teardown ; }
|
|||
}
|
||||
|
||||
@test '(SASLauthd) RIMAP SMTP authentication works' {
|
||||
_nc_wrapper 'auth/smtp-auth-login.txt' '-w 5 0.0.0.0 25'
|
||||
assert_output --partial 'Error: authentication not enabled'
|
||||
_send_email \
|
||||
--auth LOGIN \
|
||||
--auth-user user1@localhost.localdomain \
|
||||
--auth-password mypassword \
|
||||
--quit-after AUTH
|
||||
assert_failure
|
||||
assert_output --partial 'Host did not advertise authentication'
|
||||
|
||||
_nc_wrapper 'auth/smtp-auth-login.txt' '-w 5 0.0.0.0 465'
|
||||
_send_email \
|
||||
--port 465 \
|
||||
--auth LOGIN \
|
||||
--auth-user user1@localhost.localdomain \
|
||||
--auth-password mypassword \
|
||||
--quit-after AUTH
|
||||
assert_success
|
||||
assert_output --partial 'Authentication successful'
|
||||
|
||||
_nc_wrapper 'auth/smtp-auth-login.txt' '-w 5 0.0.0.0 587'
|
||||
_send_email \
|
||||
--port 587 \
|
||||
--auth LOGIN \
|
||||
--auth-user user1@localhost.localdomain \
|
||||
--auth-password mypassword \
|
||||
--quit-after AUTH
|
||||
assert_success
|
||||
assert_output --partial 'Authentication successful'
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue