<HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16625"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Segoe UI" bgColor=#ffffff text=#000000>hello Sergio,<BR><BR>>>> On 8/22/2010 at 2:56 PM, in message <4C7180E9.1090704@di.unito.it>, Sergio Rabellino <rabellino@di.unito.it> wrote:<BR>
<TABLE style="MARGIN: 0px 0px 0px 15px; FONT-SIZE: 1em" border=0 bgColor=#f3f3f3>
<TBODY>
<TR>
<TD>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px"><BR><BR>Brad Beckenhauer ha scritto: </DIV>
<BLOCKQUOTE style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px" cite=mid:4C70E04A020000680005E469@smtp.aafp.org type="cite">
<META name=Author content="Novell GroupWise WebAccess">Hi Sergio,<BR>Right now I'm calling the server using dns name in the browser URL (Canonical is off and apache restarted).<BR>I've tested using Firefox 3.6.8 and IE 8 and in both cases I get the private IP Address in the message sent to the user.<BR><BR>I then changed the line $_SERVER['HTTP_HOST'] to read $_SERVER['SERVER_NAME'] and I still get the IP Address in the email with canonical OFF.<BR><BR></BLOCKQUOTE>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">this is awesome, did you verify that servername is defined as fdqn for the apache you're calling (i don't know if it's a virtualhost) ?</DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px"> </DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px"> </DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">I'm not running as a virtual host (Julian's vm package does not have it enabled) and the only settings I've changed in the Apache httpd.conf file are the ServerName and the UseCanonicalName as shown below (NameVirtualHost is remarked out).</DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px"> </DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">ServerName host.domain.tld:80</DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">UseCanonicalName On</DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px"> </DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">for now on the production box, I'm going to leave "CanonicalName On" in the Apache host and change line 40 in the lib/NSSDropbox.php </DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">from:</DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">$NSSDROPBOX_URL = "http".($_SERVER['HTTPS'] ? "s" : "")."://".$_SERVER['HOST_NAME'].$_SERVER['REQUEST_URI'];<BR></DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">to:</DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">$NSSDROPBOX_URL = "http".($_SERVER['HTTPS'] ? "s" : "")."://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];</DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px"> </DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">I'll continue to try and figure out why I have to enable the Canonicalname.</DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">-Brad</DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px"><BR> </DIV></DIV>
<BLOCKQUOTE style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px" cite=mid:4C70E04A020000680005E469@smtp.aafp.org type="cite">If I turn "Canonical On" and change the line $_SERVER['HTTP_HOST'] to read $_SERVER['SERVER_NAME'], then the email correctly sends the host DNS name and not the IP Address..<BR></BLOCKQUOTE>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">no ideas for now....<BR></DIV>
<BLOCKQUOTE style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px" cite=mid:4C70E04A020000680005E469@smtp.aafp.org type="cite"><BR>Are you using the Centos-64 vm from Julian as well?<BR><BR></BLOCKQUOTE>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">no i've my "ancient" server on a solaris box, but damn, apache is apache and php is php... (btw i've also a service on a centos-64 with apache/php with the same behaviour)<BR></DIV>
<BLOCKQUOTE style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px" cite=mid:4C70E04A020000680005E469@smtp.aafp.org type="cite">Thanks you for your help!<BR>Brad<BR><BR><BR><BR>>>> Sergio Rabellino <RABELLINO@DI.UNITO.IT>08/21/10 8:45 AM >>><BR>I have UseCanonical set to Off and the urls are constructed correctly with the FQDN name of my virtualhost.<BR>As a reference:<BR><BR></RABELLINO@DI.UNITO.IT>
<BLOCKQUOTE type="cite">
<H3 class=sect2><A moz-do-not-send="true">3.4.2. UseCanonicalName</A></H3>
<BLOCKQUOTE><PRE class=code><A name=INDEX-253 moz-do-not-send="true">UseCanonicalName <EM class=replaceable>on|off</EM>
Default: on
Server config, virtual host, directory, .htaccess</A></PRE></BLOCKQUOTE>
<P><A name=INDEX-253 moz-do-not-send="true">This directive controls how Apache forms URLs that refer to itself, for example, when redirecting a request for <EM class=emphasis>http://www.domain.com/some/directory</EM> to the correct <EM class=emphasis>http://www.domain.com/some/directory/</EM> (note the trailing "/" ). If <TT class=literal>UseCanonical-Name</TT> is <TT class=literal>on</TT> (the default), then the hostname and port used in the redirect will be those set by <TT class=literal>ServerName</TT> and <TT class=literal>Port</TT>. If it is <TT class=literal>off</TT>, then the name and port used will be the ones in the original request.</A></P>
<P><A name=INDEX-253 moz-do-not-send="true">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 (<EM class=emphasis>www</EM>, for example), instead of the fully qualified domain name (<EM class=emphasis>www.domain.com</EM>, say). If a user types a URL such as <EM class=emphasis>http://www/somedir</EM> (without the trailing slash), then, with <TT class=literal>UseCanonicalName</TT> switched <TT class=literal>on</TT><EM class=emphasis>,</EM> the user will be directed to <EM class=emphasis>http://www.domain.com/somedir/</EM>, whereas with <TT class=literal>UseCanonicalName</TT> switched <TT class=literal>off</TT>, he or she will be redirected to <EM class=emphasis>http://www/somedir/</EM>. 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</A></P></BLOCKQUOTE><BR>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.<BR>Which browser/version are you using ?<BR><BR><RABELLINO@DI.UNITO.IT><BR>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.<BR><BR>hope this helps.<BR><BR>Brad Beckenhauer ha scritto: </RABELLINO@DI.UNITO.IT>
<BLOCKQUOTE cite=mid:4C6E792D020000680005E2C3@smtp.aafp.org type="cite">
<DIV>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.</DIV>
<DIV> </DIV>
<DIV>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.</DIV>
<DIV> </DIV>
<DIV>I have a correct entry in my /etc/hosts file.</DIV>
<DIV> </DIV>
<DIV>What am I missing here to get the email to have the dns name instead of the hostname?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>thanks</DIV>
<DIV>Brad</DIV></BLOCKQUOTE>....<BR>
<DIV class=moz-signature>-- <BR>
<CENTER><SPAN style="FONT-FAMILY: Verdana,sans-serif; FONT-WEIGHT: bold">Ing. Sergio Rabellino<BR></SPAN><BR><SPAN style="FONT-FAMILY: Verdana,sans-serif">Università degli Studi di Torino<BR>Dipartimento di Informatica<BR>ICT Services Director<BR>Tel +39-0116706701 Fax +39-011751603<BR>C.so Svizzera , 185 - 10149 - Torino<BR><BR><A href="http://www.di.unito.it" moz-do-not-send="true" alt="Dipartimento di Informatica"><IMG border=0 src="" moz-do-not-send="true"></A> </SPAN></CENTER></DIV><PRE wrap=""><HR SIZE=4 width="90%">
_______________________________________________
ZendTo mailing list
<A class=moz-txt-link-abbreviated href="mailto:ZendTo@zend.to">ZendTo@zend.to</A>
<A class=moz-txt-link-freetext href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto">http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto</A></PRE></BLOCKQUOTE>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px"><BR></DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px" class=moz-signature>-- <BR>
<CENTER><SPAN style="FONT-FAMILY: Verdana,sans-serif; FONT-WEIGHT: bold">Ing. Sergio Rabellino<BR></SPAN><BR><SPAN style="FONT-FAMILY: Verdana,sans-serif">Università degli Studi di Torino<BR>Dipartimento di Informatica<BR>ICT Services Director<BR>Tel +39-0116706701 Fax +39-011751603<BR>C.so Svizzera , 185 - 10149 - Torino<BR><BR><A href="http://www.di.unito.it" alt="Dipartimento di Informatica"><IMG border=0 src="cid:MFSDQMAXDFJR.IMAGE_2.jpeg"></A> </SPAN></CENTER></DIV></TD></TR></TBODY></TABLE></BODY></HTML>