Mercurial > emacs
comparison lisp/mh-e/mh-junk.el @ 67988:7882fc7df359
* mh-alias.el (mh-alias-grab-from-field): Remove leading * from
docstring. Does this mean something in a defun?
* mh-customize.el (bw-new-face-to-old, bw-old-face-to-new): Checkdoc
fix.
* mh-e.el (mh-inc-folder): Rename maildrop-name argument to file so it
reads better in docstring and manual. Sync docstring with manual.
* mh-init.el (mh-defface-compat): Remove trailing space (checkdoc).
* mh-alias.el (mh-alias-apropos): Sync docstring with manual.
* mh-comp.el (mh-redistribute, mh-to-field, mh-to-fcc)
(mh-insert-auto-fields, mh-send-letter, mh-yank-cur-msg)
(mh-fully-kill-draft, mh-open-line, mh-letter-complete)
(mh-letter-complete-or-space, mh-letter-confirm-address)
(mh-letter-next-header-field-or-indent)
(mh-letter-previous-header-field): Ditto.
* mh-customize.el (mh-alias-completion-ignore-case-flag)
(mh-default-folder-for-message-function, mh-mml-method-default)
(mh-signature-file-name, mh-yank-behavior, mh-show-hook)
(mh-show-mode-hook) Ditto.
* mh-e.el (mh-refile-or-write-again, mh-toggle-showing): Ditto.
* mh-funcs.el (mh-pipe-msg, mh-sort-folder, mh-undo-folder)
(mh-store-msg, mh-store-buffer): Ditto
* mh-index.el (mh-index-search, mh-index-do-search)
(mh-index-next-folder, mh-index-sequenced-messages): Ditto.
* mh-junk.el (mh-spamassassin-blacklist): Ditto.
* mh-mime.el (mh-mh-compose-external-compressed-tar)
(mh-mh-compose-external-type, mh-mh-to-mime, mh-mh-to-mime-undo)
(mh-mml-secure-message-sign, mh-mml-secure-message-encrypt)
(mh-mml-secure-message-signencrypt): Ditto
* mh-pick.el (mh-search-folder): Ditto.
* mh-seq.el (mh-widen): Ditto.
* mh-utils.el (mh-show, mh-modify): Ditto.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Tue, 03 Jan 2006 06:13:43 +0000 |
parents | 9c3504ae6060 |
children | 03bac2d0a4aa |
comparison
equal
deleted
inserted
replaced
67987:121a9a222aab | 67988:7882fc7df359 |
---|---|
1 ;;; mh-junk.el --- Interface to anti-spam measures | 1 ;;; mh-junk.el --- Interface to anti-spam measures |
2 | 2 |
3 ;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. | 3 ;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>, | 5 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>, |
6 ;; Bill Wohler <wohler@newt.com> | 6 ;; Bill Wohler <wohler@newt.com> |
7 ;; Maintainer: Bill Wohler <wohler@newt.com> | 7 ;; Maintainer: Bill Wohler <wohler@newt.com> |
8 ;; Keywords: mail, spam | 8 ;; Keywords: mail, spam |
106 (defvar mh-sa-learn-executable (executable-find "sa-learn")) | 106 (defvar mh-sa-learn-executable (executable-find "sa-learn")) |
107 | 107 |
108 (defun mh-spamassassin-blacklist (msg) | 108 (defun mh-spamassassin-blacklist (msg) |
109 "Blacklist MSG with SpamAssassin. | 109 "Blacklist MSG with SpamAssassin. |
110 | 110 |
111 SpamAssassin is one of the more popular spam filtering programs. Get | 111 SpamAssassin is one of the more popular spam filtering programs. |
112 it from your local distribution or from http://spamassassin.org/. | 112 Get it from your local distribution or from |
113 | 113 http://spamassassin.org/. |
114 To use SpamAssassin, add the following recipes to \".procmailrc\": | 114 |
115 To use SpamAssassin, add the following recipes to | |
116 \".procmailrc\": | |
115 | 117 |
116 MAILDIR=$HOME/`mhparam Path` | 118 MAILDIR=$HOME/`mhparam Path` |
117 | 119 |
118 # Fight spam with SpamAssassin. | 120 # Fight spam with SpamAssassin. |
119 :0fw | 121 :0fw |
128 * ^X-Spam-Status: Yes | 130 * ^X-Spam-Status: Yes |
129 spam/. | 131 spam/. |
130 | 132 |
131 If you don't use \"spamc\", use \"spamassassin -P -a\". | 133 If you don't use \"spamc\", use \"spamassassin -P -a\". |
132 | 134 |
133 Note that one of the recipes above throws away messages with a score | 135 Note that one of the recipes above throws away messages with a |
134 greater than or equal to 10. Here's how you can determine a value that | 136 score greater than or equal to 10. Here's how you can determine a |
135 works best for you. | 137 value that works best for you. |
136 | 138 |
137 First, run \"spamassassin -t\" on every mail message in your archive and | 139 First, run \"spamassassin -t\" on every mail message in your |
138 use Gnumeric to verify that the average plus the standard deviation of | 140 archive and use Gnumeric to verify that the average plus the |
139 good mail is under 5, the SpamAssassin default for \"spam\". | 141 standard deviation of good mail is under 5, the SpamAssassin |
140 | 142 default for \"spam\". |
141 Using Gnumeric, sort the messages by score and view the messages with | 143 |
142 the highest score. Determine the score which encompasses all of your | 144 Using Gnumeric, sort the messages by score and view the messages |
143 interesting messages and add a couple of points to be conservative. | 145 with the highest score. Determine the score which encompasses all |
144 Add that many dots to the \"X-Spam-Level:\" header field above to send | 146 of your interesting messages and add a couple of points to be |
145 messages with that score down the drain. | 147 conservative. Add that many dots to the \"X-Spam-Level:\" header |
146 | 148 field above to send messages with that score down the drain. |
147 In the example above, messages with a score of 5-9 are set aside in | 149 |
148 the \"+spam\" folder for later review. The major weakness of rules-based | 150 In the example above, messages with a score of 5-9 are set aside |
149 filters is a plethora of false positives so it is worthwhile to check. | 151 in the \"+spam\" folder for later review. The major weakness of |
150 | 152 rules-based filters is a plethora of false positives so it is |
151 If SpamAssassin classifies a message incorrectly, or is unsure, you | 153 worthwhile to check. |
152 can use the MH-E commands \\[mh-junk-blacklist] and | 154 |
155 If SpamAssassin classifies a message incorrectly, or is unsure, | |
156 you can use the MH-E commands \\[mh-junk-blacklist] and | |
153 \\[mh-junk-whitelist]. | 157 \\[mh-junk-whitelist]. |
154 | 158 |
155 The \\[mh-junk-blacklist] command adds a \"blacklist_from\" entry to | 159 The command \\[mh-junk-blacklist] adds a \"blacklist_from\" entry |
156 \"~/spamassassin/user_prefs\", deletes the message, and sends the | 160 to \"~/spamassassin/user_prefs\", deletes the message, and sends |
157 message to the Razor, so that others might not see this spam. If the | 161 the message to the Razor, so that others might not see this spam. |
158 \"sa-learn\" command is available, the message is also recategorized as | 162 If the \"sa-learn\" command is available, the message is also |
159 spam. | 163 recategorized as spam. |
160 | 164 |
161 The \\[mh-junk-whitelist] command adds a \"whitelist_from\" rule to the | 165 The command \\[mh-junk-whitelist] adds a \"whitelist_from\" rule |
162 \"~/.spamassassin/user_prefs\" file. If the \"sa-learn\" command is | 166 to the \"~/.spamassassin/user_prefs\" file. If the \"sa-learn\" |
163 available, the message is also recategorized as ham. | 167 command is available, the message is also recategorized as ham. |
164 | 168 |
165 Over time, you'll observe that the same host or domain occurs | 169 Over time, you'll observe that the same host or domain occurs |
166 repeatedly in the \"blacklist_from\" entries, so you might think that | 170 repeatedly in the \"blacklist_from\" entries, so you might think |
167 you could avoid future spam by blacklisting all mail from a particular | 171 that you could avoid future spam by blacklisting all mail from a |
168 domain. The utility function `mh-spamassassin-identify-spammers' helps | 172 particular domain. The utility function |
169 you do precisely that. This function displays a frequency count of the | 173 `mh-spamassassin-identify-spammers' helps you do precisely that. |
170 hosts and domains in the \"blacklist_from\" entries from the last blank | 174 This function displays a frequency count of the hosts and domains |
171 line in \"~/.spamassassin/user_prefs\" to the end of the file. This | 175 in the \"blacklist_from\" entries from the last blank line in |
176 \"~/.spamassassin/user_prefs\" to the end of the file. This | |
172 information can be used so that you can replace multiple | 177 information can be used so that you can replace multiple |
173 \"blacklist_from\" entries with a single wildcard entry such as: | 178 \"blacklist_from\" entries with a single wildcard entry such as: |
174 | 179 |
175 blacklist_from *@*amazingoffersdirect2u.com | 180 blacklist_from *@*amazingoffersdirect2u.com |
176 | 181 |
177 In versions of SpamAssassin (2.50 and on) that support a Bayesian | 182 In versions of SpamAssassin (2.50 and on) that support a Bayesian |
178 classifier, \\[mh-junk-blacklist] uses the \"sa-learn\" program to | 183 classifier, \\[mh-junk-blacklist] uses the program \"sa-learn\" |
179 recategorize the message as spam. Neither MH-E, nor SpamAssassin, | 184 to recategorize the message as spam. Neither MH-E, nor |
180 rebuilds the database after adding words, so you will need to run | 185 SpamAssassin, rebuilds the database after adding words, so you |
181 \"sa-learn --rebuild\" periodically. This can be done by adding the | 186 will need to run \"sa-learn --rebuild\" periodically. This can be |
182 following to your crontab: | 187 done by adding the following to your crontab: |
183 | 188 |
184 0 * * * * sa-learn --rebuild > /dev/null 2>&1" | 189 0 * * * * sa-learn --rebuild > /dev/null 2>&1" |
185 (unless mh-spamassassin-executable | 190 (unless mh-spamassassin-executable |
186 (error "Unable to find the spamassassin executable")) | 191 (error "Unable to find the spamassassin executable")) |
187 (let ((current-folder mh-current-folder) | 192 (let ((current-folder mh-current-folder) |