]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Set struct mail_users.autocreated for raw/shared users.
authorTimo Sirainen <tss@iki.fi>
Thu, 1 Sep 2011 03:13:26 +0000 (06:13 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 1 Sep 2011 03:13:26 +0000 (06:13 +0300)
src/lda/main.c
src/lib-storage/index/shared/shared-storage.c
src/lib-storage/mail-user.h
src/lmtp/client.c

index 09a1f26b360130be048e042a667b505acd9d19f4..f2416ac0878afcca2200202c08ac9d4384c3a713 100644 (file)
@@ -372,6 +372,7 @@ int main(int argc, char *argv[])
        /* create a separate mail user for the internal namespace */
        sets = master_service_settings_get_others(master_service);
        raw_mail_user = mail_user_alloc(user, ctx.dest_user->set_info, sets[0]);
+       raw_mail_user->autocreated = TRUE;
        mail_user_set_home(raw_mail_user, "/");
        if (mail_user_init(raw_mail_user, &errstr) < 0)
                i_fatal("Raw user initialization failed: %s", errstr);
index d43a5e72fb7e3f94ac3f2f99bba8a1e875df0825..07f7ada828740750548d0ec23250601c639bae07 100644 (file)
@@ -231,6 +231,7 @@ int shared_storage_get_namespace(struct mail_namespace **_ns,
 
        owner = mail_user_alloc(userdomain, user->set_info,
                                user->unexpanded_set);
+       owner->autocreated = TRUE;
        if (!var_has_key(storage->location, 'h', "home"))
                ret = 1;
        else {
index ab782afa3c02896e2f26674ddb7332d6e1c5f40f..a9307c0592924ed2141d433b68cf1156e5bd0a59 100644 (file)
@@ -42,6 +42,9 @@ struct mail_user {
        /* User is an administrator. Allow operations not normally allowed
           for other people. */
        unsigned int admin:1;
+       /* This is an autocreated user (e.g. for shared namespace or
+          lda raw storage) */
+       unsigned int autocreated:1;
        /* mail_user_init() has been called */
        unsigned int initialized:1;
        /* Shortcut to mail_storage_settings.mail_debug */
index a53e3d7c2c983731039223e11d071fcf04a235b6..e7fd4f1a531c930e4dcc11b35fcefd3730e3e47e 100644 (file)
@@ -132,6 +132,7 @@ static void client_raw_user_create(struct client *client)
 
        client->raw_mail_user = mail_user_alloc("raw user",
                                                client->user_set_info, sets[0]);
+       client->raw_mail_user->autocreated = TRUE;
        mail_user_set_home(client->raw_mail_user, "/");
        if (mail_user_init(client->raw_mail_user, &error) < 0)
                i_fatal("Raw user initialization failed: %s", error);