From pdmef at gmx.net Wed Jul 8 14:08:18 2009 From: pdmef at gmx.net (Rocco Rutte) Date: Wed, 8 Jul 2009 14:08:18 +0200 Subject: [spambayes-dev] [PATCH] Keep flags for maildir Message-ID: <20090708120818.GA15453@andreas.daprodeges.fqdn.th-h.de> Hi, I don't know if spambayes is dead... anyway it's annoying that when it learns a maildir message, it drops all the messages flags (read/replied/trashed/etc). The attached patch fixes it for me. (please Cc me as I'm not on either list) Rocco diff --git a/spambayes/scripts/sb_mboxtrain.py b/spambayes/scripts/sb_mboxtrain.py --- a/spambayes/scripts/sb_mboxtrain.py +++ b/spambayes/scripts/sb_mboxtrain.py @@ -118,9 +118,13 @@ def maildir_train(h, path, is_spam, forc for fn in os.listdir(path): cfn = os.path.join(path, fn) + mflags = ':2,' + if mflags in cfn: + mflags = cfn[cfn.find(mflags):] tfn = os.path.normpath(os.path.join(path, "..", "tmp", - "%d.%d_%d.%s" % (time.time(), pid, - counter, host))) + "%d.%d_%d.%s%s" % (time.time(), pid, + counter, host, + mflags))) if (os.path.isdir(cfn)): continue counter += 1 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 194 bytes Desc: not available URL: