php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #490 Win32 sendmail is very slow when specifying SMTP host as IP address
Submitted: 1998-06-29 09:10 UTC Modified: 1998-07-10 13:03 UTC
From: tma at gatehouse dot dk Assigned:
Status: Closed Package: Performance problem
PHP Version: 3.0 Final Release OS: WinNT 4.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tma at gatehouse dot dk
New email:
PHP Version: OS:

 

 [1998-06-29 09:10 UTC] tma at gatehouse dot dk
When specifying SMTP host as an IP address in the php3.ini file (e.g. SMTP=192.168.101.1),
the gethostbyname() call performed by sendmail.c times out, resulting in very poor performance.

A quick hack: If MailHost starts with a numeric character, do not perform the gethostbyname() call 
(BTW: The results do not appear to be used anyway!)

--- c:/user/gh/php-3.0/win32/sendmail.c~	Mon Jun 29 12:02:00 1998
+++ c:/user/gh/php-3.0/win32/sendmail.c	Mon Jun 29 12:03:22 1998
@@ -380,9 +380,12 @@
 		return (FAILED_TO_GET_HOSTNAME);
 
 	// Resolve the servers IP
-	GLOBAL(adr) = gethostbyname(GLOBAL(MailHost));
-	if (!GLOBAL(adr))
-		return (FAILED_TO_RESOLVE_HOST);
+	if (!isdigit(GLOBAL(MailHost)))
+   {
+      GLOBAL(adr) = gethostbyname(GLOBAL(MailHost)[0]);
+      if (!GLOBAL(adr))
+         return (FAILED_TO_RESOLVE_HOST);
+   }
 
 	// Connect to server
 	GLOBAL(sock_in).sin_family = AF_INET;


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-10 13:03 UTC] shane
This unused code section was removed in 3.0.1
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 09:01:27 2025 UTC