]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
indexer-worker: Use provided session-id only as a prefix for a unique session ID.
authorTimo Sirainen <tss@iki.fi>
Wed, 18 Nov 2015 19:06:17 +0000 (21:06 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 18 Nov 2015 19:06:17 +0000 (21:06 +0200)
Fixes stats process's "Duplicate session ID" errors when LMTP delivers to
multiple recipients.

src/indexer/master-connection.c

index cab5f4add2c84d56b396caa6f8d3ffc31f0f4a94..08de9e4495af9831eeee98c7d6f761859dd7c3e8 100644 (file)
@@ -212,11 +212,12 @@ master_connection_input_line(struct master_connection *conn, const char *line)
        input.module = "mail";
        input.service = "indexer-worker";
        input.username = args[0];
-       /* if session-id is given, add -idx suffix to it so that stats process
-          doesn't complain about duplicates. also it's nicer to keep the stats
-          separate for the indexer and the caller. */
-       input.session_id = args[2][0] == '\0' ? NULL :
-               t_strconcat(args[2], "-idx", NULL);
+       /* if session-id is given, use it as a prefix to a unique session ID.
+          we can't use the session-id directly or stats process will complain
+          about duplicates. (especially LMTP would use the same session-id for
+          multiple users' indexing at the same time.) */
+       if (args[2][0] != '\0')
+               input.session_id_prefix = args[2];
 
        if (mail_storage_service_lookup_next(conn->storage_service, &input,
                                             &service_user, &user, &error) <= 0) {