<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I believe that SERVER_NAME it's a better choice.<br>
<br>
Jules ha scritto:
<blockquote cite="mid:4C83A47D.10808@Zend.To" type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
Do you need me to use HTTP_HOST or SERVER_NAME ?<br>
I'm a bit lost...<br>
<br>
In some places it uses one and some places the other. It makes no
difference on my system, so I'm not sure which you want me to use.<br>
<br>
Thanks,<br>
Jules.<br>
<br>
On 23/08/2010 18:59, Julian Field wrote:
<blockquote
cite="mid:EMEW3|0af7dc9dc846b0be5fb3b95aaf505fd6m7MIxA05Jules|ecs.soton.ac.uk|C15EE9E0-9FBF-47B3-9279-F50930D207A4@ecs.soton.ac.uk"
type="cite">
<div>Thanks for this hint, I will change the code. It's a bit I
didn't write :-)<br>
<br>
--
<div>Jules</div>
</div>
<div><br>
On 21 Aug 2010, at 02:39 PM, Sergio Rabellino <<a
moz-do-not-send="true" href="mailto:rabellino@di.unito.it">rabellino@di.unito.it</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div> 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>
<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>
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:
<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 moz-do-not-send="true" href="http://www.di.unito.it"
alt="Dipartimento di Informatica"><logo.jpg></a> </span></center>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div><span>_______________________________________________</span><br>
<span>ZendTo mailing list</span><br>
<span><a moz-do-not-send="true" href="mailto:ZendTo@zend.to">ZendTo@zend.to</a></span><br>
<span><a moz-do-not-send="true"
href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto">http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto</a></span></div>
</blockquote>
<pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
ZendTo mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:ZendTo@zend.to">ZendTo@zend.to</a>
<a moz-do-not-send="true" 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>
<pre class="moz-signature" cols="72">Jules
--
Julian Field MEng CITP CEng
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="http://www.Zend.To">www.Zend.To</a>
Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
Follow me at twitter.com/JulesFM
</pre>
<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à 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
src="cid:part1.06000805.04000001@di.unito.it" border="0"></a>
</span></center>
</div>
</body>
</html>