%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/mh-e/ |
Current File : //usr/local/share/emacs/27.2/lisp/mh-e/mh-junk.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\207" [require mh-e mh-scan] 2) #@480 Blacklist RANGE as spam. This command trains the spam program in use (see the option `mh-junk-program') with the content of RANGE and then handles the message(s) as specified by the option `mh-junk-disposition'. Check the documentation of `mh-interactive-range' to see how RANGE is read in interactive use. For more information about using your particular spam fighting program, see: - `mh-spamassassin-blacklist' - `mh-bogofilter-blacklist' - `mh-spamprobe-blacklist' (defalias 'mh-junk-blacklist #[(range) "\247\203 \306\307\211#\203\302 \310\311!\210\202\302 :\203L @\247\203L A\247\203L \212@b\210\312 \210`AX\203H m\204H \313 !\203B \310\311!\210\314y\210\202- )\202\302 \203[ 9\203[ \315!\202h ;\203g \316\n\"\202h \317 \211\311\211\203\221 @\211\320\307#\210*A\211\204u *\212eb\210\312 \210`dX\203\301 m\204\301 \313 !\203\273 \321\307!\322\"\203\272 \310\311!\210)\314y\210\202\231 +\313!\205\313 \323 \207" [range mh-scan-valid-regexp mh-current-folder #1=#:seq-hash-table #2=#:msgs msg mh-goto-msg t mh-blacklist-a-msg nil beginning-of-line looking-at 1 mh-seq-to-msgs mh-translate-range make-hash-table puthash mh-get-msg-num gethash mh-next-msg --dolist-tail-- #3=#:v #4=#:v v mh-scan-blacklisted-msg-regexp] 5 (#$ . 475) (list (mh-interactive-range "Blacklist"))]) #@166 Blacklist MESSAGE. If MESSAGE is nil then the message at point is blacklisted. The hook `mh-blacklist-msg-hook' is called after you mark a message for blacklisting. (defalias 'mh-blacklist-a-msg #[(message) "\212\247\203 \306\307\310#\210\202 \311 \210\312\310!\313 !\203# \314\315\"\202g \313\n!\2030 \314\316\"\202g \313!\203= \314\317\"\202g \313\f!\203G \307\202g \320\310!\210 B>\204\\ B\321\307#\210\322\323!)\207" [message mh-scan-refiled-msg-regexp mh-scan-deleted-msg-regexp mh-scan-whitelisted-msg-regexp mh-scan-blacklisted-msg-regexp mh-blacklist mh-goto-msg nil t beginning-of-line mh-get-msg-num looking-at error "Message %d is refiled; undo refile before blacklisting" "Message %d is deleted; undo delete before blacklisting" "Message %d is whitelisted; undo before blacklisting" mh-set-folder-modified-p mh-notate run-hooks mh-blacklist-msg-hook mh-seen-list mh-note-blacklisted mh-cmd-note] 4 (#$ . 1812)]) #@43 Determines the fate of the selected spam. (defalias 'mh-junk-blacklist-disposition #[nil "\204 \302\207\303\232\203 \304\207\305H\306=\203 \207\305H\307=\203( \310\311\312\"Q\207\304P\207" [mh-junk-disposition mh-current-folder nil "" "+" 0 43 64 "/" substring 1] 5 (#$ . 2765)]) #@213 Blacklist RANGE as spam. This command trains the spam program in use (see the option `mh-junk-program') with the content of RANGE and then handles the message(s) as specified by the option `mh-junk-disposition'. (defalias 'mh-junk-process-blacklist #[(range) "\306 \"A@\211\204 \307\310!\210\247\2030 \311\312\211#\205\313\314\f\"\210\nK\f!\210\313\315\f\")\202:\203y @\247\203y A\247\203y \212@b\210\316 \210`AX\205u m?\205u \317 !\203o \320\312!\313\314\f\"\210\nK\f!\210\313\315\f\"\210)\321y\210\202I )\202\203\210 9\203\210 \322!\202\226 ;\203\225 \323\"\202\226 \324 \211\325\211\203\302 @\211\326\312#\210*A\211\204\245 *\212eb\210\316 \210`dX\205m?\205\317 !\203\375 \320\312!\327\"\203\374 \313\314\f\"\210\nK\f!\210\313\315\f\"\210))\321y\210\202\312 +)\207" [mh-junk-choice mh-junk-function-alist blacklist-func range msg mh-scan-valid-regexp assoc error "Customize `mh-junk-program' appropriately" mh-goto-msg t message "Blacklisting message %d..." "Blacklisting message %d...done" beginning-of-line looking-at mh-get-msg-num 1 mh-seq-to-msgs mh-translate-range make-hash-table nil puthash gethash mh-current-folder #1=#:seq-hash-table #2=#:msgs --dolist-tail-- #3=#:v #4=#:v v] 5 (#$ . 3063)]) #@297 Whitelist RANGE as ham. This command reclassifies the RANGE as ham if it were incorrectly classified as spam (see the option `mh-junk-program'). It then refiles the message into the "+inbox" folder. Check the documentation of `mh-interactive-range' to see how RANGE is read in interactive use. (defalias 'mh-junk-whitelist #[(range) "\247\203 \306\307\211#\203\302 \310\311!\210\202\302 :\203L @\247\203L A\247\203L \212@b\210\312 \210`AX\203H m\204H \313 !\203B \310\311!\210\314y\210\202- )\202\302 \203[ 9\203[ \315!\202h ;\203g \316\n\"\202h \317 \211\311\211\203\221 @\211\320\307#\210*A\211\204u *\212eb\210\312 \210`dX\203\301 m\204\301 \313 !\203\273 \321\307!\322\"\203\272 \310\311!\210)\314y\210\202\231 +\313!\205\313 \323 \207" [range mh-scan-valid-regexp mh-current-folder #1=#:seq-hash-table #2=#:msgs msg mh-goto-msg t mh-junk-whitelist-a-msg nil beginning-of-line looking-at 1 mh-seq-to-msgs mh-translate-range make-hash-table puthash mh-get-msg-num gethash mh-next-msg --dolist-tail-- #3=#:v #4=#:v v mh-scan-whitelisted-msg-regexp] 5 (#$ . 4341) (list (mh-interactive-range "Whitelist"))]) #@166 Whitelist MESSAGE. If MESSAGE is nil then the message at point is whitelisted. The hook `mh-whitelist-msg-hook' is called after you mark a message for whitelisting. (defalias 'mh-junk-whitelist-a-msg #[(message) "\212\247\203 \306\307\310#\210\202 \311 \210\312\310!\313 !\203# \314\315\"\202Z \313\n!\2030 \314\316\"\202Z \313!\203= \314\317\"\202Z \313\f!\203G \307\202Z \320\310!\210 B\321\307#\210\322\323!)\207" [message mh-scan-refiled-msg-regexp mh-scan-deleted-msg-regexp mh-scan-blacklisted-msg-regexp mh-scan-whitelisted-msg-regexp mh-whitelist mh-goto-msg nil t beginning-of-line mh-get-msg-num looking-at error "Message %d is refiled; undo refile before whitelisting" "Message %d is deleted; undo delete before whitelisting" "Message %d is blacklisted; undo before whitelisting" mh-set-folder-modified-p mh-notate run-hooks mh-whitelist-msg-hook mh-note-whitelisted mh-cmd-note] 4 (#$ . 5501)]) #@147 Whitelist RANGE as ham. This command reclassifies the RANGE as ham if it were incorrectly classified as spam (see the option `mh-junk-program'). (defalias 'mh-junk-process-whitelist #[(range) "\306\307 \"8\211\204 \310\311!\210\247\2030 \312\313\211#\205\314\315\f\"\210\nK\f!\210\314\316\f\")\202:\203y @\247\203y A\247\203y \212@b\210\317 \210`AX\205u m?\205u \320 !\203o \321\313!\314\315\f\"\210\nK\f!\210\314\316\f\"\210)\322y\210\202I )\202\203\210 9\203\210 \323!\202\226 ;\203\225 \324\"\202\226 \325 \211\326\211\203\302 @\211\327\313#\210*A\211\204\245 *\212eb\210\317 \210`dX\205m?\205\320 !\203\375 \321\313!\330\"\203\374 \314\315\f\"\210\nK\f!\210\314\316\f\"\210))\322y\210\202\312 +)\207" [mh-junk-choice mh-junk-function-alist whitelist-func range msg mh-scan-valid-regexp 2 assoc error "Customize `mh-junk-program' appropriately" mh-goto-msg t message "Whitelisting message %d..." "Whitelisting message %d...done" beginning-of-line looking-at mh-get-msg-num 1 mh-seq-to-msgs mh-translate-range make-hash-table nil puthash gethash mh-current-folder #1=#:seq-hash-table #2=#:msgs --dolist-tail-- #3=#:v #4=#:v v] 5 (#$ . 6430)]) (defvar mh-spamassassin-executable (executable-find "spamassassin")) (defvar mh-sa-learn-executable (executable-find "sa-learn")) #@3169 Blacklist MSG with SpamAssassin. SpamAssassin is one of the more popular spam filtering programs. Get it from your local distribution or from the SpamAssassin web site at URL `http://spamassassin.org/'. To use SpamAssassin, add the following recipes to ".procmailrc": PATH=$PATH:/usr/bin/mh MAILDIR=$HOME/`mhparam Path` # Fight spam with SpamAssassin. :0fw | spamc # Anything with a spam level of 10 or more is junked immediately. :0: * ^X-Spam-Level: .......... /dev/null :0: * ^X-Spam-Status: Yes spam/. If you don't use "spamc", use "spamassassin -P -a". Note that one of the recipes above throws away messages with a score greater than or equal to 10. Here's how you can determine a value that works best for you. First, run "spamassassin -t" on every mail message in your archive and use Gnumeric to verify that the average plus the standard deviation of good mail is under 5, the SpamAssassin default for "spam". Using Gnumeric, sort the messages by score and view the messages with the highest score. Determine the score which encompasses all of your interesting messages and add a couple of points to be conservative. Add that many dots to the "X-Spam-Level:" header field above to send messages with that score down the drain. In the example above, messages with a score of 5-9 are set aside in the "+spam" folder for later review. The major weakness of rules-based filters is a plethora of false positives so it is worthwhile to check. If SpamAssassin classifies a message incorrectly, or is unsure, you can use the MH-E commands \[mh-junk-blacklist] and \[mh-junk-whitelist]. The command \[mh-junk-blacklist] adds a "blacklist_from" entry to "~/spamassassin/user_prefs", deletes the message, and sends the message to the Razor, so that others might not see this spam. If the "sa-learn" command is available, the message is also recategorized as spam. The command \[mh-junk-whitelist] adds a "whitelist_from" rule to the "~/.spamassassin/user_prefs" file. If the "sa-learn" command is available, the message is also recategorized as ham. Over time, you'll observe that the same host or domain occurs repeatedly in the "blacklist_from" entries, so you might think that you could avoid future spam by blacklisting all mail from a particular domain. The utility function `mh-spamassassin-identify-spammers' helps you do precisely that. This function displays a frequency count of the hosts and domains in the "blacklist_from" entries from the last blank line in "~/.spamassassin/user_prefs" to the end of the file. This information can be used so that you can replace multiple "blacklist_from" entries with a single wildcard entry such as: blacklist_from *@*amazingoffersdirect2u.com In versions of SpamAssassin (2.50 and on) that support a Bayesian classifier, \[mh-junk-blacklist] uses the program "sa-learn" to recategorize the message as spam. Neither MH-E, nor SpamAssassin, rebuilds the database after adding words, so you will need to run "sa-learn --rebuild" periodically. This can be done by adding the following to your crontab: 0 * * * * sa-learn --rebuild > /dev/null 2>&1 (defalias 'mh-spamassassin-blacklist #[(msg) "\204 \306\307!\210 \310\n \"\311\312\313\n\"\210\314 \210r&q\210\315\f'\311\316\317&\210(\203D \312\320\n\"\210\314 \210\315(\f'\311\321\322\323\324&\210)\312\325\n\"\210r\326)!q\210\327 \210\315\330*+\"\311\331\311\332\333\n\" \334\335&\210eb\210\336\337\311\331#\203\203 \340\341!\342\343\"\210\312\344\n\"\202\207 \312\345\n\",\207" [mh-spamassassin-executable mh-current-folder msg sender msg-file current-folder error "Unable to find the spamassassin executable" mh-msg-filename nil message "Reporting message %d..." mh-truncate-log-buffer call-process "-r" "-R" "Recategorizing message %d as spam..." "--single" "--spam" "--local" "--no-rebuild" "Blacklisting sender of message %d..." get-buffer-create erase-buffer expand-file-name t format "%d" "-format" "%<(mymbox{from})%|%(addr{from})%>" search-forward-regexp "^\\(.+\\)$" match-string 0 mh-spamassassin-add-rule "blacklist_from" "Blacklisting sender of message %d...done" "Blacklisting sender of message %d...not done (from my address)" mh-log-buffer mh-junk-background mh-sa-learn-executable mh-temp-buffer mh-scan-prog mh-progs] 9 (#$ . 7778)]) #@276 Whitelist MSG with SpamAssassin. The \[mh-junk-whitelist] command adds a "whitelist_from" rule to the "~/.spamassassin/user_prefs" file. If the "sa-learn" command is available, the message is also recategorized as ham. See `mh-spamassassin-blacklist' for more information. (defalias 'mh-spamassassin-whitelist #[(msg) "\204 \306\307!\210\310 \n\"\311!\312r\313 !q\210\314 \210\315\316 \"\210\317\320\312\321%\210 \2034 \322 !\210\323!\210!\203[ \315\324 \"\210\325 \210r\"q\210\317!#\312\326\327\330\331&\210)\315\332 \"\210\312\322\312!\210\f\203u \f\333\232\204u \334\335\f\"\210\315\336 \",\207" [mh-spamassassin-executable msg mh-current-folder mh-show-buffer from show-buffer error "Unable to find the spamassassin executable" mh-msg-filename get-buffer nil get-buffer-create erase-buffer message "Removing spamassassin markup from message %d..." call-process t "-d" kill-buffer write-file "Recategorizing message %d as ham..." mh-truncate-log-buffer "--single" "--ham" "--local" "--no-rebuild" "Whitelisting sender of message %d..." "" mh-spamassassin-add-rule "whitelist_from" "Whitelisting sender of message %d...done" msg-file mh-temp-buffer mh-sa-learn-executable mh-log-buffer mh-junk-background] 9 (#$ . 12127)]) #@100 Add a new rule to "~/.spamassassin/user_prefs". The name of the rule is RULE and its body is BODY. (defalias 'mh-spamassassin-add-rule #[(rule body) "\306 \307\216\310\311 \n#\312\313\314!\315 !\316 !\210\317\310\320\"\321\312#\2048 db\210n\2030 \322\2021 \323\261\210\324 \210?\205A \325\321!.\207" [#1=#:wconfig rule body line case-fold-search file current-window-configuration #[nil "\301!\207" [#1# set-window-configuration] 2] format "%s %s\n" t expand-file-name "~/.spamassassin/user_prefs" find-buffer-visiting find-file search-forward "\n%s" nil "" "\n" save-buffer kill-buffer buffer-exists] 4 (#$ . 13382)]) #@399 Identify spammers who are repeat offenders. This function displays a frequency count of the hosts and domains in the "blacklist_from" entries from the last blank line in "~/.spamassassin/user_prefs" to the end of the file. This information can be used so that you can replace multiple "blacklist_from" entries with a single wildcard entry such as: blacklist_from *@*amazingoffersdirect2u.com (defalias 'mh-spamassassin-identify-spammers #[nil "\306\307!\310\311\312\"\313!\210dSb\210\314\315!\210\212\316\317\320\321#\203V \322\323!\320\324\325\326\"!A\211\203R \327@ \"@ \330\f\n\204E \331\202F \nT #\210*A\211\2040 *\202 )\332 \210\333\334\335!!\210\336 \210\337\340 \"\210\341\323ed#\210\342ed\"\210eb*\207" [file domains value host #1=#:v #2=#:v expand-file-name "~/.spamassassin/user_prefs" make-hash-table :test equal find-file search-backward-regexp "^$" search-forward-regexp "^blacklist_from\\s-*\\(.*\\)@\\(.*\\)$" nil t match-string 2 reverse split-string "\\." gethash puthash 0 delete-other-windows pop-to-buffer get-buffer-create "*MH-E Spammer Frequencies*" erase-buffer maphash #[(key value) "\302V\205\f \303\304 #c\207" [value key 2 format "%s %s\n"] 4 ""] sort-numeric-fields reverse-region] 5 (#$ . 14020) nil]) (defvar mh-bogofilter-executable (executable-find "bogofilter")) #@1371 Blacklist MSG with bogofilter. Bogofilter is a Bayesian spam filtering program. Get it from your local distribution or from the bogofilter web site at URL `http://bogofilter.sourceforge.net/'. Bogofilter is taught by running: bogofilter -n < good-message on every good message, and bogofilter -s < spam-message on every spam message. This is called a full training; three other training methods are described in the FAQ that is distributed with bogofilter. Note that most Bayesian filters need 1000 to 5000 of each type of message to start doing a good job. To use bogofilter, add the following recipes to ".procmailrc": PATH=$PATH:/usr/bin/mh MAILDIR=$HOME/`mhparam Path` # Fight spam with bogofilter. :0fw | bogofilter -3 -e -p :0: * ^X-Bogosity: Yes, tests=bogofilter spam/. :0: * ^X-Bogosity: Unsure, tests=bogofilter spam/unsure/. If bogofilter classifies a message incorrectly, or is unsure, you can use the MH-E commands \[mh-junk-blacklist] and \[mh-junk-whitelist] to update bogofilter's training. The "Bogofilter FAQ" suggests that you run the following occasionally to shrink the database: bogoutil -d wordlist.db | bogoutil -l wordlist.db.new mv wordlist.db wordlist.db.prv mv wordlist.db.new wordlist.db The "Bogofilter tuning HOWTO" describes how you can fine-tune Bogofilter. (defalias 'mh-bogofilter-blacklist #[(msg) "\204 \306\307!\210\310 \n\"\311 \210r\fq\210\312 \313\314%*\207" [mh-bogofilter-executable msg mh-current-folder msg-file mh-log-buffer mh-junk-background error "Unable to find the bogofilter executable" mh-msg-filename mh-truncate-log-buffer call-process nil "-s"] 6 (#$ . 15348)]) #@85 Whitelist MSG with bogofilter. See `mh-bogofilter-blacklist' for more information. (defalias 'mh-bogofilter-whitelist #[(msg) "\204 \306\307!\210\310 \n\"\311 \210r\fq\210\312 \313\314%*\207" [mh-bogofilter-executable msg mh-current-folder msg-file mh-log-buffer mh-junk-background error "Unable to find the bogofilter executable" mh-msg-filename mh-truncate-log-buffer call-process nil "-n"] 6 (#$ . 17056)]) (defvar mh-spamprobe-executable (executable-find "spamprobe")) #@635 Blacklist MSG with SpamProbe. SpamProbe is a Bayesian spam filtering program. Get it from your local distribution or from the SpamProbe web site at URL `http://spamprobe.sourceforge.net'. To use SpamProbe, add the following recipes to ".procmailrc": PATH=$PATH:/usr/bin/mh MAILDIR=$HOME/`mhparam Path` # Fight spam with SpamProbe. :0 SCORE=| spamprobe receive :0 wf | formail -I "X-SpamProbe: $SCORE" :0: *^X-SpamProbe: SPAM spam/. If SpamProbe classifies a message incorrectly, you can use the MH-E commands \[mh-junk-blacklist] and \[mh-junk-whitelist] to update SpamProbe's training. (defalias 'mh-spamprobe-blacklist #[(msg) "\204 \306\307!\210\310 \n\"\311 \210r\fq\210\312 \313\314%*\207" [mh-spamprobe-executable msg mh-current-folder msg-file mh-log-buffer mh-junk-background error "Unable to find the spamprobe executable" mh-msg-filename mh-truncate-log-buffer call-process nil "spam"] 6 (#$ . 17542)]) #@83 Whitelist MSG with SpamProbe. See `mh-spamprobe-blacklist' for more information. (defalias 'mh-spamprobe-whitelist #[(msg) "\204 \306\307!\210\310 \n\"\311 \210r\fq\210\312 \313\314%*\207" [mh-spamprobe-executable msg mh-current-folder msg-file mh-log-buffer mh-junk-background error "Unable to find the spamprobe executable" mh-msg-filename mh-truncate-log-buffer call-process nil "good"] 6 (#$ . 18513)]) (provide 'mh-junk)