[TYPO3-core] Another patch request for t3lib_htmlmail
Martin Kutschker
Martin.Kutschker at blackbox.net
Thu Jan 26 13:52:30 CET 2006
Stanislas Rolland <stanislas.rolland at fructifor.ca> writes on
Wed, 25 Jan 2006 23:42:24 +0100 (MET):
>
>
> > 2. I don't like the hostname detection:
[snip]
> > Please use
> > the output of php_uname('n') instead.
>
> What is wrong with the hostname detection? This has been tested on
> many installations for many months now, I would be hesitant to change
> it at this time.
gethostbyaddr('127.0.0.1') yields only 'localhost' for me. And php_uname('n') yields only the local name on my machine.
To get a FQDN I need to do this:
gethostbyaddr(gethostbyname(php_uname('n'))
The PHP docs suggests that the function returns. Perhaps the best way is this:
$host = php_uname('n');
if (strpos('.',$host) === FALSE) {
$host = gethostbyaddr(gethostbyname($host));
}
> > Do NOT md5sum it (hostname should be readable).
> Can you guaranty that we will never get any characters that the RFC
> would consider illegal?
Then do some character replacements of SITENAME (see below).
> The RFC does not require a hostname of any kind. There is no
> requirement that it should be "readable". It requires a universally
> unique identifier. I think the proposed script is the best bet.
I also prefer a "meaningful" host part. IMHO the intenion of the RFC was to use a host or a domain name, not some random string.
> > If the function returns nothing, append "localhost" as default
> > workaround.
> This would not be compliant with the RFC requirements.
Agreed.
Masi
PS: Interestingly noone noticed the host name detecion in my syslog patch. There I used posix_uname() but I'll change it to use the same method as t3lib_htmlmail.
More information about the TYPO3-team-core
mailing list