Skip to content

Commit

Permalink
fix: before starttls check if connection is secure (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathe42 authored Nov 29, 2022
1 parent 4501d4c commit e0c35d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/basic/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit e0c35d3

Please sign in to comment.