<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Brad Beckenhauer ha scritto:
<blockquote cite="mid:4C70E04A020000680005E469@smtp.aafp.org"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <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>
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) ?<br>
<blockquote 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>
no ideas for now....<br>
<blockquote cite="mid:4C70E04A020000680005E469@smtp.aafp.org"
 type="cite"><br>
Are you using the Centos-64 vm from Julian as well?<br>
  <br>
</blockquote>
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>
<blockquote cite="mid:4C70E04A020000680005E469@smtp.aafp.org"
 type="cite">Thanks you for your help!<br>
Brad<br>
  <br>
  <br>
  <br>
&gt;&gt;&gt; Sergio Rabellino <rabellino@di.unito.it> 08/21/10 8:45 AM
&gt;&gt;&gt;<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 moz-do-not-send="true" name="INDEX-253">UseCanonicalName <em
 class="replaceable">on|off</em>
Default: on 
Server config, virtual host, directory, .htaccess</a></pre>
    </blockquote>
    <p><a moz-do-not-send="true" name="INDEX-253">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 moz-do-not-send="true" name="INDEX-253">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,&nbsp; 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>&nbsp;</div>
    <div>in /lib/NSSDropbox.php lines 40-43 appear to be what is
extracting the server name for the email&nbsp;message.&nbsp; In my case it's
always an IP Address instead of the desired&nbsp;DNS host name.&nbsp;&nbsp; I did abit
of research and found that if I set&nbsp; "UseCanonical On" in the apache
conf file that $_SERVER['SERVER_NAME']; would return my server DNS name.</div>
    <div>&nbsp;</div>
    <div>I have a correct entry in my /etc/hosts file.</div>
    <div>&nbsp;</div>
    <div>What am I missing here to get the email to have the dns name
instead of the hostname?</div>
    <div>&nbsp;</div>
    <div>&nbsp;</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&agrave; degli Studi di Torino<br>
Dipartimento di Informatica<br>
ICT Services Director<br>
Tel +39-0116706701&nbsp;
Fax +39-011751603<br>
C.so Svizzera , 185 - 10149 - Torino<br>
  <br>
  <a moz-do-not-send="true" href="http://www.di.unito.it"
 alt="Dipartimento di Informatica"><img moz-do-not-send="true" src=""
 border="0"></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>
<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&agrave; degli Studi di Torino<br>
Dipartimento di Informatica<br>
ICT Services Director<br>
Tel +39-0116706701&nbsp;
Fax +39-011751603<br>
C.so Svizzera , 185 - 10149 - Torino<br>
<br>
<a href="http://www.di.unito.it" alt="Dipartimento di Informatica"><img
 src="cid:part1.03080304.01050908@di.unito.it" border="0"></a>
</span></center>
</div>
</body>
</html>