flourishlib / flourish-classes

The class files for Flourish
http://flourishlib.com
182 stars 78 forks source link

fMailbox->listMessages not retrieve all messages #137

Open pjbeardsley opened 12 years ago

pjbeardsley commented 12 years ago

Ticket #718 by subba

Seen some situtations where listmessages not getting all messages from mailbox. UID and messages missing in list

In webmail those messages are all unread and ok

wbond commented 12 years ago

Unfortunately there is not enough info to debug this. Most likely the user was using gmail with pop3, which only ever allows you to see an email once. Subsequent calls to list do not return the message, even if it is visible in the web interface.

subba82 commented 12 years ago

When you fetch messages received show 6 exists messages in inbox. But after UID INTERNALDATE RFC822.SIZE ENVELOPE there is list of those 6 messages. If there is email fetch in two lines it's not read to returning array. Test not from gmail and used IMAP

Example where UID 4822 can't read into array

Sending:
a0002 SELECT "INBOX"
Received:
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 6 EXISTS
* 0 RECENT
* OK [UNSEEN 2] First unseen.
* OK [UIDVALIDITY 1316042402] UIDs valid
* OK [UIDNEXT 4833] Predicted next UID
* OK [HIGHESTMODSEQ 1] Highest
a0002 OK [READ-WRITE] Select completed.
Sending:
a0003 STATUS "INBOX" (MESSAGES)
Received:
* STATUS "INBOX" (MESSAGES 6)
a0003 OK [CLIENTBUG] Status on selected mailbox completed.
Sending:
a0004 FETCH 1:* (UID INTERNALDATE RFC822.SIZE ENVELOPE)
Received:

* 2 FETCH (UID 4822 INTERNALDATE "24-Sep-2012 00:02:47 +0300" RFC822.SIZE 4539 ENVELOPE ("Mon, 24 Sep 2012 00:02:01 +0300 (EEST)" {25}
"Android ohjelmat" update (("MuroBBS - Plaza" NIL "noreply" "muropaketti.com")) (("MuroBBS - Plaza" NIL "noreply" "muropaketti.com")) (("MuroBBS - Plaza" NIL "noreply" "muropaketti.com")) ((NIL NIL "xxxxxxxxx" "xxxxxxxxx.net")) NIL NIL NIL "<20120923210201.f0b5d96e232b@murobbs.plaza.fi>"))
karthickkumarganesh commented 11 years ago

hi am getting the same issue where list messsage fails to retrive when email subject contains "(double quotes) in content for example Reg: "test content' attached

karthickkumarganesh commented 11 years ago

when i check with the FETCH command ,i get like this

there is some thing unwanted {19} in fetch command

karthickkumarganesh commented 10 years ago

i had solved this issue by doing some pattern replace and successfully resolved and fetch all Email , below are my code which help me achive this

please add this code to fMailbox.php after the line

$output = array(); line no nearly 1117

        $response = $this -> write('FETCH ' . $messages . ' (UID INTERNALDATE RFC822.SIZE ENVELOPE)');
        $hintter = implode(' ', $response);
        $pattern = '(\{[0-9]+\})';

        if (preg_match($pattern, $hintter, $match)) {

            $responses = preg_replace($pattern, '', $response);
            $responsesnew = array();
            $i = 0;
            $j = 0;
            foreach ($responses as $reps) {

                if (substr(trim($reps), 0, 1) != '*') {
                    $responsesnew[$i] = $responses[$j - 1] . $reps;
                    $i++;
                }

                $j++;

            }
        } else {
            $responsesnew = $response;
        }

and change the foreach parameters to foreach ($responsesnew as $line)
from foreach ($responsesnew as $line)

this will first fetch the problamatic Email and then on next turn fetch normal emails