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

/* Thanks to Courier-IMAP for showing how the vpopmail API should be used */

#include "config.h"
#undef HAVE_CONFIG_H

#if defined(PASSDB_VPOPMAIL) || defined(USERDB_VPOPMAIL)

#include "common.h"
#include "userdb.h"
#include "userdb-vpopmail.h"

struct vqpasswd *vpopmail_lookup_vqp(const char *user,
				     char vpop_user[VPOPMAIL_LIMIT],
				     char vpop_domain[VPOPMAIL_LIMIT])
{
	struct vqpasswd *vpw;

	/* vpop_user must be zero-filled or parse_email() leaves an
	   extra character after the user name. we'll fill vpop_domain
	   as well just to be sure... */
	memset(vpop_user, '\0', VPOPMAIL_LIMIT);
	memset(vpop_domain, '\0', VPOPMAIL_LIMIT);

	if (parse_email(t_strdup_noconst(user), vpop_user, vpop_domain,
			VPOPMAIL_LIMIT-1) < 0) {
		if (verbose) {
			i_info("vpopmail(%s): parse_email() failed",
			       user);
		}
		return NULL;
	}

	vpw = vauth_getpw(vpop_user, vpop_domain);
	if (vpw == NULL) {
		if (verbose)
			i_info("vpopmail(%s): unknown user", user);
		return NULL;
	}

	return vpw;
}

#ifdef USERDB_VPOPMAIL

static void vpopmail_lookup(const char *user, userdb_callback_t *callback,
			    void *context)<commit_msg>Log vpop_user + vpop_domain too. They may be different from original username after parse_email()..<commit_after>/* Copyright (C) 2002-2003 <NAME> */

/* Thanks to Courier-IMAP for showing how the vpopmail API should be used */

#include "config.h"
#undef HAVE_CONFIG_H

#if defined(PASSDB_VPOPMAIL) || defined(USERDB_VPOPMAIL)

#include "common.h"
#include "userdb.h"
#include "userdb-vpopmail.h"

struct vqpasswd *vpopmail_lookup_vqp(const char *user,
				     char vpop_user[VPOPMAIL_LIMIT],
				     char vpop_domain[VPOPMAIL_LIMIT])
{
	struct vqpasswd *vpw;

	/* vpop_user must be zero-filled or parse_email() leaves an
	   extra character after the user name. we'll fill vpop_domain
	   as well just to be sure... */
	memset(vpop_user, '\0', VPOPMAIL_LIMIT);
	memset(vpop_domain, '\0', VPOPMAIL_LIMIT);

	if (parse_email(t_strdup_noconst(user), vpop_user, vpop_domain,
			VPOPMAIL_LIMIT-1) < 0) {
		if (verbose) {
			i_info("vpopmail(%s): parse_email() failed",
			       user);
		}
		return NULL;
	}

	vpw = vauth_getpw(vpop_user, vpop_domain);
	if (vpw == NULL) {
		if (verbose) {
			i_info("vpopmail(%s): unknown user (%s@%s)",
			       user, vpop_user, vpop_domain);
		}
		return NULL;
	}

	return vpw;
}

#ifdef USERDB_VPOPMAIL

static void vpopmail_lookup(const char *user, userdb_callback_t *callback,
			    void *context)
{'fraction_non_alphanumeric': 0.12165354330708661, 'fraction_numerical': 0.009448818897637795, 'mean_word_length': 4.102409638554217, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '4091187', 'n_tokens_mistral': 1036, 'n_tokens_neox': 979, 'n_words': 238}