Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9186957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:39:22+00:00 2026-06-17T19:39:22+00:00

Update It seems to be the way untagged responses are handled by twisted, the

  • 0

Update It seems to be the way untagged responses are handled by twisted, the only example I have found seem to iterate through the data received and somehow collect the response to their command though I am not sure how…


I am trying to implement the IMAP4 quota commands as defined in RFC 2087 ( https://www.rfc-editor.org/rfc/rfc2087 ).

Code – ImapClient

class SimpleIMAP4Client(imap4.IMAP4Client):
    """
        A client with callbacks for greeting messages from an IMAP server.
        """
    greetDeferred = None
    
    def serverGreeting(self, caps):
        self.serverCapabilities = caps
        if self.greetDeferred is not None:
            d, self.greetDeferred = self.greetDeferred, None
            d.callback(self)
    
    def lineReceived(self, line):
        print "<" + str(line)
        return imap4.IMAP4Client.lineReceived(self, line)

    def sendLine(self, line):
        print ">" + str(line)
        return imap4.IMAP4Client.sendLine(self, line)

Code – QUOTAROOT Implementation

def cbExamineMbox(result, proto):
    """
        Callback invoked when examine command completes.
        
        Retrieve the subject header of every message in the mailbox.
        """
    print "Fetching storage space"
    cmd = "GETQUOTAROOT"
    args =  _prepareMailboxName("INBOX")
    resp = ("QUOTAROOT", "QUOTA")
    d = proto.sendCommand(Command(cmd, args, wantResponse=resp))
    d.addCallback(cbFetch, proto)
    return d

def cbFetch(result, proto):
    """
        Finally, display headers.
        """
    print "Got Quota"
    print result

Output

Fetching storage space
>0005 GETQUOTAROOT INBOX
<* QUOTAROOT "INBOX" ""
<* QUOTA "" (STORAGE 171609 10584342)
<0005 OK Success
Got Quota
([], 'OK Success')

So I am getting the data but the result doesn’t contain it, I am thinking it is because they are untagged responses?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:39:23+00:00Added an answer on June 17, 2026 at 7:39 pm

    Since the IMAP4 protocol mixes together lots of different kinds of information as “untagged responses”, you probably also need to update some other parts of the parsing code in the IMAP4 client implementation.

    Specifically, take a look at twisted.mail.imap4.Command and its finish method. Also look at twisted.mail.imap4.IMAP4Client._extraInfo, which is what is passed as the unusedCallback to Command.finish.

    To start, you can check to see if the untagged responses to the QUOTA command are being sent to _extraInfo (and then dropped (well, logged)).

    If so, I suspect you want to teach Command to recognize QUOTA and QUOTAROOT untagged responses to the QUOTA command, so that it collects them and sends them as part of the result it fires its Deferred with.

    If not, you may need to dig a bit deeper into the logic of Command.finish to see where the data does end up.

    You may also want to actually implement the Command.wantResponse feature, which appears to be only partially formed currently (ie, lots of client code tries to send interesting values into Command to initialize that attribute, but as far as I can tell nothing actually uses the value of that attribute).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update Solution Found See Bottom of post if interested Seems simple enough and for
UPDATE It seems to have magically corrected itself because now it works, but I
UPDATE: Seems to me like it is pretty much an Apple bug. I tried
Update : The error seems to be generated by this line: *line = color;
-----UPDATE----- Well, seems that the problem was in last.id . When database is created
Since recent update Xcode 4.3 now seems to default to LLDB debugger. I just
UPDATE: I've been playing around with this more, and it seems like tmux's clear-history
I want to update fontconfig to a newer version but it seems that the
Update: This is, as I was told, no principle Python related problem, but seems
The code seems not working. // $counter is an instance of Zend_Db_Table_Abstract $counter->update(array('hits' =>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.