notspam: a notmuch interface to spamassassin
authorJameson Graef Rollins <jrollins@finestructure.net>
Wed, 6 Mar 2013 06:43:12 +0000 (22:43 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:56 +0000 (09:53 -0800)
ca/5374b6edc102dcefdf1250c36148c475d508d7 [new file with mode: 0644]

diff --git a/ca/5374b6edc102dcefdf1250c36148c475d508d7 b/ca/5374b6edc102dcefdf1250c36148c475d508d7
new file mode 100644 (file)
index 0000000..dcc52c0
--- /dev/null
@@ -0,0 +1,130 @@
+Return-Path: <jrollins@finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id C64E5431FBD\r
+       for <notmuch@notmuchmail.org>; Tue,  5 Mar 2013 22:43:37 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id mhhgBVPnpSRb for <notmuch@notmuchmail.org>;\r
+       Tue,  5 Mar 2013 22:43:18 -0800 (PST)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id 22F35431FAF\r
+       for <notmuch@notmuchmail.org>; Tue,  5 Mar 2013 22:43:18 -0800 (PST)\r
+Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by fire-doxen-postvirus (Postfix) with ESMTP id A27E22E50C8D\r
+       for <notmuch@notmuchmail.org>; Tue,  5 Mar 2013 22:43:17 -0800 (PST)\r
+X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
+Received: from finestructure.net (cpe-76-166-145-133.socal.res.rr.com\r
+       [76.166.145.133]) (Authenticated sender: jrollins)\r
+       by fire-doxen-submit (Postfix) with ESMTP id 791C62E507D2\r
+       for <notmuch@notmuchmail.org>; Tue,  5 Mar 2013 22:43:15 -0800 (PST)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id E029362216; Tue,  5 Mar 2013 22:43:14 -0800 (PST)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: notspam: a notmuch interface to spamassassin\r
+User-Agent: Notmuch/0.15+8~gd4a7374 (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Tue, 05 Mar 2013 22:43:12 -0800\r
+Message-ID: <87sj49gha7.fsf@servo.finestructure.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha256; protocol="application/pgp-signature"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 06 Mar 2013 06:43:40 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+Hey, folks.  I put together a little python program as an interface\r
+between notmuch and spamassassin (sa) that I thought others might be\r
+interested in:\r
+\r
+git://finestructure.net/notspam\r
+\r
+It's only dependencies are a running local sa daemon and python-notmuch.\r
+It's pretty straightforward: it's just a single python script that has\r
+two main functions 'learn' and 'tag'.  'Learn' takes a notmuch search\r
+and pipes the resulting messages into sa (via sa-learn) to be classified\r
+as ham or spam.  'Tag' takes a notmuch search and passes the resulting\r
+messages through the sa classifier (via spamc) to be tagged as ham or\r
+spam.\r
+\r
+Here's how I've been using it:\r
+\r
+ * Tag spam manually with the tag 'spam'.  It's good to have done this\r
+   for a while to build up a good amount of manual classification.\r
+\r
+ * Once you've got some manual classification, teach sa:\r
+\r
+   notspam learn spam tag:spam\r
+   notspam learn ham not tag:spam\r
+\r
+   Everything after the meat ('spam'/'ham') are the notmuch search\r
+   terms.  Rerun this periodically to update, but you might want to\r
+   restrict the search a little so sa-learn doesn't eat a lot of\r
+   overhead reprocessing old messages that haven't changed\r
+   classification.\r
+\r
+ * Call 'notspam tag' in your post-new hook (all my new messages are\r
+   tagged 'new' initially):\r
+\r
+   notspam tag --spam=spamd tag:new\r
+\r
+   I give the sa-classified mail a different tag so it's easy to\r
+   distinguish what was classified by me and what was classified by sa.\r
+\r
+Pretty simple.  See 'notspam help' for more info.\r
+\r
+Right now it's geared specifically for sa, but it would be easy to\r
+expand it to handle arbitrary learn/classify commands.  If there's any\r
+further interest in this, I would be happy to help push on it more.\r
+\r
+jamie.\r
+\r
+PS: if anyone has any suggestions for Bayesian classifiers better than\r
+sa I'm all ears.  I'm not so happy with sa at the moment.  It misses a\r
+lot more spam than I would like.  Maybe I just haven't tweaked it out\r
+yet, in which case if anyone has any suggestions on how to improve sa's\r
+classification I'm also all ears.\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.12 (GNU/Linux)\r
+\r
+iQIcBAEBCAAGBQJRNuWAAAoJEO00zqvie6q8OdwP/27j7evFUi1nU2YVmFIiPM2+\r
+S0AYVUd+WhWkTcHtaTw52G7iBI6nWwY2/01Itt35TToVhHpkbIu4LEcCdOIc+Lmx\r
+xfZ9cNy6brXNqveMSmF69haiVsenMfbl606aZcrQjEoQyk7AClxqnKxorihJD/LP\r
+uNt7aCZhi+hzRCCHq+Xeb8n4vPBHQ602KGhqaC8zJ1zgeGfFj9Zi5S0ZuMPkozJF\r
+0JFHyXcnlcFGKInGZ0ShSYQmvg3VDNnYk8uHRGSUdtUdFZbXg9gtDm23Ppsj6kaM\r
++k8g2z3fUunF4K043tyJsbsCbQkRtnXv5k3BAGNytkxwpoqOb8W9uT/f8wmbRuni\r
+hImYfkG6qvxKPVcnz2Xgz/6kVfca04tD+PlFlo311i3d2hocu751mRfzEDm+Ffwc\r
+kGbyzUoFR0/Jc+Fon7C3I7h0kw/A9fjc5kJELGoeKW7v293nu7MppJ9iJResSXBG\r
+l25f77Z3cWXUklL9I249Cf/WHcOO3MMf84XsUemiLrRag872rdzK1IHLc5aOmrwd\r
+2tS0goxSPo6+2h1JW0KMTiOEmAv3oxW109bYC9EDeQOpQ2a0RoAlokGNFtr0p4Ac\r
+dupPrUPS303ES3c5WmGyF88Yt8MfwhLY4Kx7oSgjxa7G4M8s1LSpSscnn8VtcXpp\r
+QRodps2Eb25NQ6qGQlIi\r
+=CXJB\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r