From b39825f012b48ea8b60c3954f5f551fa9095c26b Mon Sep 17 00:00:00 2001 From: kink Date: Fri, 24 Dec 2004 15:45:33 +0000 Subject: [PATCH] Add server type 'hmailserver' to work around a searching problem with hMailServer. Fixes: #1085377 git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8462 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 2 ++ config/conf.pl | 32 +++++++++++++++++++------------- config/config_default.php | 3 ++- doc/presets.txt | 18 ++++++++++++------ functions/imap_search.php | 6 +++--- 5 files changed, 38 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43b6fca2..46e67ce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -165,6 +165,8 @@ Version 1.5.1 -- CVS - Added sq_setlocale function in order to use multiple locale names. - Added size attributes to new_mail sound tags. Fixes #818958. - Removed extra ; in SquirrelMail added Received header per RFC 822. Fixes #1088548. + - Add IMAP server type "hmailserver" to make search work with hMailServer. + Fixes #1085377. Version 1.5.0 -------------------- diff --git a/config/conf.pl b/config/conf.pl index acba9314..6c8fdfb4 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -1075,12 +1075,13 @@ sub command19 { print "these servers. If you would like to use them, please select your\n"; print "IMAP server. If you do not wish to use these work-arounds, you can\n"; print "set this to \"other\", and none will be used.\n"; - print " cyrus = Cyrus IMAP server\n"; - print " uw = University of Washington's IMAP server\n"; - print " exchange = Microsoft Exchange IMAP server\n"; - print " courier = Courier IMAP server\n"; - print " macosx = Mac OS X Mailserver\n"; - print " other = Not one of the above servers\n"; + print " cyrus = Cyrus IMAP server\n"; + print " uw = University of Washington's IMAP server\n"; + print " exchange = Microsoft Exchange IMAP server\n"; + print " courier = Courier IMAP server\n"; + print " macosx = Mac OS X Mailserver\n"; + print " hmailserver = hMailServer\n"; + print " other = Not one of the above servers\n"; print "[$WHT$imap_server_type$NRM]: $WHT"; $new_imap_server_type = ; @@ -3384,13 +3385,14 @@ sub set_defaults { $continue = 0; while ( $continue != 1 ) { print "Please select your IMAP server:\n"; - print " cyrus = Cyrus IMAP server\n"; - print " uw = University of Washington's IMAP server\n"; - print " exchange = Microsoft Exchange IMAP server\n"; - print " courier = Courier IMAP server\n"; - print " macosx = Mac OS X Mailserver\n"; - print " mercury32 = Mercury/32\n"; - print " quit = Do not change anything\n"; + print " cyrus = Cyrus IMAP server\n"; + print " uw = University of Washington's IMAP server\n"; + print " exchange = Microsoft Exchange IMAP server\n"; + print " courier = Courier IMAP server\n"; + print " macosx = Mac OS X Mailserver\n"; + print " hmailserver = hMailServer\n"; + print " mercury32 = Mercury/32\n"; + print " quit = Do not change anything\n"; print "Command >> "; $server = ; $server =~ s/[\r\n]//g; @@ -3468,6 +3470,10 @@ sub set_defaults { $disp_default_folder_prefix = $default_folder_prefix; $continue = 1; + } elsif ( $server eq "hmailserver" ) { + $imap_server_type = "hmailserver"; + + $continue = 1; } elsif ( $server eq "mercury32" ) { $imap_server_type = "mercury32"; $default_folder_prefix = ""; diff --git a/config/config_default.php b/config/config_default.php index fe4c4a84..3109247b 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -192,6 +192,7 @@ $imapPort = 143; * exchange * uw * macosx + * hmailserver * mercury32 * other * @@ -968,4 +969,4 @@ $config_use_color = 2; * sent and regular output to begin, which will majorly screw * things up when we try to send more headers later. */ -?> \ No newline at end of file +?> diff --git a/doc/presets.txt b/doc/presets.txt index 6b6e7f05..730bb631 100644 --- a/doc/presets.txt +++ b/doc/presets.txt @@ -6,12 +6,13 @@ It can be used if user can't run conf.pl and changes options manually. Settings can be different if IMAP server uses shared folders. Possible server values are: - cyrus = Cyrus IMAP server - uw = University of Washington's IMAP server - exchange = Microsoft Exchange IMAP server - courier = Courier IMAP server - macosx = Mac OS X Mailserver - mercury32 = Mercury/32 + cyrus = Cyrus IMAP server + uw = University of Washington's IMAP server + exchange = Microsoft Exchange IMAP server + courier = Courier IMAP server + macosx = Mac OS X Mailserver + hmailserver = hMailServer + mercury32 = Mercury/32 ----------------- default settings: @@ -104,6 +105,11 @@ show_contain_subfolders_option = false delete_folder = true force_username_lowercase = false +------------------ +'hmailserver' settings: +------------------ + imap_server_type = hmailserver (used in imap_search.php) + ------------------- 'mercury' settings: ------------------- diff --git a/functions/imap_search.php b/functions/imap_search.php index d6ea4cb0..0769993c 100644 --- a/functions/imap_search.php +++ b/functions/imap_search.php @@ -36,7 +36,7 @@ function sqimap_search($imapConnection, $search_where, $search_what, $mailbox, $multi_search = explode(' ', $search_what); $search_string = ''; - /* it seems macosx does not support the prefered search + /* it seems macosx and hmailserver do not support the prefered search syntax so we fall back to the older style. This IMAP server has a problem with multiple search terms. Instead of returning the messages that match all the terms it @@ -44,7 +44,7 @@ function sqimap_search($imapConnection, $search_where, $search_what, $mailbox, on the client side, but should be fixed on the server as per the RFC */ - if ($imap_server_type == 'macosx') { + if ($imap_server_type == 'macosx' || $imap_server_type == 'hmailserver') { foreach ($multi_search as $multi_search_part) { if (strtoupper($languages[$squirrelmail_language]['CHARSET']) == 'ISO-2022-JP') { $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'auto'); @@ -122,4 +122,4 @@ function sqimap_search($imapConnection, $search_where, $search_what, $mailbox, -?> \ No newline at end of file +?> -- 2.25.1