Hello,
as I wrote some days ago, I am missing support for "UW IMAP public
and shared folders". Today I looked over the source code and did=20
some simple modifications to the files 'functions/imap_general.php'
and 'functions/imap_mailbox.php' so that Squirrelmail now correctly
displays available shared and public folders for subscription.
I hope you will add this function to the development tree of =
Squirrelmail.
Because I don't know if it will work with other IMAP server than UW,
it will only be activated if an uw server has been installed.
functions/imap_general.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
(diff imap_general.php.jed imap_general.php.org > imap_general.php.diff)
12,13d11
< *
< * JED / 06.12.2002 - 'sqimap_get_shared_folders' function added
313,360d310
< }
<
<
< /**
< * JED / 06.12.2002
< *
< * This functions checks if shared and public folders exist on an
< * IMAP server. It has been tested with 'uw' but may also run with
< * other servers.
< *
< * input: IMAP stream
< * output: array of shared/public folders
< *
< * Gets shared namespace folders
< */
< function sqimap_get_shared_folders ($imap_stream) {
<
< require_once('../functions/array.php');
<
< global $sharedfolders;
< $sharedfolders =3D array();
<
< /* check if IMAP server supports NAMESPACE command */
< if (sqimap_capability($imap_stream, 'NAMESPACE')) {
< /* run NAMESPACE command */
< $read =3D sqimap_run_command($imap_stream, 'NAMESPACE', true, =
$a, $b);
<
< /* get third parameter -> shared folders */
< if (eregi('\\* NAMESPACE +(\\( *\\(.+\\) *\\)|NIL) +(\\( =
*\\(.+\\) *\\)|NIL) +(\\( *\\(.+\\) *\\)|NIL)', $read[0], $
data1)) {
< /* get list of shared folder names */
< if =
(eregi('"(.*)".*".*".*"(.*)".*".*".*"(.*)".*".*".*"(.*)".*".*"', =
$data1[3], $data2)) {
< /* check for existing folders */
< for ($i =3D 1; $i < count($data2); $i++) {
<
< /* check for mailboxes */
< fputs ($imap_stream, ". LIST \"$data2[$i]\" =
\"*\"\n");
< $read =3D sqimap_read_data($imap_stream, '.', =
true, $a, $b);
<
< /* mailbox found */
< if ($read) {
< eregi('#(.*)', $read[1], $data3);
< array_push($sharedfolders, chop($data3[0]));
< }
< }
< }
< }
< }
< return $sharedfolders;
functions/imap_mailbox.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
(diff imap_mailbox.php.jed imap_mailbox.php.org > imap_mailbox.php.diff)
12,14d11
< *
< * JED / 06.12.2002 - 'sqimap_mailbox_list_all' function modified, =
that
< * shared/public folders will be listed on uw IMAP =
servers
555,577d551
<
< /**
< * JED / 06.12.2002
< *
< * added support for IMAP shared/public folders on 'uw' servers
< *
< */
< /* check if uw imap server */
< if ($imap_server_type =3D 'uw') {
< /* get list of shared folders */
< $sharedfolders =3D sqimap_get_shared_folders ($imap_stream);
<
< for ($i =3D 0; $i < count($sharedfolders); $i++) {
< /* check if shared mailboxes exist */
< fputs ($imap_stream, $ssid . " LIST \"$sharedfolders[$i]\" =
*\r\n");
< $read_ary2 =3D sqimap_read_data ($imap_stream, $ssid, =
true, $response, $message);
<
< /* add shared mailbox to mailbox list */
< array_push($read_ary, $read_ary2[0]);
< }
< }
< /* JED */
<
Regards J=FCrgen
--=20
Mail: juergen.edner@...
PGP Key available
---
|