{"record":{"id":"4a441cf552c9ec6a","repo":"flowable/flowable-engine","slug":"no-smtp-host-is-configured-for-the-mail-server-for-4a441c","errorCode":null,"errorMessage":"no SMTP host is configured for the mail server for tenant {tenantId}","messagePattern":"no SMTP host is configured for the mail server for tenant (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cfg/ProcessEngineConfigurationImpl.java","lineNumber":2410,"sourceCode":"\n        Collection<String> tenantIds = new HashSet<>(mailSessionsJndi.keySet());\n        tenantIds.addAll(mailServers.keySet());\n\n        if (!tenantIds.isEmpty()) {\n            Map<String, FlowableMailClient> mailClients = defaultMailClientProvider.getMailClients();\n            MailServerInfo defaultMailServer = getDefaultMailServer();\n            for (String tenantId : tenantIds) {\n                if (mailClients.containsKey(tenantId)) {\n                    continue;\n                }\n                String sessionJndi = mailSessionsJndi.get(tenantId);\n                MailServerInfo tenantMailServer = mailServers.get(tenantId);\n                if (sessionJndi != null) {\n                    mailClients.put(tenantId, FlowableMailClientCreator.createSessionClient(sessionJndi, tenantMailServer, defaultMailServer));\n                } else if (tenantMailServer != null) {\n                    String host = tenantMailServer.getMailServerHost();\n                    if (host == null) {\n                        throw new FlowableException(\"no SMTP host is configured for the mail server for tenant \" + tenantId);\n                    }\n                    mailClients.put(tenantId, FlowableMailClientCreator.createHostClient(host, tenantMailServer, defaultMailServer));\n                }\n            }\n        }\n    }\n\n    public void initBusinessCalendarManager() {\n        if (businessCalendarManager == null) {\n            MapBusinessCalendarManager mapBusinessCalendarManager = new MapBusinessCalendarManager();\n            mapBusinessCalendarManager.addBusinessCalendar(DurationBusinessCalendar.NAME, new DurationBusinessCalendar(this.clock));\n            mapBusinessCalendarManager.addBusinessCalendar(DueDateBusinessCalendar.NAME, new DueDateBusinessCalendar(this.clock));\n            mapBusinessCalendarManager.addBusinessCalendar(CycleBusinessCalendar.NAME, new CycleBusinessCalendar(this.clock));\n\n            businessCalendarManager = mapBusinessCalendarManager;\n        }\n    }\n","sourceCodeStart":2392,"sourceCodeEnd":2428,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cfg/ProcessEngineConfigurationImpl.java#L2392-L2428","documentation":"When building per-tenant mail clients, Flowable validates that each tenant's configured MailServerInfo has a host. If a tenant-specific mail server was registered without a host, it throws this FlowableException naming the tenant. This prevents tenant-scoped mail activities from failing later at send time.","triggerScenarios":"During ProcessEngineConfigurationImpl initialization, iterating mailServers: a tenant id key exists in mailServers (or mailSessionsJndi mapping) whose tenantMailServer.getMailServerHost() is null.","commonSituations":"Multi-tenant deployments where addTenantMailServer(tenantId, ...) was called with a MailServerInfo lacking a host; tenant config loaded from a database/properties file with an empty host column; copy-paste of tenant config with only credentials set.","solutions":["Set the host for the affected tenant: config.addTenantMailServer(tenantId, mailServerInfo) with mailServerInfo.setMailServerHost(\"smtp.example.com\").","Fix the tenant mail server entry in your properties/database so host is non-empty for every tenant id.","Remove the tenant entry entirely if that tenant has no mail server and the default server should apply."],"exampleFix":"// before\nMailServerInfo tenantServer = new MailServerInfo();\nconfig.addTenantMailServer(\"tenant-a\", tenantServer);\n// after\nMailServerInfo tenantServer = new MailServerInfo();\ntenantServer.setMailServerHost(\"smtp.tenant-a.com\");\nconfig.addTenantMailServer(\"tenant-a\", tenantServer);","handlingStrategy":"validation","validationCode":"mailServers.forEach((tenantId, info) -> {\n    if (info.getMailServerHost() == null || info.getMailServerHost().isBlank()) {\n        throw new IllegalStateException(\"Mail server host missing for tenant \" + tenantId);\n    }\n});","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate every tenant mail server entry for a host before building the engine","Centralize tenant SMTP config loading with schema validation","Only register tenant mail servers that actually override the default"],"tags":["flowable","configuration","smtp","mail","multi-tenancy"],"backgroundTag":"missing-required-config-field","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}