Skip to Content.
Sympa Menu

en - RE: [sympa-users] Sympa virtual host - how to account for variable hostname?

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Steve Shipway <address@concealed>
  • To: Nick Holden <address@concealed>, "address@concealed" <address@concealed>
  • Subject: RE: [sympa-users] Sympa virtual host - how to account for variable hostname?
  • Date: Tue, 2 Sep 2014 21:43:31 +0000

> In upgrading and migrating my sympa installation I'm having a problem with
> one domain where the apache configuration has the server name as
> domain.name with an alias of www.domain.name
>
> Whichever one of these is defined as the http_host in sympa works OK, but
> the other one reverts to the default sympa configuration, not that for the
> virtual host. Is it possible to have two values for http_host or is there a
> better
> solution than this to allow users to type "www.domain.name" or
> "domain.name" and still have everything behave the same way?

Sympa identifies which virtual robot to use based on the HTTP_HOST setting.
If you want two different HTTP hosts to map to the same Sympa virtual host
then you need to trick it. Here are a few ways it can be done:

1. Set up two Sympa virtual hosts, but have them point to the same backend
list configs by using softlinks under list_data
However, this may cause issues if lists are created under both domains, or
depending on how the mail is handled. Probably a bad idea.
2. Set up an HTTP redirect in apache, so that if anyone comes in to
http://comapny.com it is redirected to http://www.company.com
This is much better (and my preferred solution), and you can use Apache
mod_redirect like this:
RewriteCond %{HTTP_HOST} lists.auckland.ac.nz
RewriteRule ^/(.*) https://list.auckland.ac.nz/$1 [R,L]
We do this to allow our list server list.auckland.ac.nz to also be referred
to as lists.auckland.ac.nz
3. Set up a rewrite rule to modify HTTP_HOST and trick Sympa
If you're going to do this, you may as well use option (2), but you can use
a similar RewriteRule to just modify the HTTP_HOST environment variable
rather
than do an http redirect. The syntax for doing this temporarily escapes me,
check the Apache configuration documentation.

Bear in mind that many email servers will automatically rewrite recipient
addresses to the canonical name -- so if www.company.com is a CNAME for
copany.com then expect the email to arrive addressed to the latter. You can
set up rules in your mail server (postfix/sendmail/whatever) to accept emails
for both domains and map them accordingly. For example, here is part of our
Postfix virtual.re file mapping the lists.auckland.ac.nz hostname mentioned
above ready for Sympa to handle.
/^(.*)\@list.auckland.ac.nz$/ list.auckland.ac.nz-$1
/^(.*)\@lists.auckland.ac.nz$/ list.auckland.ac.nz-$1

Steve

Steve Shipway
address@concealed


Attachment: smime.p7s
Description: S/MIME cryptographic signature




Archive powered by MHonArc 2.6.19+.

Top of Page