diff --git a/client/basic/client.ts b/client/basic/client.ts index 4ad5f17..23b8b0a 100644 --- a/client/basic/client.ts +++ b/client/basic/client.ts @@ -326,7 +326,12 @@ export class SMTPClient { } if ( - this.#supportedFeatures.has("STARTTLS") && !this.config.debug.noStartTLS + // When in TLS don't use STARTTLS + !this.secure && + // Check for STARTTLS support + this.#supportedFeatures.has("STARTTLS") && + // Check that STARTTLS is allowed + !this.config.debug.noStartTLS ) { this.#connection.writeCmdAndAssert(CommandCode.READY, "STARTTLS");