Subject: | exists() does a STATUS than can go to a disconnexion or wrong folders() reply |
Hello Phil,
1) exists() calls STATUS. Some IMAP servers like Exchange disconnect
after ten STATUS fails with NO.
2) folders( $folder ) calls the good LIST but it also
calls exists( $folder ) so STATUS is called the
response of folders( $folder ) is void if STATUS is NO.
Example with folders( 'DTU' )
a STATUS is called and fails even if \Noselect
is given previously by the server.
Sending: 7 LIST "" "DTU/*"
Sent 19 bytes
Read: * LIST (\Noselect \HasChildren) "/" "DTU/"
* LIST (\NoInferiors \UnMarked) "/" "DTU/Vestervang"
...
Example with folders( 'DTU/*' )
could be good (no STATUS called) but folders( 'DTU/*' )
replies an empty list that should not be an empty
(many subfolders here).
Even a folders( 'DTU/*' ) doesn't work.
Sending: 6 LIST "" "DTU/*"
Sent 19 bytes
Read: * LIST (\Noselect \HasChildren) "/" "DTU/"
* LIST (\NoInferiors \UnMarked) "/" "DTU/Vestervang"
Some quotes from the IMAP RFC 3501
http://www.faqs.org/rfcs/rfc3501.html
suggesting STATUS is not adequate for exists().
"the STATUS command SHOULD NOT be used on the
currently selected mailbox."
"Because the STATUS command is not guaranteed to be fast
in its results, clients SHOULD NOT expect to be able to
issue many consecutive STATUS commands and obtain
reasonable performance."
"Unlike the LIST command, the STATUS command is not guaranteed to
be fast in its response."
I suggest to use LIST instead of STATUS in the exists()
implementation and correct folders() to permit top level
folders that are not selectable but have children.
Thanks in advance Phil.