lmtp should also do this, but it needs a bit larger changes.
/* i/ostreams are already closed at this stage, so fd can be closed */
fd_close_maybe_stdio(&client->fd_in, &client->fd_out);
+ /* refresh proctitle before a potentially long-running user unref */
+ imap_refresh_proctitle();
/* Free the user after client is already disconnected. It may start
some background work like autoexpunging. */
mail_user_unref(&client->user);
if (o_stream_is_corked(client->output))
str_append(title, " corked");
}
+ if (client->destroyed)
+ str_append(title, " (deinit)");
break;
default:
str_printfa(title, "%u connections", imap_client_count);
indexer_worker_refresh_proctitle(user->username, args[1], 0, 0);
ret = index_mailbox(conn, user, args[1],
max_recent_msgs, args[4]);
- indexer_worker_refresh_proctitle(NULL, NULL, 0, 0);
+ /* refresh proctitle before a potentially long-running
+ user unref */
+ indexer_worker_refresh_proctitle(user->username, "(deinit)", 0, 0);
mail_user_unref(&user);
mail_storage_service_user_unref(&service_user);
+ indexer_worker_refresh_proctitle(NULL, NULL, 0, 0);
}
str = ret < 0 ? "-1\n" : "100\n";
str_append_c(title, ' ');
str_append(title, net_ip2addr(client->user->remote_ip));
}
+ if (client->destroyed)
+ str_append(title, " (deinit)");
break;
default:
str_printfa(title, "%u connections", pop3_client_count);
mail_user_get_anvil_userip_ident(client->user),
"\n", NULL));
}
+
+ /* refresh proctitle before a potentially long-running user unref */
+ pop3_refresh_proctitle();
mail_user_unref(&client->user);
if (client->session_dotlock != NULL)