[Tickets #5273] patch for "newline" with procmail and vacation

bugs at bugs.horde.org bugs at bugs.horde.org
Fri Apr 20 22:44:52 UTC 2007


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=5273
-----------------------------------------------------------------------
 Ticket             | 5273
 Created By         | krause at biochem.mpg.de
 Summary            | patch for "newline" with procmail and vacation
 Queue              | Ingo
 Version            | 1.1.3
 Type               | Bug
 State              | Unconfirmed
 Priority           | 1. Low
 Owners             | 
-----------------------------------------------------------------------


krause at biochem.mpg.de (2007-04-20 15:44) wrote:

using ingo/procmail for setting vacation messages:
if a user enters text which contains line breaks (carriage return, newline
...(?)) e.g. to seperate the complimentary close from the text or
additional information .procmail then has each linebreak translated into
"\r\n", example:

----- entered into ingo form:
I am currently on vacation.
As soon as i return i will answer your mail personally.

With best regards
    M. Krause
-----

this leads to the following in the procmail script:
----- .procmailrc
echo "I am currently on vacation.\\r\\nAs soon as i return i will 
answer your mail personally.\\r\\n\\r\\nWith best regards\\r\\n   M. 
Krause" \
-----

which is then display (e.g. in thunderbird) as one line:
-----
I am currently on vacation.\\r\\nAs soon as i return i will answer 
your mail personally.\\r\\n\\r\\nWith best regards\\r\\n   M. Krause
-----

i think there is a command line option missing in the .procmailrc which is
created by ingo in the "vacation part" to tell "echo" to enable
interpretation of backslash escapes: -e

patch -Naur:
-----------
--- procmail.php.orig   2007-04-11 14:25:03.000000000 +0200
+++ procmail.php.patched        2007-04-11 14:25:48.000000000 +0200
@@ -456,7 +456,7 @@
                      $this->_action[] = '    | (formail -rI"Precedence:
junk" \\';
                      $this->_action[] = '       -A"X-Loop: ' . $address .
'" \\';
                      $this->_action[] = '       -i"Subject: ' .
$params['action-value']['subject'] . '" ; \\';
-                    $this->_action[] = '       echo "' .
str_replace("\r\n", '"; echo "', $reason) . '" \\';
+                    $this->_action[] = '       echo -e "' .
str_replace("\r\n", '"; echo "', $reason) . '" \\';
                      $this->_action[] = '      ) | $SENDMAIL -oi -t';
                      $this->_action[] = '';
                  }
-----------





More information about the bugs mailing list