{"record":{"id":"407bedfb9ee56506","repo":"projectdiscovery/nuclei","slug":"dialers-not-initialized-for-s-407bed","errorCode":null,"errorMessage":"dialers not initialized for %s","messagePattern":"dialers not initialized for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/js/libs/smtp/smtp.go","lineNumber":94,"sourceCode":"// IsSMTP checks if a host is running a SMTP server.\n// @example\n// ```javascript\n// const smtp = require('nuclei/smtp');\n// const client = new smtp.Client('acme.com', 25);\n// const isSMTP = client.IsSMTP();\n// log(isSMTP)\n// ```\nfunc (c *Client) IsSMTP() (SMTPResponse, error) {\n\tresp := SMTPResponse{}\n\tc.nj.Require(c.host != \"\", \"host cannot be empty\")\n\tc.nj.Require(c.port != \"\", \"port cannot be empty\")\n\n\ttimeout := 5 * time.Second\n\n\texecutionId := c.nj.ExecutionId()\n\tdialer := protocolstate.GetDialersWithId(executionId)\n\tif dialer == nil {\n\t\treturn SMTPResponse{}, fmt.Errorf(\"dialers not initialized for %s\", executionId)\n\t}\n\n\tconn, err := dialer.Fastdialer.Dial(c.nj.Context(), \"tcp\", net.JoinHostPort(c.host, c.port))\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\tdefer func() {\n\t\t_ = conn.Close()\n\t}()\n\n\tsmtpPlugin := pluginsmtp.SMTPPlugin{}\n\tservice, err := smtpPlugin.Run(conn, timeout, plugins.Target{Host: c.host})\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\tif service == nil {\n\t\treturn resp, nil\n\t}","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/js/libs/smtp/smtp.go#L76-L112","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Run the template through the nuclei engine so dialers are initialized per execution","If embedding via the SDK/lib, ensure the JS protocol engine initialization (which registers dialers per execution id) runs before template execution","Upgrade to a consistent nuclei version so client and runtime agree on dialer initialization","Do not reuse JS objects across separate template executions"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { const r = client.IsSMTP(); } catch (e) { if (String(e).includes('dialers not initialized')) { /* runtime misconfig: report, do not retry */ } else { throw e; } }","preventionTips":["Run smtp templates inside the nuclei engine, not a bare goja host","Keep runtime and template library versions consistent","Never cache clients across template executions"],"tags":["smtp","javascript","nuclei","initialization","runtime"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}