View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012216 | mantisbt | documentation | public | 2010-07-29 09:36 | 2010-09-11 17:18 |
| Reporter | AlexRosa | Assigned To | giallu | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Product Version | 1.2.1 | ||||
| Target Version | 1.2.3 | ||||
| Summary | 0012216: Minimal PHP 5.2 version is 5.2.9 | ||||
| Description | The documentation says the minimal 5.2 version is 5.2.0 but this version has the bug 47282 that prevents Mantis to send email to local network addresses (like user@box). The PHP bug report is here: http://bugs.php.net/bug.php?id=47282 This PHP bug was related to FILTER_VALIDATE_EMAIL, used by the phpMailer library that Mantis 1.2.1 uses. It was fixed in PHP 5.2.9, according to the following change log: | ||||
| Steps To Reproduce | 1) Install Mantis 1.2.1 with PHP 5.2.x where x < 9 | ||||
| Additional Information | My suggestion is to update the documentation to: a) raise the minimum version of PHP 5.2 to 5.2.9 or b) include a warning mentioning this problem with local network addresses for PHP 5.2 versions below 5.2.9. | ||||
| Tags | No tags attached. | ||||
| Attached Files | local_network.patch (618 bytes)
--- class.phpmailer.php 2010-08-05 12:30:13.000000000 -0300
+++ /var/www/mantisbt-1.2.2/library/phpmailer/class.phpmailer.php 2010-07-29 13:45:22.000000000 -0300
@@ -522,7 +522,7 @@
*/
public static function ValidateAddress($address) {
if (function_exists('filter_var')) { //Introduced in PHP 5.2
- if(this-Mailer != 'mail' && filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {
+ if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {
return false;
} else {
return true;
@@ -2317,4 +2317,4 @@
return $errorMsg;
}
}
-?>
+?>
\ No newline at end of file
| ||||
|
To find the line of phpMailer that triggers the PHP bug, run this grep: |
|
|
Bad news: the bug was reintroduced in PHP 5.2.14 and probably occurs also in recent 5.3.x versions. Local networks emails are considered invalid by the RFC's used as specs by PHP team -- they consider SMTP only. Since PHPMailer does support the mail() method, the problem is with them. I've submitted an ISSUE at PHPMailer bugtracking mentioning this. The current workaround is to edit .../library/phpmailer/class.phpmailer.php at line 525, adding a test to check if the current method is mail(): if(this-Mailer != 'mail' && filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) { Patch is attached. |
|
|
Sorry the patch was made in the wrong direction, but you get my point. |
|
|
Just want to point out that Ubuntu Hardy shipped with PHP 5.2.4 and Debian Lenny with 5.2.6. Hardy is supported on the server until April 2013 and Lenny has a year of support after the next release comes out. I would request not exceeding 5.2.6 if possible until Lenny is EOL. |
|
|
Here is the bug report for PHPMailer: |
|
|
Just to clarify: the problem is not the PHP version, it's the PHPMailer function "ValidateAddress" that uses PHP's FILTER_VALIDATE_EMAIL filter for all emails, including local network addresses that are valid when then "mail" method is used. |
|
|
Uhm, I wonder what dragged requirements to 5.2. I remember it was discussed several times and generally agreed we were trying to stick to 5.1 for the 1.2 release and raise the bar afterwards |
|
|
Most of MantisBT should work fine with PHP 5.1.x. Even this server (mantisbt.org) runs the RHEL 5.1 build of PHP afaik. |
|
|
Maybe I should sumbit a NEW issue, because the problem is NOT the PHP version anymore (they changed back to the old behaviour in 5.2.14). Actually the problem is in PHPMailer library that always uses the standard FILTER_VALIDATE_EMAIL from PHP even when sending emails thru mail() method -- that can accept local network addresses. My patch above fixes PHPMailer. |
|
|
Yeah, please open up a new issue, better if directly upstream at: |
|
|
Already did that, giallu: |
|
|
This issue can be closed now, there's a new one (12335) about the same problem that is more correct and specific. |
|
|
Ok. thank you very much |
|