aboutsummaryrefslogtreecommitdiffstats
path: root/mail/squirrelmail
diff options
context:
space:
mode:
authortabthorpe <tabthorpe@FreeBSD.org>2010-01-05 05:12:48 +0800
committertabthorpe <tabthorpe@FreeBSD.org>2010-01-05 05:12:48 +0800
commit35fe676fa31accb6ee96b8f730cf558d2f5d2b71 (patch)
tree36584d990c2ba2d95cda3f284cfe23ed3b8271cc /mail/squirrelmail
parent6a26bdd70f42582388637d77f922890e1ea7e538 (diff)
downloadfreebsd-ports-gnome-35fe676fa31accb6ee96b8f730cf558d2f5d2b71.tar.gz
freebsd-ports-gnome-35fe676fa31accb6ee96b8f730cf558d2f5d2b71.tar.zst
freebsd-ports-gnome-35fe676fa31accb6ee96b8f730cf558d2f5d2b71.zip
- Really fix IMAP search
- Bump PORTREVISION PR: ports/141736 Submitted by: Yuri Pankov <yuri.pankov gmail.com>
Diffstat (limited to 'mail/squirrelmail')
-rw-r--r--mail/squirrelmail/Makefile2
-rw-r--r--mail/squirrelmail/files/patch-functions__imap_search.php62
2 files changed, 31 insertions, 33 deletions
diff --git a/mail/squirrelmail/Makefile b/mail/squirrelmail/Makefile
index cb1864457b1e..6b645823eada 100644
--- a/mail/squirrelmail/Makefile
+++ b/mail/squirrelmail/Makefile
@@ -7,7 +7,7 @@
PORTNAME= squirrelmail
PORTVERSION= 1.4.20.r2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= mail www
MASTER_SITES= SF/${PORTNAME}/stable/${PORTVERSION:S/.r/-RC/}:squirrelmail \
SF/${PORTNAME}/locales/1.4.18-20090526:locales
diff --git a/mail/squirrelmail/files/patch-functions__imap_search.php b/mail/squirrelmail/files/patch-functions__imap_search.php
index 1f1ca53b053d..2bd94460d74d 100644
--- a/mail/squirrelmail/files/patch-functions__imap_search.php
+++ b/mail/squirrelmail/files/patch-functions__imap_search.php
@@ -1,9 +1,26 @@
---- ./functions/imap_search.php.orig 2009-11-09 11:29:39.000000000 -0500
-+++ ./functions/imap_search.php 2009-11-09 11:38:35.000000000 -0500
-@@ -46,22 +46,23 @@
- on the client side, but should be fixed on the server
- as per the RFC */
+--- functions/imap_search.php 2009/07/29 02:21:06 13800
++++ functions/imap_search.php 2009/12/14 21:18:29 13877
+@@ -5,7 +5,7 @@
+ *
+ * IMAP search routines
+ *
+- * @copyright &copy; 1999-2009 The SquirrelMail Project Team
++ * @copyright 1999-2009 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+@@ -38,30 +38,17 @@
+ $multi_search = explode(' ', $search_what);
+ $search_string = '';
+- /* 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
+- returns the messages that match each term. Could be fixed
+- on the client side, but should be fixed on the server
+- as per the RFC */
+-
- 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') {
@@ -15,13 +32,7 @@
+ $multi_search[$idx] = mb_convert_encoding($search_parth, 'JIS', 'auto');
}
}
-+
-+ $search_lit = array();
-+
-+ if ($imap_server_type == 'macosx' || $imap_server_type == 'hmailserver') {
-+ $search_string .= $search_where . ' ' . implode(' ', $multi_search);
-+ }
- else {
+- else {
- 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');
@@ -29,29 +40,16 @@
- $search_string .= $search_where . ' {' . strlen($multi_search_part)
- . "}\r\n" . $multi_search_part . ' ';
- }
-+ $search_string .= $search_where;
-+ $search_lit = array(
-+ 'command' => '',
-+ 'literal_args' => $multi_search
-+ );
++
++ foreach ($multi_search as $string) {
++ $search_string .= $search_where
++ . ' "'
++ . str_replace(array('\\', '"'), array('\\\\', '\\"'), $string)
++ . '" ';
}
$search_string = trim($search_string);
-@@ -76,15 +77,24 @@
- $ss = "SEARCH ALL $search_string";
- }
-
-- /* read data back from IMAP */
-- $readin = sqimap_run_command($imapConnection, $ss, false, $result, $message, $uid_support);
-+ if (empty($search_lit)) {
-+ /* read data back from IMAP */
-+ $readin = sqimap_run_command($imapConnection, $ss, false, $result, $message, $uid_support);
-+ } else {
-+ $search_lit['command'] = $ss;
-+ $readin = sqimap_run_literal_command($imapConnection, $search_lit, false, $result, $message, $uid_support);
-+ }
-
- /* try US-ASCII charset if search fails */
+@@ -83,8 +70,12 @@
if (isset($languages[$squirrelmail_language]['CHARSET'])
&& strtolower($result) == 'no') {
$ss = "SEARCH CHARSET \"US-ASCII\" ALL $search_string";