[Mailman-Users] Virtual domain not quite working on HTTP (but fine on SMTP)

Rick Moen rick at linuxmafia.com
Wed Jun 17 08:37:30 CEST 2009


Greetings, good people.  Problem summary:  After server rebuild, 
virtual hosts work for SMTP, but Mailman's Web pages are appearing
for the main host only and _not_ the virtual host.



Details:

I've had Mailman running on Debian (serving up mailing lists for both
"linuxmafia.com" and "lists.linuxgazette.net") since, oh, God was a
teenager, but a power spike destroyed my somewhat antique hardware in
April.  I hastily deployed Debian "lenny" 5.0 on a spare box the same
day, and then copied back down my latest backup data and madly worked to
recreate the prior config. 

That data restore including dropping back into place the former entire
/var/lib/mailman/lists/ tree (mailing list definitions), the 
/var/lib/mailman/archives/ tree, etc.  (As noted below, this data restore 
was correct to the extent of making Mailman able to handle both 
domains' mailing lists correctly concerning SMTP operation, and 
linuxmafia.com's mailing lists concerning Mailman Web pages.)


Relevant package versions:

:r! dpkg -l | egrep 'mailman|apache2-mpm-prefork|exim4-base'

ii  apache2-mpm-prefork               2.2.8-1                    Traditional model for Apache HTTPD
ii  exim4-base                        4.69-9                     support files for all Exim MTA (v4) packages
ii  mailman                           1:2.1.10~b3-1              Powerful, web-based mailing list manager

Things are oddly different from Pleistocene times when I did the job
before (not a complaint!).

After some fussing about concerning exim4/mailman integration, I
stumbled on details about POSTFIX_STYLE_VIRTUAL_DOMAINS and its use even
with non-Postfix MTAs.  (I put the required plumbing into
/etc/exim4/conf.d/*.  It works.)  I did read the Debian folks'
/usr/share/doc/mailman/README.Exim4.Debian , which includes in part:

  Here's a way to integrate mailman with Exim4 that will automatically
  play nice with mailman's virtual domains support and VERP. It does not
  require dedicating domain(s) to mailman.

  Configure your Mailman (in /etc/mailman/mm_cfg.py) with:

  MTA = 'Postfix'
  POSTFIX_ALIAS_CMD = '/bin/true'
  POSTFIX_MAP_CMD = 'chgrp Debian-exim'

  and list all your Mailman domains in "POSTFIX_STYLE_VIRTUAL_DOMAINS".

  Please note that the chgrp command above will not work when creating a
  list in the web interface: the user www-data will not be allowed to do
  this. You can circumvent this problem by creating new lists with the
  'newlist' command line command or using instead:
  POSTFIX_MAP_CMD = 'chmod o+r'
  This will allow local users (with shell access to the list server) to
  see the list of all Mailman mailing lists, but not much more.

I also noted what appeared to be good advice at
http://files.technomage.net/postfix_mailman.txt -- and, consequently, 
completed Exim integration by running /var/lib/mailman/bin/genaliases, 
and, lo!  /var/lib/mailman/data/{aliases|virtual-mailman} came into
existence, and Exim stopped generating errors.  More important, the
Exim/Mailman jointly [re-]started processing mail for the mailing lists
within both domains.  Life was good.  Almost.


There remains the matter of Mailman's Web pages:  Those for domain
linuxmafia.com are present.  (See: http://linuxmafia.com/mailman/listinfo/)
Those for domain lists.linuxgazette.net are not.  See:
http://lists.linuxgazette.net/mailman/listinfo/ -- as you'll notice,
Apache2 does recognise the domain.  The Apache document root for that
location, /var/www/gazette, has an .htaccess file in it, as follows:

  # cat /var/www/gazette/.htaccess 
  redirect 301 /index.html
  http://lists.linuxgazette.net/mailman/listinfo/

If I mv .htaccess to .htacces-save for diagnostic purposes, I _do_ 
see the contents of /var/www/gazette/ in my browser, so this is not 
an Apache vhost problem.


Here is what I imagine is the relevant part of my current
/var/lib/mailman/Mailman/mm_cfg.py :

  # Default domain for email addresses of newly created MLs
  DEFAULT_EMAIL_HOST = 'linuxmafia.com'
  #-------------------------------------------------------------
  # Default host for web interface of newly created MLs
  DEFAULT_URL_HOST   = 'linuxmafia.com'
  #-------------------------------------------------------------
  # Required when setting any of its arguments.
  add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
  add_virtualhost('lists.linuxgazette.net', 'lists.linuxgazette.net')
[...]
  # Uncomment if you use Postfix virtual domains, but be sure to
  # see /usr/share/doc/mailman/README.Debian first.
  # MTA='Postfix'
  MTA = 'Postfix'
  POSTFIX_ALIAS_CMD = '/bin/true'
  POSTFIX_MAP_CMD = 'chgrp Debian-exim'
  POSTFIX_STYLE_VIRTUAL_DOMAINS = ['linuxmafia.com', 'lists.linuxgazette.net']
  VIRTUAL_HOSTS = {'lists.linuxgazette.net':'lists.linuxgazette.net'}
  VIRTUAL_HOST_OVERVIEW = 1


Here is what I imagine is the relevant part of my current
/var/lib/mailman/Mailman/Default.py:

  ####
  # Virtual domains
  #####

  # Set up your virtual host mappings here.  This is primarily used for the
  # thru-the-web list creation, so its effects are currently fairly limited.
  # Use add_virtualhost() call to add new mappings.  The keys are strings as
  # determined by Utils.get_domain(), the values are as appropriate for
  # DEFAULT_HOST_NAME.
  VIRTUAL_HOSTS = {'lists.linuxgazette.net':'lists.linuxgazette.net'}

  # When set to Yes, the listinfo and admin overviews of lists on the machine
  # will be confined to only those lists whose web_page_url configuration option
  # host is included within the URL by which the page is visited - only those
  # "on the virtual host".  When set to No, all advertised (i.e. public) lists
  # are included in the overview.
  VIRTUAL_HOST_OVERVIEW = On


  # Helper function; use this in your mm_cfg.py files.  If optional emailhost is
  # omitted it defaults to urlhost with the first name stripped off, e.g.
  #
  # add_virtualhost('www.dom.ain')
  # VIRTUAL_HOST['www.dom.ain']
  # ==> 'dom.ain'
  #
  def add_virtualhost(urlhost, emailhost=None):
      DOT = '.'
      if emailhost is None:
          emailhost = DOT.join(urlhost.split(DOT)[1:])
      VIRTUAL_HOSTS[urlhost.lower()] = emailhost.lower()

  # And set the default
  add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
  add_virtualhost('lists.linuxgazette.net', 'lists.linuxgazette.net')

  # Note that you will want to run bin/fix_url.py to change the domain of an
  # existing list.  bin/fix_url.py must be run within the bin/withlist script,
  # like so: bin/withlist -l -r bin/fix_url.py <listname>
[...]
  # MTA should name a module in Mailman/MTA which provides the MTA specific
  # functionality for creating and removing lists.  Some MTAs like Exim can be
  # configured to automatically recognize new lists, in which case the MTA
  # variable should be set to None.  Use 'Manual' to print new aliases to
  # standard out (or send an email to the site list owner) for manual twiddling
  # of an /etc/aliases style file.  Use 'Postfix' if you are using the Postfix
  # MTA -- but then also see POSTFIX_STYLE_VIRTUAL_DOMAINS.
  # MTA = 'Manual'
  MTA = 'Postfix'

  # If you set MTA='Postfix', then you also want to set the following variable,
  # depending on whether you're using virtual domains in Postfix, and which
  # style of virtual domain you're using.  Set this to the empty list if you're
  # not using virtual domains in Postfix, or if you're using Sendmail-style
  # virtual domains (where all addresses are visible in all domains).  If you're
  # using Postfix-style virtual domains, where aliases should only show up in
  # the virtual domain, set this variable to the list of host_name values to
  # write separate virtual entries for.  I.e. if you run dom1.ain, dom2.ain, and
  # dom3.ain, but only dom2 and dom3 are virtual, set this variable to the list
  # ['dom2.ain', 'dom3.ain'].  Matches are done against the host_name attribute
  # of the mailing lists.  See the Postfix section of the installation manual
  # for details.
  #POSTFIX_STYLE_VIRTUAL_DOMAINS = []
  POSTFIX_STYLE_VIRTUAL_DOMAINS = ['linuxmafia.com', 'lists.linuxgazette.net'



qrunner has been HUPed (many times) since setting the above config, but no 
go.  What am I so far missing, in getting Mailman to serve up
Web pages for the lists.linuxgazette.net mailing lists?

Thanks.

-- 
Cheers,                      Notice:  The value of your Hofstadter's Constant 
Rick Moen                    (the average amount of time you spend each month 
rick at linuxmafia.com          thinking about Hofstadter's Constant) has just 
McQ!  (4x80)                 been adjusted upwards.


More information about the Mailman-Users mailing list