| 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 (6967 days ago) |
| Due | |
| Updated | 10/02/2006 (6960 days ago) |
| Assigned | |
| Resolved | 09/26/2006 (6966 days ago) |
| Github Issue Link | |
| Github Pull Request | |
| Milestone | |
| Patch | No |
"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 . '>';
}
State ⇒ Resolved
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ attachment.php sends mail to null address
Queue ⇒ IMP
State ⇒ Unconfirmed
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);