[ZendTo] Re: Message to recipient showing IP Address instead of DNS name

Sergio Rabellino rabellino at di.unito.it
Sat Aug 21 14:39:21 BST 2010


I have UseCanonical set to Off and the urls are constructed correctly 
with the FQDN name of my virtualhost.
As a reference:

>
>       3.4.2. UseCanonicalName
>
>     UseCanonicalName /on|off/
>     Default: on 
>     Server config, virtual host, directory, .htaccess
>
> This directive controls how Apache forms URLs that refer to itself, 
> for example, when redirecting a request for 
> /http://www.domain.com/some/directory/ to the correct 
> /http://www.domain.com/some/directory// (note the trailing "/" ). If 
> UseCanonical-Name is on (the default), then the hostname and port used 
> in the redirect will be those set by ServerName and Port. If it is 
> off, then the name and port used will be the ones in the original request.
>
> One instance where this directive may be useful is when users are in 
> the same domain as the web server (for example, on an intranet). In 
> this case, they may use the "short" name for the server (/www/, for 
> example), instead of the fully qualified domain name 
> (/www.domain.com/, say). If a user types a URL such as 
> /http://www/somedir/ (without the trailing slash), then, with 
> UseCanonicalName switched on/,/ the user will be directed to 
> /http://www.domain.com/somedir//, whereas with UseCanonicalName 
> switched off, he or she will be redirected to /http://www/somedir//. 
> An obvious case in which this is useful is when user authentication is 
> switched on: reusing the server name that the user typed means they 
> won't be asked to reauthenticate when the server name appears to the 
> browser to have changed. More obscure cases relate to name/address 
> translation caused by some firewalling techniques
>

How are you calling your server in the browser url ? If you use the IP, 
probably then you'll get the IP on the email.
Which browser/version are you using ?

Into the lines you pinpointed, it's used $_SERVER['HTTP_HOST'] instead 
of $_SERVER['SERVER_NAME']: i agree with you, the second is better 
because it's related to the request's headers and not to the server 
configuration. I suggest Jules to exchange these as the values at the 
worst case are identical.

hope this helps.

Brad Beckenhauer ha scritto:
> Ok,  I'm no PHP kung-fu expert, but I'm pretty sure that I've narrowed 
> down where my problem is, but I'm not sure how to fix it or if there 
> is a better method.
>  
> in /lib/NSSDropbox.php lines 40-43 appear to be what is extracting the 
> server name for the email message.  In my case it's always an IP 
> Address instead of the desired DNS host name.   I did abit of research 
> and found that if I set  "UseCanonical On" in the apache conf file 
> that $_SERVER['SERVER_NAME']; would return my server DNS name.
>  
> I have a correct entry in my /etc/hosts file.
>  
> What am I missing here to get the email to have the dns name instead 
> of the hostname?
>  
>  
> thanks
> Brad
....
-- 
Ing. Sergio Rabellino

Università degli Studi di Torino
Dipartimento di Informatica
ICT Services Director
Tel +39-0116706701  Fax +39-011751603
C.so Svizzera , 185 - 10149 - Torino

<http://www.di.unito.it>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20100821/6224bc5d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.jpg
Type: image/jpeg
Size: 4167 bytes
Desc: not available
Url : http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20100821/6224bc5d/attachment.jpg 


More information about the ZendTo mailing list