[Mailman-Developers] Mailman 2.x Virtual Hosting

Pavel Šimerda pavlix at pavlix.net
Sat Jul 9 02:49:53 CEST 2011


On Fri, 2011-07-08 at 15:32 -0700, Mark Sapiro wrote:
> On 7/6/2011 8:29 AM, Pavel Šimerda wrote:
> > 
> > The official documentation doesn't explicitly claim it. But there's a
> > section about setting up virtual domains that doesn't warn that virtual
> > domain implementation is incomplete:
> > 
> > http://www.gnu.org/s/mailman/mailman-install/postfix-virtual.html
> 
> 
> I have added a note to the above that attempts to clarify this.

You were quick, thank you very much.

> > I, as a seasoned user of Postfix, Apache, and other virtualized server
> > software, but new user of Mailman, can confirm, that this documentation
> > made me think mailman fully supports virtual hosting. Unfortunately,
> > there are other resources on the web that are similarly confusing.
> 
> 
> If any of those resources are under control of the GNU Mailman project,
> and you tell us where they are, I will attempt to clarify them too.

I believe these other places were outside the Mailman project.

> > With most of the patches already working, it doesn't look too hard to 
> > add full virtual domain support to Mailman 2.x via address rewriting. I
> > fixed more issues on my installation myself.
> 
> 
> It might not be hard. Perhaps you could tell us exactly what you did to
> give us something to work with.

Ok, but I haven't made proper patches (yet). And these are quick and
dirty fixes I made directly in the installed *.py files.

I've made some changes to /var/lib/mailman/Mailman/MTA/Postfix.py to fix
badly generated alias files for postfix:

144     print >> fp, '# STANZA START:', listname
145     print >> fp, '# CREATED:', time.ctime(time.time())
146     # Now add all the standard alias entries
147     #### Fixed by pavlix at pavlix.net
148     if (mlist.host_name):
149         for ext in ('', '-admin', '-bounces', '-confirm', '-join',
'-leave',
150                 '-owner',  '-request', '-subscribe',
'-unsubscribe'):
151             fqdnaddr = '%s%s@%s' % (mlist.real_name, ext,
mlist.host_name)
152             target = '%s-%s%s' % (mlist.real_name, mlist.host_name,
ext)
153             badfqdnaddr = '%s@%s' % (target, mlist.host_name)
154             # Format the text file nicely
155             print >> fp, fqdnaddr, ((fieldsz - len(target)) * ' '),
target
156             print >> fp, badfqdnaddr, ((fieldsz - len(target)) * '
'), target
157     # Finish the text file stanza
158     print >> fp, '# STANZA END:', listname
159     print >> fp

And I fixed apparently broken part
of /usr/lib/mailman/Mailman/MailList.py to include the correct address
inside the messages:

 187     def getListAddress(self, extra=None):
 188         #### pavlix at pavlix.net # return '%s-%s@%s' %
(self.internal_name(), extra, self.host_name)
 189         posting_addr = self.internal_name()
 190         try:
 191             posting_addr = self.real_name.lower()
 192         except:
 193             pass
 194         if extra is None:
 195             return '%s@%s' % (posting_addr, self.host_name)
 196         return '%s-%s@%s' % (posting_addr, extra, self.host_name)

Please don't forget that I made these changes to Debian's Mailman
package using patches from:

https://wiki.koumbit.net/VirtualMailman

> However, please keep in mind that Mailman 2.1 is at the end of its life.
> The development focus is currently on Mailman 3. It is not a good use of
> development resources to implement a significant new feature in 2.1 that
> would undoubtedly lead to additional bug reports that would need to be
> addressed.
> 
> I think a better approach would be to incorporate whatever additional
> fixes are necessary into the existing
> <https://code.launchpad.net/~msapiro/mailman/vhost> branch, or for you
> to publish your changes as an alternative branch.

It sounds like a good idea. I actually tried to download from this
branch first, but it didn't work for me (I don't remember the details,
but AFAIK even the basic commands like newlist failed).

I'll try to look at your version history and see what can be done to
merge our modifications, when I have a little bit more time.

> > Any way, I'd be very pleased if the documentation is “fixed”, even if
> > its brokennes is not obvious to people who have lived with Mailman
> > for long time.
> 
> 
> What do you think of the change I made?

It's perfect, IMO.

Pavel




More information about the Mailman-Developers mailing list