I've also experimented with the following actions:
Code:
addheader "X-JN-Breadcrumb" "Inserted at start of headers by my sieve code";
addheader :last "X-JN-Breadcrumb" "Appended at end of headers by sieve test 23";
Clearly one should only insert X- headers! Headers added like this either get appended at the foot of the block of headers in an email, or placed right at the start. There are notes on how not to use addheader in the RFC, see:
https://tools.ietf.org/html/rfc5293
Judicious use of this Sieve command allows one to see which parts of one's code have been executed.