{"record":{"id":"f02f1a8cbe43831d","repo":"Billionmail/BillionMail","slug":"invalid-timezone","errorCode":null,"errorMessage":"invalid timezone","messagePattern":"invalid timezone","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/controller/settings/settings.go","lineNumber":228,"sourceCode":"\n\tcase \"SMTP_PORT\", \"SMTPS_PORT\", \"SUBMISSION_PORT\", \"IMAP_PORT\", \"IMAPS_PORT\", \"POP_PORT\", \"POPS_PORT\", \"HTTP_PORT\", \"HTTPS_PORT\", \"REDIS_PORT\",\n\t\t\"smtp\", \"smtps\", \"submission\", \"imap\", \"imaps\", \"pop\", \"pops\", \"http\", \"https\", \"redis_port\":\n\t\t// Port: 1-65535\n\t\tport := public.ParseInt(value)\n\t\tif port < 1 || port > 65535 {\n\t\t\treturn fmt.Errorf(\"port must be between 1-65535\")\n\t\t}\n\n\tcase \"IPV4_NETWORK\", \"ipv4_network\":\n\t\t// IPv4 network: CIDR format\n\t\tif !public.IsValidCIDR(value) {\n\t\t\treturn fmt.Errorf(\"IPv4 network format is incorrect, please use CIDR format (e.g. 192.168.1.0/24)\")\n\t\t}\n\n\tcase \"TZ\", \"timezone\":\n\t\t// Timezone: check if it is a valid timezone\n\t\tif !public.IsValidTimezone(value) {\n\t\t\treturn fmt.Errorf(\"invalid timezone\")\n\t\t}\n\n\tcase \"FAIL2BAN_INIT\", \"fail2ban\":\n\t\t// fail2ban: only allowed y/n or 1/0\n\t\tif value != \"y\" && value != \"n\" && value != \"1\" && value != \"0\" {\n\t\t\treturn fmt.Errorf(\"fail2ban value can only be y/n or 1/0\")\n\t\t}\n\tcase \"RETENTION_DAYS\", \"retention_days\":\n\t\t// retention_days: must be a number\n\t\tif _, err := strconv.Atoi(value); err != nil {\n\t\t\treturn fmt.Errorf(\"retention_days must be a number\")\n\t\t}\n\t}\n\n\t// General character check: not allowed dangerous characters\n\tif public.ContainsDangerousChars(value) {\n\t\treturn fmt.Errorf(\"configuration value contains illegal characters\")\n\t}","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/controller/settings/settings.go#L210-L246","documentation":"validateConfigValue checks the TZ/timezone key with public.IsValidTimezone and rejects values that are not IANA timezone identifiers. The timezone is propagated into container and service configs, so an unknown value would cause time-dependent features (logs, scheduling, warmup) to misbehave.","triggerScenarios":"Setting TZ to abbreviations ('EST', 'CET'), offsets ('UTC+2'), a made-up zone ('Europe/Berlin '), wrong casing ('america/new_york' if the checker is case-sensitive), or a zone not present in the tz database.","commonSituations":"Admins copy Windows timezone names ('W. Europe Standard Time') or GMT offsets from other systems instead of IANA names like 'Europe/Berlin' or 'America/New_York'.","solutions":["Use an IANA timezone identifier, e.g. 'America/New_York' or 'Europe/Berlin'","Check the name against the IANA tz database (or Go's time.LoadLocation) before saving","Replace fixed-offset strings like 'UTC+2' with the corresponding zone name","Trim whitespace and fix casing to match the canonical zone name"],"exampleFix":"// before\nTZ = EST\n// after\nTZ = America/New_York","handlingStrategy":"validation","validationCode":"function isValidTimezone(tz: string): boolean {\n  try { Intl.DateTimeFormat(undefined, { timeZone: tz }); return true; }\n  catch { return false; }\n}\nif (!isValidTimezone(tz)) throw new Error('invalid timezone');","typeGuard":"function isIANAZone(v: string): v is string {\n  return /^[A-Za-z]+\\/[A-Za-z_+-]+$/.test(v) || v === 'UTC';\n}","tryCatchPattern":"try {\n  await api.setSystemConfigKey('TZ', tz);\n} catch (e) {\n  if (String(e.message).includes('invalid timezone')) {\n    notify('Use an IANA timezone name like Europe/Berlin');\n  } else throw e;\n}","preventionTips":["Use IANA tz names, never GMT offsets or Windows zone names","Pick from a timezone dropdown instead of free text","Trim whitespace before sending","Test with Intl.DateTimeFormat or time.LoadLocation equivalent first"],"tags":["validation","config","timezone"],"backgroundTag":"invalid-timezone","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}