GNU Mailutils Manual (split by node):   Section:   Chapter:FastBack: Sieve Language   Up: Extensions   FastForward: Reporting Bugs   Contents: Table of ContentsIndex: Function Index

5.8.6 The editheader extension

The editheader extension complies with RFC 5293. It provides the following actions:

Action: addheader [:last] field-name(string) value(string

Adds a header field to the existing message header. By default the header is inserted at the beginning of the header list. If the tag :last is specified, it is appended at the end.

Action: deleteheader" [:index fieldno(number) :last] [comparator] [match-type] field-name(string) [value-patterns(string-list)]

Deletes occurrences of the header field matching the criteria.

The value-patterns, if specified, determines which occurrences of the header fielde to delete. If not supplied, comparator and match-type are silently ignored.

If ‘:index fieldno’ is specified, only the numbered occurrence of the named header field will be matched (header numbering begins at 1), If :last is specified, the count is backwards; 1 denotes the last named header field, 2 the second to last, and so on. The counting happens before the value-patterns match, if any. Thus, e.g. the action

deleteheader :index 1 :contains "Delivered-To" "";

would delete the first ‘Delivered-To’ header field if it contains the string ‘’.