[Tickets #2366] NEW: from_addr not always available for vacation.php

bugs@bugs.horde.org bugs at bugs.horde.org
Mon Aug 1 11:02:48 PDT 2005


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

Ticket URL: http://bugs.horde.org/ticket/?id=2366
-----------------------------------------------------------------------
 Ticket             | 2366
 Created By         | sky at columbia.edu
 Summary            | from_addr not always available for vacation.php
 Queue              | Ingo
 Version            | HEAD
 State              | Unconfirmed
 Priority           | 1. Low
 Type               | Bug
 Owners             | 
+New Attachment     | vacation.php.patch
-----------------------------------------------------------------------


sky at columbia.edu (2005-08-01 11:02) wrote:

$identity->getAll('from_addr') is not always set, if IMP and/or manual
account creation isn't done.  Our instance, in particular, displays no
address by default for the user.  This is fixed in the attached patch by
instead calling:
$identity->getDefaultFromAddress()
which has the disadvantage of only getting one address, but
getDefaultFromAddress will fall over to the Auth::getAuth() string if
from_addr is not available.
...and the comments in the vacation.php file suggest that the goal is to get
"at least one address," so this seems to be better.

Alternatively, it could try  getAll('from_addr'), and if that returns
nothing, then call getDefaultFromAddress().   That patch would look like:
57a58
>
59c60,66
<     $vacation->setVacationAddresses(implode("\n",
$identity->getAll('from_addr')));
---
>     if (count($identity->getAll('from_addr')) > 0) {
>         $vacation->setVacationAddresses(implode("\n",
$identity->getAll('from_addr')));
>     }
>     else {
>         require_once 'Horde/MIME.php';
>        
$vacation->setVacationAddresses(MIME::bareAddress($identity->getDefaultFromA
ddress()));
>     }





More information about the bugs mailing list