Ken Murchison wrote:
Alexey,
A couple nits/comments/questions on your latest draft:
Where's the page breaks and page headers? :^)
I've decided to add them at the later stage.
#
# Example Sieve Filter
# Declare any optional features or extension used by the script
#
require ["fileinto", "reject", "imapflags"];
Any reason why "reject" is required and mentioned below, but never used?
#
# Reject any large messages
#
if size :over 1M
{
if header :is "From" "boss(_at_)company(_dot_)com"
{
addflag "\\Flagged $Big";
This should be: addflag ["\\Flagged", "$Big"];
Right.
# The message will be marked as "\Flagged $Big" when filed into mailbox
"Big messages"
}
fileinto "Big messages";
}
if header :is "From" "grandma(_at_)example(_dot_)net"
{
addflag ["\\Answered", "$MDNSent"];
# If the message is bigger than 1Mb it will be marked as "\Flagged $Big
\Answered $MDNSent"
Unless I'm completely off the mark (and my cmu-sieve implementation is
incorrect), "\Flagged $Big" will never be set on these messages, because
these flags are only set 'if header :is "From" "boss(_at_)company(_dot_)com"'.
Correct. Message will be filed into "Big messages" in all cases and only if
"from" is
"boss(_at_)company(_dot_)com" two flags will be set.
I think you want the first test in the script to be something like:
if size :over 1M
{
addflag "\\Flagged $Big";
if header :is "From" "boss(_at_)company(_dot_)com"
{
# The message will be marked as "\Flagged $Big" when filed into
mailbox "Big messages"
fileinto "Big messages";
}
}
Alexey