Uploaded image for project: 'Zeta Components'
  1. Zeta Components
  2. ZETACOMP-79

Add Iterate method to ezcMailParser and allow access through uids through intermediate ezcMailInfo struct

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Mail
    • None

    Description

      There are several problems with the ezcMailParser at the moment:

      1. It parses all mails at once, creating unnecessary memory overhead (although attachments are already handled very efficently)
      2. It does not expose information about the UID (in case of IMAP) that this mail belonged to. Without this information there is no way to reference the parsed mail for further actions.

      Solution:

      Add a new method ezcMailParser->iterate method that returns an iterator spitting out ezcMailInfo structs lazily (prototype impl):

      class ezcMailInfo
      {
      /** Optional, null if the set is NOT a ezcMailReferencableParserSet */
      public $id = null;
      /** @var ezcMail */
      public $mail;
      }

      The ID property contains the reference id for the underlying transport, for example with IMAP the UID.

      With this idea there comes a problem. The ezcMailParser currently has no access to the UID of the ezcMailImapSet. That means we have to introduce a new interface:

      interface ezcMailReferencableParserSet
      {
      public function getCurrentUniqueMessageId();
      }

      The IMAP Transport has to implement it and return the UID (or null if uidReference = false). The Parser could then use this information to access the message id.

      Attachments

        Activity

          People

            Unassigned Unassigned
            beberlei Benjamin Eberlei
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: