[PATCH] Keep flags for maildir
Rocco Rutte <[email protected]> Wed, 8 Jul 2009 14:08:18 +0200
| Newsgroups | gmane.mail.spam.spambayes.devel,gmane.mail.spam.spambayes.general |
|---|---|
| Message-ID | <[email protected]> |
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
_______________________________________________
spambayes-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-dev
signature.asc
(application/pgp-signature, 194 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkpUjDIACgkQaoDd2AVExWdNWQCgs7UVUyqg46WKfzVxbRRuEn83 cWkAoJ6bvcgECkMmEhwBVMS9KG/J7aMw =OyH/ -----END PGP SIGNATURE-----