6.0.0-git
2019-07-19

[#14429] Procmail rule with Umlaut wrong folder because backslash
Summary Procmail rule with Umlaut wrong folder because backslash
Queue Ingo
Queue Version 3.2.11
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester samuel.wolf (at) wolf-maschinenbau (dot) de
Created 2016-07-27 (1087 days ago)
Due
Updated 2017-10-20 (637 days ago)
Assigned 2016-07-31 (1083 days ago)
Resolved 2016-08-01 (1082 days ago)
Milestone
Patch No

History
2017-10-20 20:33:42 Git Commit Comment #14 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 657fa85d249ba4bf7a62f51f7be78bf7289b8943
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Fri, 29 Jul 2016 11:22:10 -0400

Bug: 14429 Escape mailbox before converting to utf7imap.

  M lib/Script/Procmail/Recipe.php

https://github.com/horde/ingo/commit/657fa85d249ba4bf7a62f51f7be78bf7289b8943
2016-08-01 08:14:59 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #13 Reply to this comment
2016-08-01 03:21:03 Michael Rubinsky Comment #12
State ⇒ Resolved
Reply to this comment
Actually, this is all moot anyway. For utf7-imap encoded mailbox 
names, using escapeshellcmd will corrupt mailbox names that contain 
things like '&' anyway since these are encoded in a different way. 
I.e, we can't escape here anyway.

Fixed in Git:
https://github.com/horde/horde/commit/fe8e7606e6e06626f574877b0ff0e6e1f963d099
2016-07-31 22:41:42 Michael Rubinsky Comment #11 Reply to this comment
Maybe https://bugs.php.net/bug.php?id=54391, though not sure why it's 
not happening on my system.
2016-07-31 22:04:39 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #10 Reply to this comment
Specifically, the LC_ALL or LANG environment variables.
LC_ALL         de_DE.UTF-8

LANGUAGE         de_DE.UTF-8

2016-07-31 22:01:06 Michael Rubinsky Comment #9 Reply to this comment
Can you get the output of:

phpinfo();


from within the administrative phpshell page? Specifically, the LC_ALL 
or LANG environment variables.

2016-07-31 21:54:06 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #8 Reply to this comment
Are you sure the changes were applied correctly?
root@wolfmailserver:/var/www/https/horde# tail 
ingo/lib/Script/Procmail/Recipe.php
                 $folder = substr($folder, 6);
             }

            $mbox = new Horde_Imap_Client_Mailbox(escapeshellcmd($folder));

            return '".' . $mbox->utf7imap . '/"';
         }
         return str_replace(' ', '\ ', escapeshellcmd($folder));
     }
}
root@wolfmailserver:/var/www/https/horde#
What version of PHP are you using?
php5-common 5.6.24+dfsg-0+deb8u1 amd64
2016-07-31 21:22:13 Michael Rubinsky Comment #7 Reply to this comment
What version of PHP are you using? There were bugs in earlier versions 
with regard to special characters and escapeshell* functions.
2016-07-31 20:51:26 Michael Rubinsky Comment #6
State ⇒ Feedback
Reply to this comment
Cannot reproduce this.

Are you sure the changes were applied correctly? The lines in question 
in  ingo/lib/Script/Procmail/Recipe.php should look like this 
(starting at line 470):

             $mbox = new Horde_Imap_Client_Mailbox(escapeshellcmd($folder));
             return '".' . $mbox->utf7imap . '/"';
2016-07-31 15:51:21 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #5 Reply to this comment
Apply this patch to Ingo 3.2.11

But the procmail script missing the Umlaut now completely:
##### Horde #####
:0
* ^From:.*@horde\.org
".Umlaute-/"
2016-07-29 15:24:26 Michael Rubinsky Comment #4
Assigned to Michael Rubinsky
State ⇒ Resolved
Reply to this comment
Ingo 3.2.12
2016-07-29 15:23:38 Git Commit Comment #3 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit fba0d5ff4d8f74f3ca6ccf5e60664db0d0c8d4f4
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Fri Jul 29 11:17:06 2016 -0400

     Bug: 14429 Escape mailbox before converting to utf7imap.

  ingo/lib/Script/Procmail/Recipe.php | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/fba0d5ff4d8f74f3ca6ccf5e60664db0d0c8d4f4
2016-07-29 15:17:41 Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit 58f170c7ce44f73f9d96516e42459179864f27eb
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Fri Jul 29 11:17:06 2016 -0400

     Bug: 14429 Escape mailbox before converting to utf7imap.

  ingo/lib/Script/Procmail/Recipe.php | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/58f170c7ce44f73f9d96516e42459179864f27eb
2016-07-27 16:22:10 samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Procmail rule with Umlaut wrong folder because backslash
Queue ⇒ Ingo
Milestone ⇒
Patch ⇒ No
Reply to this comment
I have a folder "Umlaute-ä" in IMP / my maildir.

Create a filte rule with Ingo "Deliver to folder... [Umlaute-ä]" 
generate following procmail script:
[...]
140: ##### Horde #####
141: :0
142: * ^From:.*@horde\.org
143: ".Umlaute-\&AOQ-/"

But the folder in the maildir is named ".Umlaute-&AOQ-", as soon the 
filter match procmail create a new folder named ".Umlaute-\&AOQ-" and 
deliver the mail into it.

Saved Queries