[Tutor] subject screw

Kirk Bailey deliberatus@my995internet.com
Wed, 26 Dec 2001 12:18:09 -0500

ok, found a bug!

When a letter has no header field, rfc822 barks like a dog and aborts.

Discovered this when testing TLpost. SOME letters came through, some did
not. The bombes, had no subject field. SO I sent a letter to an alias to
save the incoming letter as a file, and ran the script locally,
redirecting input from the file. This way I could watch error messages
on the console screen. Very informative, I got back:
ns# ./TLpost.py testlist3 < testfile
Traceback (innermost last):
  File "./TLpost.py", line 159, in ?
    subject= string.strip(Message['Subject'])
  File "/usr/local/lib/python1.5/rfc822.py", line 356, in __getitem__
    return self.dict[string.lower(name)]
KeyError: subject
Apparently when there is NO subject, no kidding we really mean it, it
omits this header. When rfc822 receives such a leter, it screws the
pooch and crashes, albeit politely.

Reworking rfc822 to handle a non fatal error such as this is WAY beyond
my expertise. Please forward this to the appropriate kahuna.

             -Kirk D Bailey (C)2001
              Addme! icq #27840081

Within the sweep of his sword, Each man is an Ubar.