[TYPO3-core] RFC: bug #7784: Check for mail configuration is wrong on Windows

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Wed Mar 26 12:13:10 CET 2008


Dmitry Dulepov [typo3] schrieb:
> Martin Kutschker wrote:
>> Dmitry Dulepov [typo3] schrieb:
>>>>
>>>> The localhost check will fail on machine with an IPv6 interface. AT 
>>>> least I think so, I have not seen such a machine in real life.
>>
>> I'm tlaking about this:
>>
>> if ($smtp_addr == '127.0.0.1' && $_SERVER['SERVER_ADDR'] == '127.0.0.1')
>>
>> In my second reading I also wonder now why you check the content of 
>> $_SERVER['SERVER_ADDR']? The machine may have a) an IP address and b) 
>> you may access it via HTTP from anaother machine and still could c) 
>> SMPT be set to localhost.
> 
> Becase SERVER_ADDR is server IP address, not client address.

I know.

 > This check  is for developer computers. Developers typically work on 
localhost and
> they may want to use mail functions. Default PHP installation sets STMP 
> to 127.0.0.1. But people normally do not install SMTP server on their 
> computers. So I check if server address is localhost and SMTP is set to 
> localhost and warn that they may have a problem: SMTP points locally but 
> SMTP server may not be there. However if server address is real, most 
> likely it is not development computer and SMTP server actually may be 
> there.
> 
>> So I think this is sufficient:
>>
>> if ($smtp_addr == '127.0.0.1' || $smtp_addr == '::1') ...
> 
> I do not think so. This skips important and most typical problem with 
> missing local SMTP server.

What does it miss? It warns for all settings of "localhost" in SMTP-IP. So 
you get even more warnings than with your check.

But I have no strong feelings about that. If you think that your check is 
enough you'll get a +1 from me.

Of course you could do a connect at the port and see if an SMTP server is 
running ;-)

Masi


More information about the TYPO3-team-core mailing list