Bug #16402
closedIf typo3 wants to send a html-mail i got a error message
0%
Description
The message is:
Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /homepages/6/d17216529/htdocs/ihrhobby.eu/document_root/t3lib/class.t3lib_htmlmail.php on line 274
Warning: Cannot modify header information - headers already sent by (output started at /homepages/6/d17216529/htdocs/ihrhobby.eu/document_root/t3lib/class.t3lib_htmlmail.php:274) in /homepages/6/d17216529/htdocs/ihrhobby.eu/document_root/typo3/sysext/cms/tslib/class.tslib_fe.php on line 2767
This is because $host = php_uname('n') in t3lib_htmlmail.php get the wrong content at a schlund und Partner Server. the COntent is for example:
"Linux infong 2.4 #1 SMP Wed Jan 18 14:53:29 CET 2006 i686 unknown"
the problem is, that there is a "." in this string, so typo3 runs
$host = gethostbyaddr(gethostbyname($host));
and this line producese this error.
i think if you "say" if the string is longer than (xxx.xxx.xxx.xxx) it cound NOT be a ip-adress and if the string containt a " " it could not be a host-name
i changed the line
$host = php_uname('n');
to
$host = $_SERVER['HTTP_HOST'];
and for me it wirks fine!
(issue imported from #M3926)