Script performance: Filtering email
Sheila King
sheila at thinkspot.net
Wed Jan 17 02:27:03 EST 2001
Found my bug. The original code is show below. The correction follows.
On Tue, 16 Jan 2001 01:18:19 -0800, Sheila King <sheila at thinkspot.net> wrote
about [Tutor] Script performance: Filtering email:
: ##check if to: and cc: addresses are in my approved file
: def goodmessage(addresseeslist, rcptlist):
: for addr in addresseeslist:
: for rcpt in rcptlist:
: if (upper(addr[1]) == upper(rcpt)):
: return 1
: return 0
Correction:
def goodmessage(addresseeslist, rcptlist):
for addr in addresseeslist:
for rcpt in rcptlist:
if (string.upper(addr[1]) == string.upper(rcpt)):
return 1
return 0
Note this line, especially:
if (string.upper(addr[1]) == string.upper(rcpt)):
--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/
More information about the Python-list
mailing list