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"] ["[email protected]"] { 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: [email protected] To: [email protected] 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" "[email protected]" { reject "I am not taking mail from you, and I don't want your birdseed, either!"; } then the original sender <[email protected]> would receive the
following notification:
To: <[email protected]> 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 [email protected]. 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; [email protected] 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: [email protected] To: [email protected] 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 |