When Mailman is set up somewhere that has two domain
names that are considered "equal", it is possible for
the wrong e-mail address to be added to a list,
confusing the user.
For example, we have two domains, "le.ac.uk" and
"leicester.ac.uk". All outgoing mail is rewritten to be
sent from the domain "leicester.ac.uk", but users
always use the short form.
When subscribing users using mass-subscription, a list
of addresses can be given as "user@le.ac.uk", but then
mail from that user to the list will be rejected
("user@leicester.ac.uk" is not on the list!).
This patch adds a hook into MailList.ApprovedAddMember
and Mailman/Cgi/admin.py/change_options to call a
transform function for each new address added to a
list. The default for this function is to return the
supplied address unchanged.
An example for the above problem would be to define
this function in the mm_cfg.py file, thus:
def transform_email_address(email):
(local, domain) = email.split("@", 2)
if domain == "le.ac.uk":
domain = "leicester.ac.uk"
return "@".join([local, domain])
Site-wide hook for changing subscribers addresses
Logged In: YES
user_id=1239900
This patch will only apply cleanly to 2.1.5 after the
site_hide_list_options patch has been applied. This does not
matter, though, as it will apply and work fine on its own
(but has hunks moved).
Latest version of patch, transforms addresses entered on the user config page too