i ve been running hammie on all my incoming messages and i noticed that multipart alternative messages are totally hosed they have no content just the mime boundaries for instance the following message NUMBER from somebody someone somewhere org to neale URL subject booga content type multipart alternative boundary snot this is a multi part message in mime format snot content type text plain charset iso NUMBER NUMBER content transfer encoding NUMBERbit hi there snot content type text html charset iso NUMBER NUMBER content transfer encoding NUMBERbit pre hi there pre snot NUMBER comes out like this NUMBER from somebody someone somewhere org to neale URL subject booga content type multipart alternative boundary snot x hammie disposition no NUMBER NUMBER unrelated gar removed this is a multi part message in mime format snot snot NUMBER i m using python NUMBER NUMBERaNUMBER NUMBER sep NUMBER NUMBER NUMBER NUMBER NUMBER i ve fixed it with the following patch to tim s tokenizer but i have to admit that i m baffled as to why it works maybe there s some subtle interaction between generators and lists that i can t understand or something being as i m baffled i don t imagine any theory i come up with will be anywhere close to reality in any case be advised that at least for me hammie will eat multipart alternative messages until this patch is applied the patch seems rather bogus though so i m not checking it in in the hope that there s a better fix i just wasn t capable of discovering NUMBER index URL rcs file cvsroot spambayes spambayes URL v retrieving revision NUMBER NUMBER diff u rNUMBER NUMBER URL URL NUMBER sep NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER URL NUMBER sep NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER usr bin env python module to tokenize email messages for spam filtering import email NUMBER NUMBER NUMBER NUMBER htmlpart textpart none stack part get_payload while stack subpart stack pop subpart stack NUMBER stack stack NUMBER ctype subpart get_content_type if ctype text plain textpart subpart NUMBER 