Skip to content

feat(workflows): add EMAIL_PROVIDER_SMTP_IGNORE_TLS - #8301

Merged
n1ru4l merged 1 commit into
graphql-hive:mainfrom
overpod:feat/smtp-ignore-tls
Aug 3, 2026
Merged

feat(workflows): add EMAIL_PROVIDER_SMTP_IGNORE_TLS#8301
n1ru4l merged 1 commit into
graphql-hive:mainfrom
overpod:feat/smtp-ignore-tls

Conversation

@overpod

@overpod overpod commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Background

Resolves #1561.

Sending emails fails when the SMTP server advertises STARTTLS but cannot actually complete a TLS
handshake. The existing EMAIL_PROVIDER_SMTP_REJECT_UNAUTHORIZED variable only relaxes certificate
validation, which does not help when TLS itself is unusable — nodemailer still attempts the upgrade
and the connection fails.

Description

Affected package: @hive/workflows (the smtp email provider).

Adds a new optional environment variable EMAIL_PROVIDER_SMTP_IGNORE_TLS, which maps to the
nodemailer ignoreTLS transport option.

  • packages/services/workflows/src/environment.ts — added the variable to SMTPEmailModel (same
    '0' | '1' shape as the neighbouring EMAIL_PROVIDER_SMTP_REJECT_UNAUTHORIZED) and wired it into
    the SMTP provider config.
  • packages/services/workflows/src/lib/emails/providers.ts — added ignoreTLS to
    SMTPEmailProviderConfig and passed it to nodemailer.createTransport.
  • packages/services/workflows/README.md — documented the new variable, plus
    EMAIL_PROVIDER_SMTP_REJECT_UNAUTHORIZED which was previously missing from the table.

Notes on behaviour:

  • The variable is opt-in and defaults to 0. Unlike REJECT_UNAUTHORIZED (which defaults to
    enabled via !== '0'), this one is checked with === '1', so deployments that do not set it keep
    their current behaviour and STARTTLS stays enabled.
  • nodemailer only honours ignoreTLS when secure is false, so setting
    EMAIL_PROVIDER_SMTP_PROTOCOL=smtps is unaffected by this option.

Checklist

  • Input validation
  • Communication security
  • System configuration

Allow sending emails through SMTP servers that advertise STARTTLS but
cannot complete a TLS handshake.

The existing EMAIL_PROVIDER_SMTP_REJECT_UNAUTHORIZED only relaxes
certificate validation, which does not help when TLS itself is not
usable. The new variable maps to the nodemailer `ignoreTLS` option.

It is opt-in and defaults to `0`, so existing deployments keep their
current behaviour. nodemailer only honours the option when `secure` is
false, so the `smtps` protocol is unaffected.

Closes graphql-hive#1561
@dotansimha
dotansimha requested a review from n1ru4l August 3, 2026 10:41
@n1ru4l n1ru4l mentioned this pull request Aug 3, 2026

@n1ru4l n1ru4l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this contribution!

@n1ru4l
n1ru4l merged commit df4ba0c into graphql-hive:main Aug 3, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Email: Sending emails does not work if the server does not have a TLS.

2 participants