/* Example: "editheader" This example demonstrates manipulation of some headers in the mail message. */ sieve { /* Open the sieve block */ /* Enable some of the extended capabilities used in this script. */ require "fileinto"; require "envelope"; require "editheader"; /* If mail is to the abuse address, give it an alert header that we have enabled in our mail reader client. */ if envelope :localpart "is" "abuse" { addheader "X-Alert" "Abuse"; /* Continue processing */ } /* For some reason my mail program is confused by X-Confuse-Me headers, so we'll rename any that appear. */ replaceheader :newname "X-Do-Not-Confuse-Me" "X-Confuse-Me"; /* If I get mail from a "potato-eaters" mailing list, I want to set a Reply-To so that my replies will go back to the entire list. Yes this will probably get me in a lot of trouble, and it's a completely nonstandard thing that assumes I don't pay much attention when I am using my mail program, but I'm going to do it anyway. */ if header :contains "Sender" "potato-eaters" { /* Delete any existing "Reply-To" */ deleteheader "reply-to"; /* Add my new one */ addheader "reply-to" ""; /* Put it in my mailbox */ keep; } /* Let "implicit keep" deal with mail not otherwise filtered. */ }