[Mailman-Users] Can mm_cfg.py use includes?

simba at vmailtest.ao.net simba at vmailtest.ao.net
Thu Apr 27 06:15:04 CEST 2006

     Greetings...  I'm installing a new virtual mail server using Debian
Sarge, PostgreSQL, Postfix, Dovecot, Mailman, and PostfixAdmin.  I'm
trying to automate/tie as much of the administrative configuration
into the PostfixAdmin web interface & PostgreSQL database as
possible.  The only thing in the entire setup that doesn't have
direct query access to the SQL database is Mailman.  What I want to
do is create an hourly cron job to run a script which pulls the names
of the virtual domains from the database and creates the necessary
addvirtualhost('lists.%s', 'lists.%s') configuration items in
mm_cfg.py.  If I end up needing to use a new domain for mailing lists
more quickly than an hour, I can just run the script manually.

     I figure that the easiest way to do that would be to have the script
put those configuration items in a separate file and just use
something like Apache's "Include" directive to read it into the

     I'm not terribly familiar with Python programming, and the only thing
I can find that's similar to what I want to do is the "import"
command.  It's not working like I'd hoped because when I add a "from
vhosts_cfg import *" to mm_cfg.py, the Mailman web scripts just come
back with "We've found a bug!" errors and nothing shows up in
/var/log/mailman/error.  I did remember to create an
/etc/mailman/vhosts_cfg.py test file with correct addvirtualhost()
usage syntax and made a symlink to it in /var/lib/mailman/Mailman, so
it shouldn't be a matter of a missing file.

     I'm not sure what I'm missing or even if this is the best way to
accomplish the task, and rather than go through the time-consuming
task of learning the semantics of another programming languate, I
figured I'd ask the experts.  :)  If anyone knows of a good way to do
this, I'd greatly appreciate a heads-up.  If this ends up being some
sort of informal feature request to be included in the next latest
and greatest version, that'd be cool too.  Thanks in advance for any
help offered!


Scott 'Simba' Garron

More information about the Mailman-Users mailing list