[spambayes-bugs] [ spambayes-Bugs-2916335 ] From lines get mangled by sb_filter.py

SourceForge.net noreply at sourceforge.net
Sat Dec 19 01:10:09 CET 2009


Bugs item #2916335, was opened at 2009-12-17 10:22
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=2916335&group_id=61702

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: hammie
Group: Source code - CVS
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Alexandre Ratti (alexratti)
Assigned to: Skip Montanaro (montanaro)
Summary: From lines get mangled by sb_filter.py

Initial Comment:
I installed the SVN code to get around the From escaping problem discussed on these pages:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559977
https://sourceforge.net/tracker/?func=detail&aid=2908573&group_id=61702&atid=498103

However, messages still get mangled by the latest SVN code (revision 3255): the first From header of a messages is stripped. As a result, messages stored in mbox files on a Linux server are invisible to mail readers such as Thunderbird (IMAP access) and Mutt (local access).

----------------------------------------------------------------------

>Comment By: Skip Montanaro (montanaro)
Date: 2009-12-18 18:10

Message:
Thanks for the report.  Obviously the fix is going to be a little tougher
than I first thought.  I've
reverted the previous change.

----------------------------------------------------------------------

Comment By: Alexandre Ratti (alexratti)
Date: 2009-12-18 13:51

Message:
Update. What I understood so far:

1) Spambayes 1.03 + mail 2.5.4 (from Python 2.3) -> no problem. This was
the Debian Sarge setup.

2) Spambayes 1.04 + mail 2.5.4 (from Python 2.3) -> no problem. 

3) Spambayes 1.03 + mail 3.0.2 (from Python 2.4) -> broken. 

4) Spambayes 1.04 + mail 3.0.2 (from Python 2.4) -> broken. This is what
happens on Debian Etch and Lenny.

5) Spambayes 1.1 from SVN (revision 3256 checked in today): mangles every
test message I send from Thunderbird 2. Spambayes headers (X-Spambayes-*)
get inserted just after the first "From" header. See previous bug report: 

https://sourceforge.net/tracker/?func=detail&aid=2908573&group_id=61702&ati
d=498103


----------------------------------------------------------------------

Comment By: Alexandre Ratti (alexratti)
Date: 2009-12-17 11:48

Message:
OK, some more checks:

In "/usr/lib/python2.4/site-packages/", I can find the file
"spambayes-1.1b1-py2.4.egg"

This egg was generated when installing from the source release (see
previous comment). I had a look at its content and I can see your recent
changes to "message.py":

def as_string(self, unixfrom=False, mangle_from_=False):

http://spambayes.svn.sourceforge.net/viewvc/spambayes/trunk/spambayes/spambayes/message.py?sortby=rev&view=diff&r1=3255&r2=3254&diff_format=h

So I guess that I'm actually running the last SVN code (I was worried I
wasn't :-).


----------------------------------------------------------------------

Comment By: Alexandre Ratti (alexratti)
Date: 2009-12-17 11:12

Message:
I'm actually seeing this with sb_filter.py. To double-check, I just ran:

cat test-message.txt | sb_filter.py > take2.txt
diff -u test-message.txt take2.txt > take2.diff

I'm getting the same result. First "From" line is deleted. 

which sb_filter.py
/usr/bin/sb_filter.py

This is what I have in sb_filter.py:

#!/usr/bin/python
# EASY-INSTALL-SCRIPT: 'spambayes==1.1b1','sb_filter.py'
__requires__ = 'spambayes==1.1b1'
import pkg_resources
pkg_resources.run_script('spambayes==1.1b1', 'sb_filter.py')

I installed this Spambayes copy from SVN. To get it:
1) I checked out trunk two days ago.
2) I made a source release with "python setup.py sdist --formats gztar".
3) I installed this release (with "setup.py install", I think).

Do you think I have a version mixup?

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2009-12-17 10:50

Message:
Alexandre,  what SpamBayes tool demonstrates this problem?  I tested the
change using sb_filter.py.  It seems you're seeing this with another one of
the SpamBayes tools.



----------------------------------------------------------------------

Comment By: Alexandre Ratti (alexratti)
Date: 2009-12-17 10:37

Message:
I clicked Submit too fast; I wanted to attach files for testing and now I
can't. So I uploaded the files to:

http://alexandre.ratti.free.fr/sb/

To test, I first mailed myself a message with the command line "mail"
utility. This message went through my system (procmail and clamav), but it
was NOT filtered by spambayes (deactivated in .procmailrc). 

Then I filter the message through sb_filter.py on the command line and I
created a diff. As you can see, the first From line is missing from the
processed message.

I'm assigning this report to user "montanaro" since he checked in the fix
for the From escaping issue.

Thanks.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=2916335&group_id=61702


More information about the Spambayes-bugs mailing list