Check is_spam_converted flag to differentiate between:
- Explicit class declaration (new format) -> multi-class
- Converted is_spam=true/false (legacy) -> binary
This fixes incorrect "binary" detection for explicit multi-class
configurations using class="spam" and class="ham".
gboolean has_spam = FALSE;
gboolean has_ham = FALSE;
gboolean has_other = FALSE;
+ gboolean has_explicit_classes = FALSE;
GList *cur;
if (cfg == NULL) {
continue;
}
+ if (!stcf->is_spam_converted) {
+ has_explicit_classes = TRUE;
+ }
+
if (g_ascii_strcasecmp(stcf->class_name, "spam") == 0) {
has_spam = TRUE;
}
}
}
+ /* If any statfile has explicit class (not converted from is_spam) */
+ if (has_explicit_classes) {
+ return "multi-class";
+ }
+
+ /* Legacy binary: spam=true/false converted to class names */
if (has_spam && has_ham && !has_other) {
return "binary";
}