Hello,

I'm having a strange problem with the sync_members script on Maiman.
I have a text file with about 8500 emails, one per line, and I've
filtered out whitespace for each email in the file, and checked that
they all have "@". I can add them to a mail list using "add_members -
r /tmp/file.txt", and they all get subscribed without any errors.
However, if I run sync_members with the same text file, I get the error:

Invalid : .edu
You must fix the preceding invalid addresses first.

How can it work with add_members but fail with sync_members? About
3700 of the emails on that list are .edu, and they all look legitimate
to me. I could remove all members, then add all members each time I
want to sync this list with our dynamic data source, but it would be
nice if sync_members were functional.

Any advice is appreciated.

Thanks,
Brent

Search Discussions

  • Brent Kearney at Sep 19, 2008 at 9:29 pm
    Hi,

    I found the problem with my data by temporarily adding a
    print_("Checking:" ... line to sync_members at around line 209:

    for name, addr in filemembers:
    try:
    print _('Checking: %(addr)1s')
    Utils.ValidateEmail(addr)
    except Errors.EmailAddressError:
    print _('Invalid: %(addr)1s')
    invalid = 1
    if invalid:
    print _('You must fix the preceding invalid addresses first.')
    sys.exit(1)

    There was a comma in one of the email addresses, like this:
    user at domain,.edu.

    So I solved my data problem, but the question remains as to why
    add_members didn't fail in the same place.

    Cheers,
    Brent
    On Sep 19, 2008, at 15:08 , Brent Kearney wrote:

    Hello,

    I'm having a strange problem with the sync_members script on
    Maiman. I have a text file with about 8500 emails, one per line,
    and I've filtered out whitespace for each email in the file, and
    checked that they all have "@". I can add them to a mail list using
    "add_members -r /tmp/file.txt", and they all get subscribed without
    any errors. However, if I run sync_members with the same text file,
    I get the error:

    Invalid : .edu
    You must fix the preceding invalid addresses first.

    How can it work with add_members but fail with sync_members? About
    3700 of the emails on that list are .edu, and they all look
    legitimate to me. I could remove all members, then add all members
    each time I want to sync this list with our dynamic data source, but
    it would be nice if sync_members were functional.

    Any advice is appreciated.

    Thanks,
    Brent
  • Mark Sapiro at Sep 20, 2008 at 8:15 pm

    Brent Kearney wrote:
    There was a comma in one of the email addresses, like this:
    user at domain,.edu.

    So I solved my data problem, but the question remains as to why
    add_members didn't fail in the same place.

    The processing between add_members and sync_members is different.
    sync_members first processes the entire list and if it finds any
    invalid addresses, it complains and does nothing. add_members
    processes one line at a time, and if there are problems, it reports
    them and continues.

    In this case, add_members will call email.Utils.parseaddr() to parse
    'user at domain,.edu'. parseaddr will return the null string as the real
    name and 'user at domain' as the address and ignore the ',.edu' part.

    sync_members works differently. It calls email.Utils.getaddresses()
    with argument equal to a list of all the lines in the file. This
    returns a list of parsed real names and addresses, but because of the
    way it processes the list, 'user at domain,.edu' gets treated as two
    addresses 'user at domain' and '.edu'.

    So both sync_members and add_members see the address 'user at domain'
    which at least syntactically looks valid, but additionally,
    sync_members sees '.edu' as a separate address which is invalid and
    add_members never sees it.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedSep 19, '08 at 9:08p
activeSep 20, '08 at 8:15p
posts3
users2
websitelist.org

2 users in discussion

Brent Kearney: 2 posts Mark Sapiro: 1 post

People

Translate

site design / logo © 2022 Grokbase