-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always timeout in class.phpmailer.php on 754 #41
Comments
This is strange, I have my fork replaced with the 23K pattern found here and it only takes 0.08 - 0.15 secs more for each address. |
I think this has to be something up with your server - it's just a regular expression. If you extract it and run it by itself (outside PHPMailer) do you still have a problem? |
I extract it and put it in a new file, and run it on the same server. there is no problem. It finished in 0.011907815933228s
//Fall back to an older regex that doesn't need a recent PCRE
|
If you try using it inside PHPMailer does it make a difference? Like this:
|
Have you got to the bottom of this? |
No movement, closing. |
hello all, |
It will always return false because commenting out the validation lines will prevent it adding addresses, so you'll be trying to send without an address. Checking a few return values wouldn't hurt either. |
I had the same problem, removed the:
and the else brackets. But I guess this eats too much memory or something, causing it not to finnish properly. |
Sorry to Reply so late. I ran your code, and it finished so quickly, well that's very weird. |
I had the exact same experience as above, with the CPU pinning at 100% and executing until timeout at 30s. PHP version 5.4.7, PCRE version 8.12 (quad core 3.4GHz w/16GB) The solution was to change the PCRE to something I found on hacksparrow.com for a RFC2822 email regex:
After this it worked for standard email addresses. Strange/rare "valid" emails would not pass, nor would local addresses. I'm sure this could be improved, but at least it got things mailing. |
In the smtp-refactor branch, you can choose which validator pattern to use. The older pattern that's in PHPMailer already does not have this problem either. |
This is exactly why ValidateAddress is public static. On Wed, Aug 7, 2013 at 3:41 AM, ccoltman notifications@github.com wrote:
|
Hi jimjag I'm not sure what to do with that information. If I can set or change an option in the validation I haven't figured out how to do that yet. I'm hard coding the email addresses to my own valid public address, sending the request to my public mail server with my mail account on it, and it hangs on the ValidateAddress function even though it should pass with flying colours. |
Jim's saying that if you have trouble, you can simply override the method in your own subclass. In the branch I mentioned, the validate function allows you to select which validator it uses. |
OK thanks, I'll hit the docs on that branch and see if I can figure out how to select the validator manually. I'm not constructing the call myself (it's built into a CMS), so please excuse my inexperience here. |
I do not know whether this could be of any help for developers, but the problem is well reproduced with:
(with the line changed to "return true;" library works fine - thanks for it) |
When I'm using phpmailer on a Server CentOS 6.4, php 5.4.4( XAMPP ), and PCRE_VERSION 8.12 2011-01-15, I always got Fatal error: Maximum execution time of 30 seconds exceeded in /class.phpmailer.php on line 754. I find that is a method ValidateAddress(), which uses regular expression. After I commented regular expressions , the script can complete.
Besides the same script regular expression version run normally on my windows pc.
The text was updated successfully, but these errors were encountered: