FAQ
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.

Search Discussions

  • Adam McGreggor at Jun 18, 2009 at 9:25 am

    On Tue, Jun 16, 2009 at 11:37:30PM -0700, Rick Moen wrote:
    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. [...]
    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:
    I would not touch that. Even with the travesty that is Pkg-exim4, I
    still use something along the lines (pretty much) of that per
    <http://exim.org/howto/mailman21.html>
    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.
    My kludges don't care about subdomains/"list only" domains.
    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.
    IMO, life's waaay too short to genaliases. the configs in
    Nigel's doc makes that a thing of the past (it's probably worth
    noting, I am a lazy sysadmin, and i automate as much as possible, and
    just couldn't make sense of Postfix when i inherited a box with
    postfix as its MTA: that got changed).
    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/
    that 404's for me: have you got the Mailman Apache stanzas set-up in
    lists.linuxgazette.net's vhost config? I've not had issues using
    ServerAlias directives, fwiw.

    [...]

    You may need a 'clear' clause before the line below: search the
    archives of this list for discussions/thoughts/advice thereto.
    VIRTUAL_HOSTS = {'lists.linuxgazette.net':'lists.linuxgazette.net'} [...]
    MTA = 'Postfix'
    I'd change that, as you're using Exim.

    HTH

    --
    "We used to quip that "password" is the most common password. Now
    it's "password1." Who said users haven't learned anything about
    security?"
    (Bruce Schneier, December 2006)
  • Rick Moen at Jun 18, 2009 at 5:25 pm

    Quoting Adam McGreggor (adam-mailman at amyl.org.uk):

    # cat /var/www/gazette/.htaccess
    redirect 301 /index.html
    http://lists.linuxgazette.net/mailman/listinfo/
    that 404's for me: have you got the Mailman Apache stanzas set-up in
    lists.linuxgazette.net's vhost config? I've not had issues using
    ServerAlias directives, fwiw.
    Um, that's not 404, you're being 301-redirected by the .htaccess file
    to a URL that _is_ 404 on account of Mailman not providing the virthost
    there. Here, let's temporarily disable the .htaccess file, and see:

    # cd /var/www/gazette/
    linuxmafia:/var/www/gazette# mv .htaccess .htaccess-save
    linuxmafia:/var/www/gazette# touch HELLO-WORLD

    You'll please note that http://lists.linuxgazette.net/ (and
    http://lists.linuxgazette.net/HELLO-WORLD ) are not, in fact, 404.

    But anyway, since you ask, here's the relevant excerpt from the Apache
    config:

    <VirtualHost lists.linuxgazette.net:80>
    DocumentRoot /var/www/gazette
    </VirtualHost>

    <Directory /var/www/gazette/>
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>


    I would not touch that. Even with the travesty that is Pkg-exim4, I
    still use something along the lines (pretty much) of that per
    <http://exim.org/howto/mailman21.html>
    You know, that is very likely what I did in the prior incarnation of my
    machine, and I'd certainly consider doing it again -- but being very
    careful, because this is a production system. I'm glad to go with
    anything that works: Trying first what the package maintainers and Debian
    people recommend seemed worthwhile. In any event, the current setup is
    just one small problem (http on the virthost) away from 100% success, so
    maybe it can be debugged.

    Also, since Exim-Mailman integration is working fine, and it's Mailman's
    virthost communication with Apache that's broken, I'm not sure switching
    to the admittedly far more elegant approach of
    http://exim.org/howto/mailman21.html would address my current problem.

    You may need a 'clear' clause before the line below: search the
    archives of this list for discussions/thoughts/advice thereto.
    VIRTUAL_HOSTS = {'lists.linuxgazette.net':'lists.linuxgazette.net'}
    [...]
    Thanks. I'll try that.

    (After restarting qrunning:) Nope. That didn't do it.

    MTA = 'Postfix'
    I'd change that, as you're using Exim.
    I don't believe that's really right. The keyword "Postfix" in that
    context just means "use Postfix-style domain semantics", which are not
    in any way Postfix-specific but are just a particular way of dealing
    with aliases, if I understand correctly.
  • Mark Sapiro at Jun 18, 2009 at 5:36 pm

    Rick Moen wrote:
    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.

    Yes it is. 'listinfo' is a CGI. You need a

    ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"

    (or whatever the correct path is) in your httpd.conf where it will
    apply to the lists.linuxgazette.net host. I.e. it needs to be in the
    VirtualHost block for each host with lists or it needs to be outside
    of the virtual hosts section so it applies globally.

    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')
    [...]

    This looks good, but is not relevant to your issue, at least not until
    you fix Apache so that http://lists.linuxgazette.net/mailman/listinfo/
    gets you to the Mailman listinfo CGI.

    # 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'}

    Get rid of the above line. It undoes everything you did with
    add_virtualhost directives above.

    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'}

    Where did this come from. If you put it there, you shouldn't be
    changing Defaults.py at all. If it's part of the Debian package, I
    don't know what to say.


    [...]
    # MTA = 'Manual'
    MTA = 'Postfix' [...]
    #POSTFIX_STYLE_VIRTUAL_DOMAINS = []
    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['linuxmafia.com', 'lists.linuxgazette.net'

    DON'T CHANGE Defaults.py

    Make all your changes in mm_cfg.py.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Rick Moen at Jun 18, 2009 at 6:47 pm

    Quoting Mark Sapiro (mark at msapiro.net):

    Yes it is. 'listinfo' is a CGI. You need a
    ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"
    The Apache conf has:
    ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/

    I didn't harp on that in either of my posts because I _had_ pointed out
    that the Mailman Web pages _do work_ for the default host -- and also
    invited people to have a look at http://linuxmafia.com/mailman/listinfo
    and subpages thereof, if they had any doubts.

    -=but=-, the above ScriptAlias was neatly tucked into the stanza for the
    default host. And:
    (or whatever the correct path is) in your httpd.conf where it will
    apply to the lists.linuxgazette.net host. I.e. it needs to be in the
    VirtualHost block for each host with lists or it needs to be outside
    of the virtual hosts section so it applies globally.
    That was it! Fixed, now.

    Damn. Bear in mind, I've just had a forced transition from Apache 1.3.x
    to Apache2 (on account of sudden destruction of the old box), so my
    excuse is that Debian's Apache2 conffile setup is rather different from
    what I was used to.

    Thank you, Mark. And thank you, good gentleman all.


    --
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedJun 17, '09 at 6:37a
activeJun 18, '09 at 6:47p
posts5
users3
websitelist.org

People

Translate

site design / logo © 2022 Grokbase