Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002754 [Quercus] minor always 06-27-08 07:13 08-07-08 20:05
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.6
Summary 0002754: mail with null "to" attribute
Description (rep by atijms)

I'm trying to run PHPBB2 2.0.23 on Quercus 3.1.6. I noticed that under certain circumstances PHPBB2 uses a " " as the "to" field when sending an email. Apparently this is allowed in real PHP, but it fails on Quercus.

In MailModule.java, line 123 an exception is thrown when basically no emailaddresses with a @ in it can be found. This check for a @ is being done in the addRecipients method:


private static ArrayList addRecipients(MimeMessage msg,
Message.RecipientType type,
String to)
throws MessagingException
{
String []split = to.split("[ \t,<>]");

ArrayList addresses = new ArrayList();

for (int i = 0; i < split.length; i++) {
if (split[i].indexOf('@') > 0) {
Address addr = new InternetAddress(split[i]);

addresses.add(addr);
msg.addRecipient(type, addr);
}
}

return addresses;
}
Now I'm not sure that you really have to check on the @, at least our servers also know of local email addresses which don't have an @ in them. Anyway, the code section in PHPBB2 is this:

PHPBB2 2.0.23, emailer.php, line 209

$empty_to_header = ($to == '') ? TRUE : FALSE;
$to = ($to == '') ? (($board_config['sendmail_fix']) ? ' ' : 'Undisclosed-recipients:;') : $to;

$result = @mail($to, $this->subject, preg_replace("#(?msg), $this->extra_headers);
In this case, running the code on Quercus always causes an exception:


com.caucho.quercus.QuercusModuleException: mail has no recipients
com.caucho.quercus.lib.MailModule.mail(MailModule.java:123)
Additional Information
Attached Files

- Relationships

- Notes
(0003308)
ferg
08-07-08 20:05

php/1n0{a,b,c}
 

- Issue History
Date Modified Username Field Change
06-27-08 07:13 ferg New Issue
08-07-08 20:05 ferg Note Added: 0003308
08-07-08 20:05 ferg Assigned To  => ferg
08-07-08 20:05 ferg Status new => closed
08-07-08 20:05 ferg Resolution open => fixed
08-07-08 20:05 ferg Fixed in Version  => 3.2.1


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker