sync_members just failes if even 1 email address is invalid

Bug #266437 reported by Mercmobily
2
Affects Status Importance Assigned to Milestone
GNU Mailman
New
Medium
Unassigned

Bug Description

Hi,

Right now, sync_members just fails if there are invalid email addresses.
I wrote a Drupal module that uses mailman to send emails. The problem I
have is that I am using sync_members automatically, and it would be 100
times easier for me if the invalid email addresses were ignored, rather
than the whole script failing.
The code is:

  # first filter out any invalid addresses
    filemembers = email.Utils.getaddresses(filemembers)
    invalid = 0
    for name, addr in filemembers:
        try:
            Utils.ValidateEmail(addr)
        except Errors.EmailAddressError:
            print _('Invalid : %(addr)30s')
            invalid = 1
    if invalid:
        print _('You must fix the preceding invalid addresses first.')
        sys.exit(1)

I think having a command line option for this would be fantastic -
something like "-i" ("ignore invalid email addresses"), which if selected
makes sure that the script simply ignores invalid email addresses, and
basically "always works" (unless of course the mailing list name is wrong,
etc.).

I don't know python at all (shame on me), or I swear I'd be submitting a
patch (I am a Drupal developer, and submit patches whenever I can).

Thank you!!!

Merc.

[http://sourceforge.net/tracker/index.php?func=detail&aid=1870246&group_id=103&atid=100103]

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.