]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3: Fix to previous changes: Update \Seen flags even when not using QUIT.
authorTimo Sirainen <tss@iki.fi>
Thu, 5 Feb 2009 16:54:53 +0000 (11:54 -0500)
committerTimo Sirainen <tss@iki.fi>
Thu, 5 Feb 2009 16:54:53 +0000 (11:54 -0500)
--HG--
branch : HEAD

src/pop3/client.c
src/pop3/client.h
src/pop3/commands.c

index ff3599ffa0ca60defb0fcf2750b34524eae80eb5..77b10c3064d8263685135924a1d7e7808eadc2e2 100644 (file)
@@ -272,6 +272,9 @@ static const char *client_get_disconnect_reason(struct client *client)
 
 void client_destroy(struct client *client, const char *reason)
 {
+       if (client->seen_change_count > 0)
+               client_update_mails(client);
+
        if (!client->disconnected) {
                if (reason == NULL)
                        reason = client_get_disconnect_reason(client);
index e2bcef55b4acdebc9734df3d119259df4dbe6926..da08deeec53706290eb201548f7e931ac854bae7 100644 (file)
@@ -66,6 +66,7 @@ int client_send_line(struct client *client, const char *fmt, ...)
 void client_send_storage_error(struct client *client);
 
 bool client_handle_input(struct client *client);
+bool client_update_mails(struct client *client);
 
 void clients_init(void);
 void clients_deinit(void);
index bb78194073b584a416fbc45f42c0f78c564f6983..4759b7a431145e01dc3cd5fc61d0f16c955ef875 100644 (file)
@@ -195,7 +195,7 @@ pop3_search_build(struct client *client, uint32_t seq)
        return search_args;
 }
 
-static bool update_mails(struct client *client)
+bool client_update_mails(struct client *client)
 {
        struct mail_search_args *search_args;
        struct mail_search_context *ctx;
@@ -226,13 +226,14 @@ static bool update_mails(struct client *client)
        }
        mail_free(&mail);
 
+       client->seen_change_count = 0;
        return mailbox_search_deinit(&ctx) == 0;
 }
 
 static int cmd_quit(struct client *client, const char *args ATTR_UNUSED)
 {
        if (client->deleted || client->seen_bitmask != NULL) {
-               if (!update_mails(client)) {
+               if (!client_update_mails(client)) {
                        client_send_storage_error(client);
                        client_disconnect(client,
                                "Storage error during logout.");