pass emailhost to mlist.Create

Bug #558199 reported by tribus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Undecided
Unassigned

Bug Description

As bin/newlist has emailhost option, then make
mlist.Create call with lang and host_name parameters to
take care of it.

Revision history for this message
tribus (tribus) wrote :

The file mailman-newlist-host_name.patch was added: bin/newlist host_name patch

Revision history for this message
akuchling (akuchling) wrote :

Logged In: YES
user_id=11375
Originator: NO

This patch is slightly out-of-date -- mlist.Create now takes a langs parameter instead of
just 'lang' -- but adding the host_name is still relevant. mlist.Create checks the validity of postingaddr based upon the emailhost, so setting it after-the-fact is sidestepping that check.

I'll try to apply and test this patch, but won't do it not in time for 2.1.11.

Revision history for this message
msapiro (msapiro-users) wrote :

Logged In: YES
user_id=1123998
Originator: NO

Nothing in this patch is currently relevant. The 'lang' part of it was fixed in Mailman 2.1.10, and host_name and web_page_url have been set appropriately by newlist since 2.1.6 although they are not passed to mlist.Create but set after.

Revision history for this message
akuchling (akuchling) wrote :

Logged In: YES
user_id=11375
Originator: NO

Here's why I think the emailhost portion is still relevant, though not very important. MailList.Create does:

        postingaddr = '%s@%s' % (name, emailhost)
        try:
            Utils.ValidateEmail(postingaddr)
        except Errors.MMBadEmailError:
            raise Errors.BadListNameError, postingaddr

Setting the emailhost after calling .Create() side-steps this check,
and it doesn't look like bin/newlist does anything like this check, nor does it call MailList.CheckValues(). Perhaps the above check should be put into .CheckValues(), and newlist changed to do mlist.CheckValues().

Revision history for this message
msapiro (msapiro-users) wrote :

Logged In: YES
user_id=1123998
Originator: NO

I see what you're saying, but if this is to be addressed, I think it should be done in newlist itself, possibly as you suggest via a modified MailList.CheckValues().

I don't think it should be done by passing host_name to MailList.Create() because if that is done, the exception thrown by Create() is Errors.BadListNameError and it is reported by newlist as 'Illegal list name'. The problem here is if I specify say a listname of 'list' and an unqualified email host name of 'host' to newlist, newlist reports 'Illegal list name: list@host' which is confusing to the user who doesn't realize that the problem is 'host' needs to be qualified.

In summary, I think this patch should remain closed and perhaps a new bug should be opened for 'newlist doesn't validate urlhost and emailhost arguments'.

Revision history for this message
bwarsaw (bwarsaw) wrote :

Logged In: YES
user_id=12800
Originator: NO

I don't think this should be done in newlist. I've always regretted putting too much logic into the bin scripts because very often the code wants to be used elsewhere too. But anything in a script is basically unavailable to other parts of Mailman. +1 for working up a new bug/patch for validating urlhost and emailhost.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.