[dev] patch for vacation .forward driver

Peter Arien peter.arien at cc.kuleuven.ac.be
Thu Apr 29 07:48:49 PDT 2004


When I install a vacation message, I get a horde.warning notification
telling me "Your vacation notice is currently disabled."
Not good, because the vacation message _is_ correctly installed.

The forward driver installs the following .forward file:
\m2000953, "|/usr/bin/vacation -a peter.arien at student.kuleuven.ac.be m2000953"

The first part ("\m2000953") is recognised as a valid email address
by Mail_RFC822::parseAddressList, and put in $adr->mailbox, but the
second part is not recognised, and thus not put in $adr->mailbox.
The preg_match will never succeed, because it matches $adr->mailbox,
but at that time $adr is a string, not an array.

Whatever, the attached patch solves this for me.

-- 
Peter

  K.U.Leuven - LUDIT             -=- Tel: +32 16 322219
  peter.arien at cc.kuleuven.ac.be  -=- http://ludit.kuleuven.be

Any technology distinguishable from magic is insufficiently advanced
-------------- next part --------------
--- vacation/lib/Driver/forwards.orig.php	2004-04-29 16:32:18.000000000 +0200
+++ vacation/lib/Driver/forwards.php	2004-04-29 16:34:12.000000000 +0200
@@ -282,8 +282,9 @@
                 if ($this->_makeEmailAddress($adr->mailbox, $adr->host) ==
                     $this->_makeEmailAddress($user, $realm)) {
                     $content['forward']['metoo'] = true;
-                } elseif (preg_match('/\|.*vacation\s*(-a\s+(.*))?\s+(.+)/',
-                                     $adr->mailbox, $matches)) {
+                } elseif (is_string($adr) &&
+		          preg_match('/\|.*vacation\s*(-a\s+(.*))?\s+(.+)/',
+                                     $adr, $matches)) {
                     $content['vacation']['alias'] = $matches[2];
                 } elseif (empty($adr->host) &&
                           empty($adr->personal) && empty($adr->comment)) {


More information about the dev mailing list