const struct mailbox_update *update, bool directory)
{
struct welcome_mailbox *wbox = WELCOME_CONTEXT(box);
+ const char *cmd;
if (wbox->module_ctx.super.create_box(box, update, directory) < 0)
return -1;
- /* the mailbox isn't fully created here yet, so just mark it as created
- and wait until open() time to actually run it */
- wbox->created = TRUE;
+ cmd = mail_user_plugin_getenv(box->storage->user, "welcome_script");
+ if (cmd != NULL) {
+ bool wait = mail_user_plugin_getenv_bool(box->storage->user,
+ "welcome_wait");
+ script_execute(box->storage->user, cmd, wait);
+ }
+
return 0;
}
static int welcome_open_box(struct mailbox *box)
{
struct welcome_mailbox *wbox = WELCOME_CONTEXT(box);
- const char *cmd;
- cmd = !wbox->created ? NULL :
- mail_user_plugin_getenv(box->storage->user, "welcome_script");
- if (cmd != NULL) {
- bool wait = mail_user_plugin_getenv_bool(box->storage->user,
- "welcome_wait");
- script_execute(box->storage->user, cmd, wait);
- }
return wbox->module_ctx.super.open(box);
}