quarkusio/quarkus · error · ConfigurationException

Must provide the selector.

Error message

Must provide the selector.

What it means

Along with sdid, DKIM requires a selector that names the key record (selector._domainkey.<sdid>). toVertxDkimSignOptions throws this ConfigurationException when dkim.selector is missing from the mailer configuration.

Source

Thrown at extensions/mailer/runtime/src/main/java/io/quarkus/mailer/runtime/Mailers.java:179

        try {
            return CredentialsProviderFinder.find(beanName);
        } catch (Exception e) {
            throw new ConfigurationException("Unable to find credentials provider for the mailer " + mailerName + ".", e);
        }
    }

    private io.vertx.ext.mail.DKIMSignOptions toVertxDkimSignOptions(DkimSignOptionsConfig optionsConfig) {
        DKIMSignOptions vertxDkimOptions = new io.vertx.ext.mail.DKIMSignOptions();

        String sdid = optionsConfig.sdid()
                .orElseThrow(() -> {
                    throw new ConfigurationException("Must provide the Signing Domain Identifier (sdid).");
                });
        vertxDkimOptions.setSdid(sdid);

        String selector = optionsConfig.selector()
                .orElseThrow(() -> {
                    throw new ConfigurationException("Must provide the selector.");
                });
        vertxDkimOptions.setSelector(selector);

        if (optionsConfig.auid().isPresent()) {
            vertxDkimOptions.setAuid(optionsConfig.auid().get());
        }

        if (optionsConfig.bodyLimit().isPresent()) {
            int bodyLimit = optionsConfig.bodyLimit().getAsInt();
            vertxDkimOptions.setBodyLimit(bodyLimit);
        }

        if (optionsConfig.expireTime().isPresent()) {
            long expireTime = optionsConfig.expireTime().getAsLong();
            vertxDkimOptions.setExpireTime(expireTime);
        }

        if (optionsConfig.bodyCanonAlgo().isPresent()) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add quarkus.mailer.dkim.selector=<selector> matching the DNS TXT record at <selector>._domainkey.<sdid>.
  2. If DKIM is not intended, remove all quarkus.mailer.dkim.* properties.
  3. Audit all profiles (dev/test/prod) so every environment supplies both sdid and selector.

Example fix

// before
quarkus.mailer.dkim.sdid=example.com
quarkus.mailer.dkim.private-key=classpath:dkim.pem

// after
quarkus.mailer.dkim.sdid=example.com
quarkus.mailer.dkim.selector=mail
quarkus.mailer.dkim.private-key=classpath:dkim.pem
Defensive patterns

Strategy: validation

Validate before calling

if (ConfigProvider.getConfig().getOptionalValue("quarkus.mailer.dkim.sdid", String.class).isPresent()
        && ConfigProvider.getConfig().getOptionalValue("quarkus.mailer.dkim.selector", String.class).isEmpty()) {
    throw new IllegalStateException("dkim configured but quarkus.mailer.dkim.selector is missing");
}

Try / catch

try {
    mailer.send(mail).await().indefinitely();
} catch (ConfigurationException e) {
    if (e.getMessage().contains("selector")) {
        LOG.error("Set quarkus.mailer.dkim.selector to match <selector>._domainkey.<sdid>", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Any dkim.* property is configured but quarkus.mailer.dkim.selector (or the named-mailer equivalent) is absent when the mailer config is converted to Vert.x options.

Common situations: Setting only sdid and the private key; mistyping the property name (e.g. dkim.selectors); environment-specific config files where one profile omits the selector.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/182286817e4cb18f. Report an issue: GitHub.