projectdiscovery/nuclei · error

dialers not initialized for %s

Error message

dialers not initialized for %s

What it means

Thrown by smtp.Client.IsSMTP in the nuclei JavaScript library when protocolstate.GetDialersWithId(executionId) returns nil — the fastdialer bundle tied to this JS execution context was never initialized. The dialer carries the runtime's network policy and connection pooling; without it the library refuses to open sockets rather than bypassing the engine's network controls. The execution id in the message identifies which context is missing its dialers.

Source

Thrown at pkg/js/libs/smtp/smtp.go:94

// IsSMTP checks if a host is running a SMTP server.
// @example
// ```javascript
// const smtp = require('nuclei/smtp');
// const client = new smtp.Client('acme.com', 25);
// const isSMTP = client.IsSMTP();
// log(isSMTP)
// ```
func (c *Client) IsSMTP() (SMTPResponse, error) {
	resp := SMTPResponse{}
	c.nj.Require(c.host != "", "host cannot be empty")
	c.nj.Require(c.port != "", "port cannot be empty")

	timeout := 5 * time.Second

	executionId := c.nj.ExecutionId()
	dialer := protocolstate.GetDialersWithId(executionId)
	if dialer == nil {
		return SMTPResponse{}, fmt.Errorf("dialers not initialized for %s", executionId)
	}

	conn, err := dialer.Fastdialer.Dial(c.nj.Context(), "tcp", net.JoinHostPort(c.host, c.port))
	if err != nil {
		return resp, err
	}
	defer func() {
		_ = conn.Close()
	}()

	smtpPlugin := pluginsmtp.SMTPPlugin{}
	service, err := smtpPlugin.Run(conn, timeout, plugins.Target{Host: c.host})
	if err != nil {
		return resp, err
	}
	if service == nil {
		return resp, nil
	}

View on GitHub (pinned to 265b3a3dec)

Solutions

  1. Run the template through the nuclei engine so dialers are initialized per execution
  2. If embedding via the SDK/lib, ensure the JS protocol engine initialization (which registers dialers per execution id) runs before template execution
  3. Upgrade to a consistent nuclei version so client and runtime agree on dialer initialization
  4. Do not reuse JS objects across separate template executions
Defensive patterns

Strategy: try-catch

Try / catch

try { const r = client.IsSMTP(); } catch (e) { if (String(e).includes('dialers not initialized')) { /* runtime misconfig: report, do not retry */ } else { throw e; } }

Prevention

When it happens

Trigger: Executing the smtp library outside the nuclei engine runtime (e.g. in a standalone goja sandbox) where protocolstate was never set up for the execution id; engine versions/migrations that changed per-execution dialer initialization; calling IsSMTP from a context whose executionId differs from the one the dialers were registered under.

Common situations: SDK users embedding nuclei' js runtime without running the full engine setup; template code that caches a client across executions with different execution ids; upgrading nuclei where dialer lifecycle moved to per-execution initialization (GetDialersWithId).

Related errors


AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15). Data as JSON: /api/errors/407bedfb9ee56506. Report an issue: GitHub.