diff -ur dovecot-1.0-test72.orig/src/pop3/commands.c dovecot-1.0-test72/src/pop3/commands.c --- dovecot-1.0-test72.orig/src/pop3/commands.c 2005-05-24 00:17:35.000000000 +0200 +++ dovecot-1.0-test72/src/pop3/commands.c 2005-06-02 11:32:49.562728136 +0200 @@ -47,6 +47,7 @@ if (client->deleted) { if (client->deleted_bitmask[num / CHAR_BIT] & (1 << (num % CHAR_BIT))) { + i_info("get_msgnum: msg %u is deleted", num+1); client_send_line(client, "-ERR Message is deleted."); return NULL; } @@ -98,16 +99,24 @@ unsigned int msgnum; if (get_msgnum(client, args, &msgnum) == NULL) - return FALSE; + { + i_info("DELE msg does not exits or is deleted %s", args); + return FALSE; + } if (!client->deleted) { + i_info("DELE creating bitmap of size %u with room for %u msgs", + MSGS_BITMASK_SIZE(client), + MSGS_BITMASK_SIZE(client)*CHAR_BIT); client->deleted_bitmask = i_malloc(MSGS_BITMASK_SIZE(client)); client->deleted = TRUE; } - client->deleted_bitmask[msgnum / CHAR_BIT] |= 1 << (msgnum % CHAR_BIT); + client->deleted_bitmask[msgnum / CHAR_BIT] |= (1 << (msgnum % CHAR_BIT)); client->deleted_count++; client->deleted_size += client->message_sizes[msgnum]; + i_info("DELE msg %u deleted (%u/%u deleted)", + msgnum+1, client->deleted_count, client->messages_count); client_send_line(client, "+OK Marked to be deleted."); return TRUE; } @@ -153,13 +162,17 @@ client->cmd = cmd_list_callback; client->cmd_context = ctx; + i_info("LIST *"); cmd_list_callback(client); } else { unsigned int msgnum; if (get_msgnum(client, args, &msgnum) == NULL) - return FALSE; - + { + i_info("LIST no such msg %u", msgnum); + return FALSE; + } + i_info("LIST %u", msgnum); client_send_line(client, "+OK %u %"PRIuUOFF_T, msgnum+1, client->message_sizes[msgnum]); } @@ -175,6 +188,7 @@ static int cmd_noop(struct client *client, const char *args __attr_unused__) { + i_info("NOOP"); client_send_line(client, "+OK"); return TRUE; } @@ -188,7 +202,10 @@ int ret = TRUE; if (client->deleted_bitmask == NULL) + { + i_info("expunge: no deleted messages"); return TRUE; + } memset(&search_arg, 0, sizeof(search_arg)); search_arg.type = SEARCH_ALL; @@ -201,6 +218,8 @@ 1 << (idx % CHAR_BIT)) != 0) { if (mail_expunge(mail) < 0) { ret = FALSE; + i_info("expunge: failed to expunge %u", + idx/CHAR_BIT); break; } } @@ -209,11 +228,13 @@ if (mailbox_search_deinit(ctx) < 0) ret = FALSE; + i_info("expunge: done"); return ret; } static int cmd_quit(struct client *client, const char *args __attr_unused__) { + i_info("QUIT"); if (client->deleted) { if (!expunge_mails(client)) { client_send_storage_error(client); @@ -221,15 +242,16 @@ return TRUE; } } - mailbox_transaction_commit(client->trans, MAILBOX_SYNC_FLAG_FULL_WRITE); client->trans = NULL; + i_info("QUIT: transaction commit done"); if (!client->deleted) client_send_line(client, "+OK Logging out."); else client_send_line(client, "+OK Logging out, messages deleted."); + i_info("QUIT: disconnecting"); client_disconnect(client, "Logout."); return TRUE; } @@ -404,7 +426,10 @@ unsigned int msgnum; if (get_msgnum(client, args, &msgnum) == NULL) + { + i_info("RETR: no such msg %s", args); return FALSE; + } if (client->last_seen <= msgnum) client->last_seen = msgnum+1; @@ -413,6 +438,7 @@ client->byte_counter = &client->retr_bytes; client->byte_counter_offset = client->output->offset; + i_info("RETR: fetch %u", msgnum+1); fetch(client, msgnum, (uoff_t)-1); return TRUE; } @@ -423,6 +449,7 @@ struct mail *mail; struct mail_search_arg search_arg; + i_info("RSET"); client->last_seen = 0; if (client->deleted) { @@ -459,6 +486,7 @@ static int cmd_stat(struct client *client, const char *args __attr_unused__) { + i_info("STAT"); client_send_line(client, "+OK %u %"PRIuUOFF_T, client-> messages_count - client->deleted_count, client->total_size - client->deleted_size); @@ -470,6 +498,7 @@ unsigned int msgnum; uoff_t max_lines; + i_info("TOP"); args = get_msgnum(client, args, &msgnum); if (args == NULL) return FALSE; @@ -619,6 +648,7 @@ struct cmd_uidl_context *ctx; if (*args == '\0') { + i_info("UIDL *"); client_send_line(client, "+OK"); ctx = cmd_uidl_init(client, 0); list_uids_iter(client, ctx); @@ -626,8 +656,12 @@ unsigned int msgnum; if (get_msgnum(client, args, &msgnum) == NULL) + { + i_info("UIDL no such msg %u", msgnum); return FALSE; + } + i_info("UIDL msg %u", msgnum); ctx = cmd_uidl_init(client, msgnum+1); if (!list_uids_iter(client, ctx)) client_send_line(client, "-ERR Message not found.");