Ticket #2226 (new enhancement)
wish: Let me know if POP messages has been lost
| Reported by: | tamo@… | Owned by: | mutt-dev |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | mutt | Version: | 1.5.11 and CVS |
| Keywords: | patch | Cc: |
Description
If POP server automatically removes a message while mutt is in the box,
(1) ctx->hdrs[i]->refno will be changed to -1,
(2) ctx->hdrs[i]->deleted will be set to 1, and
(3) ctx->deleted will NOT be set.
All the above are done with no message at all.
I want some warning message.
>How-To-Repeat:
0. Press 'c'.
1. Input a POP box name.
2. (Server accidentally loses a message)
3. (Timeout occurs)
4. You find the message was silently marked as deleted!
>Fix:
diff -p -u -r3.9 pop.c
--- pop.c 21 Oct 2005 04:35:37 -0000 3.9
+++ pop.c 14 May 2006 06:13:24 -0000
@@ -167,7 +167,7 @@ static int fetch_uidl (char *line, void
*/
static int pop_fetch_headers (CONTEXT *ctx)
{
- int i, ret, old_count, new_count;
+ int i, ret, old_count, new_count, deleted;
POP_DATA *pop_data = (POP_DATA *)ctx->data;
time (&pop_data->check_time);
@@ -202,9 +202,20 @@ static int pop_fetch_headers (CONTEXT *c
if (ret == 0)
{
- for (i = 0; i < old_count; i++)
+ for (i = 0, deleted = 0; i < old_count; i++)
+ {
if (ctx->hdrs[i]->refno == -1)
+ {
ctx->hdrs[i]->deleted = 1;
+ deleted++;
+ }
+ }
+ if (deleted > 0)
+ {
+ mutt_error (_("%d messages have been lost. "
+ "You'd better re-open this box."), deleted);
+ mutt_sleep (2);
+ }
for (i = old_count; i < new_count; i++)
{
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
