Node:Actions, Previous:Tests, Up:Input Language
The GNU libsieve supports the following default actions:
Among them the first three actions do not need to be explicitly required
by a require
statement, while the others do.
These actions are described in detail below.
stop | Action |
The |
keep | Action |
The effect of this action is to preserve the current message in the mailbox. This action is executed if no other action has been executed. |
discard | Action |
Example:
if header :contains ["from"] ["idiot@example.edu"] { discard; } |
fileinto folder | Action |
Required arguments:
The |
reject reason | Action |
The optional Example: If the message contained
Date: Tue, 1 Apr 1997 09:06:31 -0800 (PST) From: coyote@desert.example.org To: roadrunner@acme.example.com Subject: I have a present for you I've got some great birdseed over here at my place. Want to buy it?
and the user's script contained:
if header :contains "from" "coyote@desert.example.org" { reject "I am not taking mail from you, and I don't want your birdseed, either!"; } then the original sender <coyote@desert.example.org> would receive the
following notification:
To: <coyote@desert.example.org> X-Authentication-Warning: roadrunner set sender using -f flag Content-Type: multipart/mixed; boundary=----- =_aaaaaaaaaa0 MIME-Version: 1.0 ----- =_aaaaaaaaaa0 The original message was received at Tue, 1 Apr 1997 09:07:15 -0800 from coyote@desert.example.org. Message was refused by recipient's mail filtering program. Reason given was as follows: I am not taking mail from you, and I don't want your birdseed, either! ----- =_aaaaaaaaaa0 Content-Type: message/delivery-status Reporting-UA: sieve; GNU Mailutils 0.1.3 Arrival-Date: Tue, 1 Apr 1997 09:07:15 -0800 Final-Recipient: RFC822; roadrunner@acme.example.com Action: deleted Disposition: automatic-action/MDN-sent-automatically;deleted Last-Attempt-Date: Tue, 1 Apr 1997 09:07:15 -0800 ----- =_aaaaaaaaaa0 Content-Type: message/rfc822 From: coyote@desert.example.org To: roadrunner@acme.example.com Subject: I have a present for you I've got some great birdseed over here at my place. Want to buy it? ----- =_aaaaaaaaaa0 If the reason argument is rather long, the common approach is
to use the combination of the if header :mime :matches "Content-Type" [ "*application/msword;*", "*audio/x-midi*" ] { reject text: #include "nomsword.txt" . ; } |
redirect address | Action |
The The |