[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.2.1 Configuring wl-expire-alist

An example configuration of wl-expire-alist is shown below. Everything in this wl-expire-alist makes a great difference in expiration, so be careful. I advise you to set wl-expire-use-log to t, especially in the initial stage.

 
(setq wl-expire-alist
      '(("^\\+trash$"   (date 14) remove)
                                  ;; delete
        ("^\\+tmp$"     (date 7) trash)
                                  ;; re-file to wl-trash-folder
        ("^\\+outbox$"  (number 300) "$outbox;lha")
                                  ;; re-file to the specific folder
        ("^\\+ml/tmp$"  nil)
                           ;; do not expire
        ("^\\+ml/wl$"   (number 500 510) wl-expire-archive-number1 t)
                           ;; archive by message number (retaining numbers)
        ("^\\+ml/.*"    (number 300 310) wl-expire-archive-number2 t)
                           ;; archive by a fixed number (retaining numbers)
        ("^\\+diary$"   (date 30) wl-expire-archive-date)
                           ;; archive by year and month (numbers discarded)
        ))

Items in the list has the format of:

 
(regexp-for-folders specification-of-messages-to-be-deleted destination)

The folder is examined if it matches regexp-for-folders from the beginning of the list. If you invoke expiration on the folder that does not match any of them, nothing will happen. And if either the second or the third element of the item is nil, expiration will not take place.

You can use any one of the following for specification-of-message-to-be-deleted:

(number n1 [n2])
deletes messages depending on the number of messages in the folder.

n1 is the number of messages which should survive deletion, for example if its value is 500, the newest 500 messages survive and the rests are deleted.

n2 is the number of messages in the folder on which expiration should take place, which defaults to n1 + 1. For example if its value is 510, folders with 510 or more messages are expired. If you configured automatic expiration, frequently used folders may expire every time it receive messages, and you may be annoyed with the long delay in reading mail. In that case, you can set a wide margin between n2 and n1, so that expiration would not take place until a certain number of messages accumulate.

Messages with marks in wl-summary-expire-reserve-marks (marked with important/new/unread) are not deleted. If wl-expire-number-with-reserve-marks is non-nil, the folder will expire so as to have 500 messages including such ones. Otherwise, it will have 500 messages except such ones.

(date d1)
deletes messages depending on the dates.

Messages dated d1 or more days ago are deleted, for example if its value is seven, messages seven days old or more are deleted. Note that the date is the one in the `Date:' field of the message, not when the message entered the folder.

Messages with no or invalid `Date:' field does not expire; you might have to delete them by hand.

You can use any one of the following in the place of destination:

remove
deletes the messages instantly.

hide
hide the messages from summary (messages are not deleted).

trash
moves the messages to wl-trash-folder.

string(folder)
moves the messages to the folder specified with string.

It would be useful for specifying an archiving folder, but because this does not move important messages, it might be better to use the standard functions described below.

function
invokes the specified function.

To the function, three arguments are passed: a folder name, a list of messages to be deleted, and msgdb information of the summary. You can specify function-specific arguments after the name of the function. Note that the list contains messages with marks in wl-summary-expire-reserve-marks, be careful in writing your own function.

These are four standard functions; three of them move messages to an archive folder in the specified way. This means old messages can be compressed and saved in a file, being deleted from the original folder. The last one divides messages to some MH folders.

wl-expire-archive-number1
re-files to archiving folders corresponding to the message numbers of the messages being deleted. For example, a message numbered 102 will be re-filed to `wl-00100.zip', 390 to `wl-00300.zip', and so on. If wl-expire-archive-files is 200, messages will be re-filed to `wl-00000.zip', `wl-00200.zip', `wl-00400.zip', ....

The archiving folders to which messages are re-filed are determined by the name of the folder as follows (in this case, archiving folders are handled as if elmo-archive-treat-file were non-nil).

If the folder type is localdir:
`ArchiveDir/foldername-xxxxx.zip'

For example, `+ml/wl' corresponds to `$ml/wl;zip' (`~/Mail/ml/wl-00100.zip').

The folder type is other than localdir:
`ArchiveDir/foldertype/foldername-xxxxx.zip'

For example, `%#mh/ml/wl' corresponds to `$imap4/#mh/ml/wl;zip' (`~/Mail/imap4/#mh/ml/wl-00100.zip').

As you can see, in the case of localdir, the folder type is not included in the path name, but otherwise it is included. And you can control the prefix to the archiving folder name by wl-expire-archive-folder-prefix. Refer to wl-expire-archive-folder-prefix for details.

wl-expire-archive-number2
re-files every certain number of messages to archiving folders.

This differs from `wl-expire-archive-number1' in that this re-files to the folder up to the specified number regardless of message numbers. The archiving folders to which messages are re-filed are determined in the same way as wl-expire-archive-number1.

wl-expire-archive-date
re-files messages depending on its date (year and month) to archive folders.

For example, a message dated December 1998 is re-filed to $folder-199812;zip. The name of the archiving folders except the date part are determined in the same way as wl-expire-archive-number1.

You can set the first argument to these three standard functions to non-nil in wl-expire-alist so as to retain message numbers in the folder. For example, it can be specified just after the name of the function:

 
("^\\+ml/wl$" (number 300 310) wl-expire-archive-number1 t)

If you omit the argument, consecutive numbers from 1 are assigned for each archiving folder.

wl-expire-localdir-date
divedes messages depending on its date (year and month) to MH folders e.g. to `+ml/wl/1999_11/', `+ml/wl/1999_12/'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Yuuichi Teranishi on February, 19 2005 using texi2html