bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] Re: IMAP protocol violation in 1.1


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] Re: IMAP protocol violation in 1.1
Date: Sat, 16 Aug 2008 23:14:47 +0300

Simon Josefsson <address@hidden> ha escrit:

> * STATUS INBOX.Trash (UNSEEN 3 )
> 
> The space after 3 and before ) isn't permitted by the ABNF.

Yes, indeed.  Thanks for reporting.  Attached is a patch.

> 446 OK STATUS Completed
> 447 EXPUNGE
> 447 OK EXPUNGE Completed
> 448 UID SEARCH UNSEEN UNDELETED
> * SEARCH
> 
> Huh!  The UNSEEN flags are now gone?  How did that happen?

They definitely should not have.  I was unable to reproduce this,
however.  Am I missing some prerequisites?

> Maybe there is some confusion between SEEN and RECENT?  RECENT should be
> cleared when you re-SELECT a mailbox, but SEEN should only be changed
> when the client set flags.

Not quite so.  The \Seen flag is changed implicitly by several IMAP
commands, in particular by FETCH (BODY[]).  As for \Recent, it means
that this session is the first one that sees this message.  I did not
find in RFC 3501 any indication that SELECT should clear this flag.  In
my opinion, it should not.

Regards,
Sergey

Index: imap4d/status.c
===================================================================
RCS file: /cvsroot/mailutils/mailutils/imap4d/status.c,v
retrieving revision 1.29
diff -p -u -r1.29 status.c
--- imap4d/status.c     10 Aug 2008 21:34:49 -0000      1.29
+++ imap4d/status.c     16 Aug 2008 18:28:23 -0000
@@ -97,6 +97,7 @@ imap4d_status (struct imap4d_command *co
       status = mu_mailbox_open (smbox, MU_STREAM_READ);
       if (status == 0)
        {
+          int space_sent = 0;
          int i = IMAP4_ARG_2;
          char *item = imap4d_tokbuf_getarg (tok, i);
          
@@ -122,9 +123,14 @@ imap4d_status (struct imap4d_command *co
                  
              if (count++ == 0)
                util_send ("* STATUS %s (", name);
+             else if (!space_sent)
+                {
+                  space_sent = 1;
+                 util_send (" ");
+                }     
 
              if (!fun (smbox))
-               util_send (" ");
+                space_sent = 0;
            }
 
          

reply via email to

[Prev in Thread] Current Thread [Next in Thread]