<commit_before>/* Copyright (C) 2002 <NAME> */

#include "lib.h"
#include "ioloop.h"
#include "mail-storage.h"

#include <stdlib.h>
#include <time.h>
#include <ctype.h>

/* Message to show to users when critical error occurs */
#define CRITICAL_MSG "Internal error [%Y-%m-%d %H:%M:%S]"

struct mail_storage_list {
	struct mail_storage_list *next;
	struct mail_storage *storage;
};

struct client_workaround_list {
	const char *name;
	enum client_workarounds num;
};

struct client_workaround_list client_workaround_list[] = {
	{ "oe6-fetch-no-newmail", WORKAROUND_OE6_FETCH_NO_NEWMAIL },
	{ NULL, 0 }
};

static struct mail_storage_list *storages = NULL;
enum client_workarounds client_workarounds = 0;
int full_filesystem_access = FALSE;

void mail_storage_init(void)
{
        struct client_workaround_list *list;
	const char *env;
	const char *const *str;

        full_filesystem_access = getenv("FULL_FILESYSTEM_ACCESS") != NULL;

	env = getenv("CLIENT_WORKAROUNDS");
	if (env == NULL)
		return;

	for (str = t_strsplit(env, " "); *str != NULL; str++) {
                list = client_workaround_list;
		for (; list->name != NULL; list++) {
			if (strcasecmp(*str, list->name) == 0)
				client_workarounds |= list->num;
			else
				i_fatal("Unknown client workaround: %s", *str);
		}
	}
}

void mail_storage_class_register(struct mail_storage *storage_class)
{
	struct mail_storage_list *list, **pos;<commit_msg>Ignore empty workarounds<commit_after>/* Copyright (C) 2002 <NAME> */

#include "lib.h"
#include "ioloop.h"
#include "mail-storage.h"

#include <stdlib.h>
#include <time.h>
#include <ctype.h>

/* Message to show to users when critical error occurs */
#define CRITICAL_MSG "Internal error [%Y-%m-%d %H:%M:%S]"

struct mail_storage_list {
	struct mail_storage_list *next;
	struct mail_storage *storage;
};

struct client_workaround_list {
	const char *name;
	enum client_workarounds num;
};

struct client_workaround_list client_workaround_list[] = {
	{ "oe6-fetch-no-newmail", WORKAROUND_OE6_FETCH_NO_NEWMAIL },
	{ NULL, 0 }
};

static struct mail_storage_list *storages = NULL;
enum client_workarounds client_workarounds = 0;
int full_filesystem_access = FALSE;

void mail_storage_init(void)
{
        struct client_workaround_list *list;
	const char *env;
	const char *const *str;

        full_filesystem_access = getenv("FULL_FILESYSTEM_ACCESS") != NULL;

	env = getenv("CLIENT_WORKAROUNDS");
	if (env == NULL)
		return;

	for (str = t_strsplit(env, " "); *str != NULL; str++) {
		if (*str == '\0')
			continue;

		list = client_workaround_list;
		for (; list->name != NULL; list++) {
			if (strcasecmp(*str, list->name) == 0)
				client_workarounds |= list->num;
			else
				i_fatal("Unknown client workaround: %s", *str);
		}
	}
}

void mail_storage_class_register(struct mail_storage *storage_class)
{
	struct mail_storage_list *list, **pos;
{'fraction_non_alphanumeric': 0.13377575969263011, 'fraction_numerical': 0.006636395389451624, 'mean_word_length': 4.671287128712871, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3603828', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1012, 'n_words': 245}