Opened 11 years ago

#4062 enhancement new

IMAP fetchSpecific should allow returning FLAGS

Reported by: Colin Alston Owned by:
Priority: normal Milestone:
Component: mail Keywords: pleasefortheloveofgodmergethis
Cc: Branch:
Author:

Description

I envisage no situation on earth where someone would not want FLAGS returned, and fetchSpecific looks like the most handy way to do listings. The inability here to request FLAGS makes serious complications.

+++ imap4.py    2009-10-20 15:42:26.000000000 +0200
@@ -3377,7 +3377,7 @@

     def fetchSpecific(self, messages, uid=0, headerType=None,
                       headerNumber=None, headerArgs=None, peek=None,
-                      offset=None, length=None):
+                      offset=None, length=None, flags=0):
         """Retrieve a specific section of one or more messages

         @type messages: C{MessageSet} or C{str}
@@ -3417,12 +3417,19 @@
         @type length: C{int}
         @param length: The number of octets to retrieve.

+        @type flags: C{bool}
+        @param flags: Return FLAGS with the result
+
         @rtype: C{Deferred}
         @return: A deferred whose callback is invoked with a mapping of
         message numbers to retrieved data, or whose errback is invoked
         if there is an error.
         """
-        fmt = '%s BODY%s[%s%s%s]%s'
+        if flags:
+            fmt = '%s (FLAGS BODY%s[%s%s%s]%s)'
+        else:
+            fmt = '%s BODY%s[%s%s%s]%s'
+
         if headerNumber is None:
             number = ''
         elif isinstance(headerNumber, types.IntType):

Change History (1)

comment:1 Changed 10 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.