test/auth: test through ssl only

This commit is contained in:
Zack Schuster 2022-04-29 11:04:07 -07:00
parent 67d56d13c2
commit abe9c101a1
1 changed files with 7 additions and 4 deletions

View File

@ -18,8 +18,6 @@ function connect({
const server = new SMTPServer({
authMethods,
secure: secure,
hideSTARTTLS: !secure,
authOptional,
onAuth(auth, _session, callback) {
const { accessToken, method, username, password } = auth;
if (
@ -39,8 +37,13 @@ function connect({
const p = port++;
server.listen(p, () => {
const options = Object.assign(
{ port: p, ssl: secure, authentication: authMethods },
authOptional ? {} : { user: 'pooh', password: 'honey' }
{
port: p,
authentication: authMethods,
},
authOptional
? { ssl: secure }
: { ssl: secure, user: 'pooh', password: 'honey' }
);
new SMTPConnection(options).connect((err) => {
server.close(() => {