Variable: nnmail-fancy-expiry-targets

nnmail-fancy-expiry-targets is a customizable variable defined in nnmail.el.gz.

Value

nil

Documentation

Determine expiry target based on articles using fancy techniques.

This is a list of ("HEADER" "REGEXP" "TARGET") entries. If nnmail-expiry-target is set to the function nnmail-fancy-expiry-target and HEADER of the article matches REGEXP, the message will be expired to a group determined by invoking format-time-string with TARGET used as the format string and the time extracted from the articles' Date header (if missing the current time is used).

In the special cases that HEADER is the symbol to-from, the regexp will try to match against both the From and the To header.

Example:

(setq nnmail-fancy-expiry-targets
      '((to-from "boss" "nnfolder:Work")
("Subject" "IMPORTANT" "nnfolder:IMPORTANT.%Y.%b")
("from" ".*" "nnfolder:Archive-%Y")))

In this case, articles containing the string "boss" in the To or the From header will be expired to the group "nnfolder:Work"; articles containing the string "IMPORTANT" in the Subject header will be expired to the group "nnfolder:IMPORTANT.YYYY.MMM"; and everything else will be expired to "nnfolder:Archive-YYYY".

This variable was added, or its default value changed, in Emacs 22.1.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnmail.el.gz
(defcustom nnmail-fancy-expiry-targets nil
  "Determine expiry target based on articles using fancy techniques.

This is a list of (\"HEADER\" \"REGEXP\" \"TARGET\") entries.  If
`nnmail-expiry-target' is set to the function
`nnmail-fancy-expiry-target' and HEADER of the article matches REGEXP,
the message will be expired to a group determined by invoking
`format-time-string' with TARGET used as the format string and the
time extracted from the articles' Date header (if missing the current
time is used).

In the special cases that HEADER is the symbol `to-from', the regexp
will try to match against both the From and the To header.

Example:

\(setq nnmail-fancy-expiry-targets
      \\='((to-from \"boss\" \"nnfolder:Work\")
	(\"Subject\" \"IMPORTANT\" \"nnfolder:IMPORTANT.%Y.%b\")
	(\"from\" \".*\" \"nnfolder:Archive-%Y\")))

In this case, articles containing the string \"boss\" in the To or the
From header will be expired to the group \"nnfolder:Work\";
articles containing the string \"IMPORTANT\" in the Subject header will
be expired to the group \"nnfolder:IMPORTANT.YYYY.MMM\"; and
everything else will be expired to \"nnfolder:Archive-YYYY\"."
  :version "22.1"
  :group 'nnmail-expire
  :type '(repeat (list (choice :tag "Match against"
			       (string :tag "Header")
			       (const to-from))
		       regexp
		       (string :tag "Target group format string"))))