* The problem of spam:: Some background, and some solutions
* Anti-Spam Basics:: Simple steps to reduce the amount of spam.
* SpamAssassin:: How to use external anti-spam tools.
-* Hashcash:: Reduce spam by burning CPU time.
Spam Package
* Blacklists and Whitelists::
* BBDB Whitelists::
* Gmane Spam Reporting::
-* Anti-spam Hashcash Payments::
* Blackholes::
* Regular Expressions Header Matching::
* Bogofilter::
* The problem of spam:: Some background, and some solutions
* Anti-Spam Basics:: Simple steps to reduce the amount of spam.
* SpamAssassin:: How to use external anti-spam tools.
-* Hashcash:: Reduce spam by burning CPU time.
@end menu
@node The problem of spam
(gnus-summary-mark-as-expirable 1))
@end lisp
-@node Hashcash
-@subsection Hashcash
-@cindex hashcash
-
-One technique to fight spam is to require senders to do something
-costly and demonstrably unique for each message they send. This has
-the obvious drawback that you cannot rely on everyone in the world
-using this technique, since it is not part of the Internet standards,
-but it may be useful in smaller communities.
-
-While the tools in the previous section work well in practice, they
-work only because the tools are constantly maintained and updated as
-new form of spam appears. This means that a small percentage of spam
-will always get through. It also means that somewhere, someone needs
-to read lots of spam to update these tools. Hashcash avoids that, but
-instead prefers that everyone you contact through e-mail supports the
-scheme. You can view the two approaches as pragmatic vs dogmatic.
-The approaches have their own advantages and disadvantages, but as
-often in the real world, a combination of them is stronger than either
-one of them separately.
-
-@cindex X-Hashcash
-The ``something costly'' is to burn CPU time, more specifically to
-compute a hash collision up to a certain number of bits. The
-resulting hashcash cookie is inserted in a @samp{X-Hashcash:} header.
-For more details, and for the external application @code{hashcash} you
-need to install to use this feature, see
-@uref{http://www.hashcash.org/}.
-
-If you wish to generate hashcash for each message you send, you can
-customize @code{message-generate-hashcash} (@pxref{Mail Headers, ,Mail
-Headers,message, The Message Manual}), as in:
-
-@lisp
-(setq message-generate-hashcash t)
-@end lisp
-
-You will need to set up some additional variables as well:
-
-@table @code
-
-@item hashcash-default-payment
-@vindex hashcash-default-payment
-This variable indicates the default number of bits the hash collision
-should consist of. By default this is 20. Suggested useful values
-include 17 to 29.
-
-@item hashcash-payment-alist
-@vindex hashcash-payment-alist
-Some receivers may require you to spend burn more CPU time than the
-default. This variable contains a list of @samp{(@var{addr}
-@var{amount})} cells, where @var{addr} is the receiver (email address
-or newsgroup) and @var{amount} is the number of bits in the collision
-that is needed. It can also contain @samp{(@var{addr} @var{string}
-@var{amount})} cells, where the @var{string} is the string to use
-(normally the email address or newsgroup name is used).
-
-@item hashcash-program
-@vindex hashcash-program
-Where the @code{hashcash} binary is installed. This variable should
-be automatically set by @code{executable-find}, but if it's @code{nil}
-(usually because the @code{hashcash} binary is not in your path)
-you'll get a warning when you check hashcash payments and an error
-when you generate hashcash payments.
-
-@end table
-
-Gnus can verify hashcash cookies, although this can also be done by
-hand customized mail filtering scripts. To verify a hashcash cookie
-in a message, use the @code{mail-check-payment} function in the
-@code{hashcash.el} library. You can also use the @code{spam.el}
-package with the @code{spam-use-hashcash} back end to validate hashcash
-cookies in incoming mail and filter mail accordingly (@pxref{Anti-spam
-Hashcash Payments}).
-
@node Spam Package
@section Spam Package
@cindex spam filtering
* Blacklists and Whitelists::
* BBDB Whitelists::
* Gmane Spam Reporting::
-* Anti-spam Hashcash Payments::
* Blackholes::
* Regular Expressions Header Matching::
* Bogofilter::
@end defvar
-@node Anti-spam Hashcash Payments
-@subsubsection Anti-spam Hashcash Payments
-@cindex spam filtering
-@cindex hashcash, spam filtering
-@cindex spam
-
-@defvar spam-use-hashcash
-
-Similar to @code{spam-use-whitelist} (@pxref{Blacklists and
-Whitelists}), but uses hashcash tokens for whitelisting messages
-instead of the sender address. Messages without a hashcash payment
-token will be sent to the next spam-split rule. This is an explicit
-filter, meaning that unless a hashcash token is found, the messages
-are not assumed to be spam or ham.
-
-@end defvar
-
@node Blackholes
@subsubsection Blackholes
@cindex spam filtering
This function will install a back end that can only check incoming mail
for spam contents. It can't register or unregister messages.
-@code{spam-use-blackholes} and @code{spam-use-hashcash} are such
-back ends.
+@code{spam-use-blackholes} is such a back end.
@item
@code{spam-install-statistical-checkonly-backend}
nnfolder archives.
@item Gnus now supports the ``hashcash'' client puzzle anti-spam mechanism.
-Use @code{(setq message-generate-hashcash t)} to enable.
-@xref{Hashcash}.
@item You can now drag and drop attachments to the Message buffer.
See @code{mml-dnd-protocol-alist} and @code{mml-dnd-attach-options}.
(const :tag "Never" nil)
(const :tag "Always" t)))
-(defcustom message-generate-hashcash (if (executable-find "hashcash") 'opportunistic)
+(defcustom message-generate-hashcash nil
"Whether to generate X-Hashcash: headers.
If t, always generate hashcash headers. If `opportunistic',
only generate hashcash headers if it can be done without the user
:type '(choice (const :tag "Always" t)
(const :tag "Never" nil)
(const :tag "Opportunistic" opportunistic)))
+(make-obsolete-variable 'message-generate-hashcash "it does nothing." "31.1")
;;; Internal variables.
(erase-buffer)))
(kill-buffer tembuf))))
-(declare-function hashcash-wait-async "hashcash" (&optional buffer))
-
(defun message--check-continuation-headers ()
(message-check 'continuation-headers
(goto-char (point-min))
message-posting-charset))
(headers message-required-mail-headers)
options)
- (when (and message-generate-hashcash
- (not (eq message-generate-hashcash 'opportunistic)))
- (message "Generating hashcash...")
- (require 'hashcash)
- ;; Wait for calculations already started to finish...
- (hashcash-wait-async)
- ;; ...and do calculations not already done. mail-add-payment
- ;; will leave existing X-Hashcash headers alone.
- (mail-add-payment)
- (message "Generating hashcash...done"))
(save-restriction
(message-narrow-to-headers)
;; Generate the Mail-Followup-To header if the header is not there...
(message-narrow-to-headers)
(run-hooks 'message-header-setup-hook))
(setq buffer-undo-list nil)
- (when message-generate-hashcash
- ;; Generate hashcash headers for recipients already known
- (mail-add-payment-async))
;; Gnus posting styles are applied via buffer-local `message-setup-hook'
;; values.
(run-hooks 'message-setup-hook)
(let ((inhibit-read-only t))
(erase-buffer)))
(let ((message-this-is-mail t)
- message-generate-hashcash
message-setup-hook)
(message-setup `((To . ,address))))
;; Insert our usual headers.
(sendmail-coding-system 'raw-text)
(select-safe-coding-system-function nil)
message-required-mail-headers
- message-generate-hashcash
rfc2047-encode-encoded-words
;; If `message-sendmail-envelope-from' is `header' then
;; the envelope-from will be the original sender's
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Maintainer: Ted Zlatanov <tzz@lifelogs.com>
-;; Keywords: network, spam, mail, bogofilter, BBDB, dspam, dig, whitelist, blacklist, gmane, hashcash, spamassassin, bsfilter, ifile, stat, crm114, spamoracle
+;; Keywords: network, spam, mail, bogofilter, BBDB, dspam, dig, whitelist, blacklist, gmane, spamassassin, bsfilter, ifile, stat, crm114, spamoracle
;; This file is part of GNU Emacs.
(require 'dig)
(eval-when-compile
- (require 'cl-lib)
- (require 'hashcash))
+ (require 'cl-lib))
;; autoload spam-report
(autoload 'spam-report-gmane "spam-report")
"Whether hashcash payments should be detected by `spam-split'."
:type 'boolean
:group 'spam)
+(make-obsolete-variable 'spam-use-hashcash "it does nothing." "31.1")
(defcustom spam-use-regex-headers nil
"Whether a header regular expression match should be used by `spam-split'.
spam-use-whitelist
spam-use-whitelist-exclusive
spam-use-blackholes
- spam-use-hashcash
spam-use-regex-headers
spam-use-regex-body
spam-use-bogofilter
(spam-install-checkonly-backend 'spam-use-blackholes
#'spam-check-blackholes)
-(spam-install-checkonly-backend 'spam-use-hashcash
- #'spam-check-hashcash)
-
(spam-install-checkonly-backend 'spam-use-spamassassin-headers
#'spam-check-spamassassin-headers)
;;{{{ Hashcash.
+(declare-function mail-check-payment "hashcash")
(defun spam-check-hashcash ()
"Check the headers for hashcash payments."
+ (declare (obsolete nil "31.1"))
+ (require 'hashcash)
(ignore-errors (mail-check-payment))) ;mail-check-payment returns a boolean
;;}}}