<commit_before>/* Copyright (c) 2007-2012 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "ioloop.h"
#include "istream.h"
#include "index-mail.h"
#include "mail-copy.h"
#include "mailbox-list-private.h"
#include "raw-sync.h"
#include "raw-storage.h"

extern struct mail_storage raw_storage;
extern struct mailbox raw_mailbox;

struct mail_user *
raw_storage_create_from_set(const struct setting_parser_info *set_info,
			    const struct mail_user_settings *set)
{
	struct mail_user *user;
	struct mail_namespace *ns;
	struct mail_namespace_settings *ns_set;
	const char *error;

	user = mail_user_alloc("raw mail user", set_info, set);
	user->autocreated = TRUE;
	mail_user_set_home(user, "/");
	if (mail_user_init(user, &error) < 0)
		i_fatal("Raw user initialization failed: %s", error);

	ns_set = p_new(user->pool, struct mail_namespace_settings, 1);
	ns_set->name = "raw-storage";
	ns_set->location = ":LAYOUT=none";
	ns_set->separator = "/";

	ns = mail_namespaces_init_empty(user);
	ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
	ns->set = ns_set;
	if (mail_storage_create(ns, "raw", 0, &error) < 0)
		i_fatal("Couldn't create internal raw storage: %s", error);<commit_msg>raw storage: Don't set NAMESPACE_FLAG_INBOX_USER for the created namespace.<commit_after>/* Copyright (c) 2007-2012 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "ioloop.h"
#include "istream.h"
#include "index-mail.h"
#include "mail-copy.h"
#include "mailbox-list-private.h"
#include "raw-sync.h"
#include "raw-storage.h"

extern struct mail_storage raw_storage;
extern struct mailbox raw_mailbox;

struct mail_user *
raw_storage_create_from_set(const struct setting_parser_info *set_info,
			    const struct mail_user_settings *set)
{
	struct mail_user *user;
	struct mail_namespace *ns;
	struct mail_namespace_settings *ns_set;
	const char *error;

	user = mail_user_alloc("raw mail user", set_info, set);
	user->autocreated = TRUE;
	mail_user_set_home(user, "/");
	if (mail_user_init(user, &error) < 0)
		i_fatal("Raw user initialization failed: %s", error);

	ns_set = p_new(user->pool, struct mail_namespace_settings, 1);
	ns_set->name = "raw-storage";
	ns_set->location = ":LAYOUT=none";
	ns_set->separator = "/";

	ns = mail_namespaces_init_empty(user);
	/* raw storage doesn't have INBOX. We especially don't want LIST to
	   return INBOX. */
	ns->flags &= ~NAMESPACE_FLAG_INBOX_USER;
	ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
	ns->set = ns_set;
	if (mail_storage_create(ns, "raw", 0, &error) < 0)
		i_fatal("Couldn't create internal raw storage: %s", error);
{'fraction_non_alphanumeric': 0.13058289174867524, 'fraction_numerical': 0.009084027252081756, 'mean_word_length': 5.558312655086849, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 18, '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': '3002800', 'n_tokens_mistral': 1007, 'n_tokens_neox': 952, 'n_words': 234}