6.0.0-beta1
10/19/25

[#4462] attachment.php sends mail to null address
Summary attachment.php sends mail to null address
Queue IMP
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners
Requester srrafa (at) usc (dot) es
Created 09/25/2006 (6964 days ago)
Due
Updated 10/02/2006 (6957 days ago)
Assigned
Resolved 09/26/2006 (6963 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/02/2006 05:30:51 PM Chuck Hagenbuch Comment #4 Reply to this comment
Updated the test to check for at least 3 characters, thanks.
10/02/2006 09:37:11 AM srrafa (at) usc (dot) es Comment #3 Reply to this comment
One issue still remains:



  "if ($mail_address)"  always returns true because

getDefaultFromAddress returns addresses enclosed between "<>", no 
matter the content of $addr.



   function getDefaultFromAddress($fullname = false)

     {

         $from_addr = '';



         if ($fullname) {

             $name = $this->getValue('fullname');

             if (!empty($name)) {

                 $from_addr = $name . ' ';

             }

         }



         $addr = $this->getValue('from_addr');

         if (empty($addr)) {

             $addr = Auth::getAuth();

         }



         return $from_addr . '<' . $addr . '>';

     }










09/26/2006 06:38:49 PM Chuck Hagenbuch Comment #2
State ⇒ Resolved
Reply to this comment
I agree. Fixed in CVS and FW_3. Thanks!
09/25/2006 01:00:58 PM srrafa (at) usc (dot) es Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ attachment.php sends mail to null address
Queue ⇒ IMP
State ⇒ Unconfirmed
Reply to this comment
When a user does no have a properly configured profile (from_addr 
field is missing), download notifications are sent to a null address.



attachment.php calls getDefaultFromAddress() de 
lib/Horde/Identity.php, wich returns Auth::GetAuth as email addr when 
from_addr is empty.



         $addr = $this->getValue('from_addr');

         if (empty($addr)) {

             $addr = Auth::getAuth();

         }



The problem (IMHO) with this is that Auth::getAuth returns an empty 
value, because attachment.php is called anonymously.



What do you think about inserting a check before the message is sent?, 
just after this line in attachment.php:



$mail_address = $mail_identity->getDefaultFromAddress(true);


Saved Queries