return mail_set->parsed_have_special_use_mailboxes;
}
-struct client *client_create(int fd_in, int fd_out, bool unhibernated,
+struct client *client_create(int fd_in, int fd_out,
+ enum client_create_flags flags,
struct event *event, struct mail_user *user,
const struct imap_settings *set,
const struct smtp_submit_settings *smtp_set)
client->v = imap_client_vfuncs;
client->event = event;
event_ref(client->event);
- client->unhibernated = unhibernated;
+ client->unhibernated = (flags & CLIENT_CREATE_FLAG_UNHIBERNATED) != 0;
client->set = set;
client->smtp_set = smtp_set;
client->fd_in = fd_in;
struct imap_arg;
struct imap_urlauth_context;
+enum client_create_flags {
+ CLIENT_CREATE_FLAG_UNHIBERNATED = BIT(0),
+};
+
struct mailbox_keywords {
/* All keyword names. The array itself exists in mail_index.
Keywords are currently only appended, they're never removed. */
/* Create new client with specified input/output handles. socket specifies
if the handle is a socket. */
-struct client *client_create(int fd_in, int fd_out, bool unhibernated,
+struct client *client_create(int fd_in, int fd_out,
+ enum client_create_flags flags,
struct event *event, struct mail_user *user,
const struct imap_settings *set,
const struct smtp_submit_settings *smtp_set);
void imap_refresh_proctitle_delayed(void);
int client_create_from_input(const struct mail_storage_service_input *input,
- int fd_in, int fd_out, bool unhibernated,
+ int fd_in, int fd_out,
+ enum client_create_flags flags,
struct client **client_r, const char **error_r);
#endif
/* NOTE: before client_create_from_input() on failures we need to close
fd_client, but afterward it gets closed by client_destroy() */
ret = client_create_from_input(&input, fd_client, fd_client,
- TRUE, &imap_client, &error);
+ CLIENT_CREATE_FLAG_UNHIBERNATED,
+ &imap_client, &error);
if (ret < 0) {
e_error(conn->event,
"imap-master(%s): Failed to create client: %s",
}
int client_create_from_input(const struct mail_storage_service_input *input,
- int fd_in, int fd_out, bool unhibernated,
+ int fd_in, int fd_out,
+ enum client_create_flags flags,
struct client **client_r, const char **error_r)
{
struct mail_storage_service_input service_input;
if (imap_set->verbose_proctitle)
verbose_proctitle = TRUE;
- client = client_create(fd_in, fd_out, unhibernated,
+ client = client_create(fd_in, fd_out, flags,
event, mail_user, imap_set, smtp_set);
client->userdb_fields = input->userdb_fields == NULL ? NULL :
p_strarray_dup(client->pool, input->userdb_fields);
(void)net_addr2ip(value, &input.local_ip);
if (client_create_from_input(&input, STDIN_FILENO, STDOUT_FILENO,
- FALSE, &client, &error) < 0)
+ 0, &client, &error) < 0)
i_fatal("%s", error);
input_base64 = getenv("CLIENT_INPUT");
&imap_request);
if (client_create_from_input(&input, request->fd, request->fd,
- FALSE, &client, &error) < 0) {
+ 0, &client, &error) < 0) {
int fd = request->fd;
struct ostream *output =
o_stream_create_fd_autoclose(&fd, IO_BLOCK_SIZE);
void imap_refresh_proctitle_delayed(void) { }
int client_create_from_input(const struct mail_storage_service_input *input ATTR_UNUSED,
int fd_in ATTR_UNUSED, int fd_out ATTR_UNUSED,
- bool unhibernated ATTR_UNUSED,
+ enum client_create_flags flags ATTR_UNUSED,
struct client **client_r ATTR_UNUSED,
const char **error_r ATTR_UNUSED) { return -1; }
struct event *event = event_create(NULL);
int client_fd = dup(dev_null_fd);
- client = client_create(client_fd, client_fd, FALSE, event, mail_user,
+ client = client_create(client_fd, client_fd, 0, event, mail_user,
imap_setting_parser_info.defaults, &smtp_set);
ctx.client = client;