sieve to check if from and reply-to are the same

i'm currently trying to set up a sieve rule to check if From and Reply-to headers are the same. If not reject the email. But i can't seem to get it working. I'm thinking of something like that:

if header "from" != "reply-to" {
  discard;
}

i have found operators and variables can be used, but there is no good documentation on that, at least for me. could anybody help me please? thanks in advance


Solution 1:

i finally solved it this way:

require ["fileinto", "relational", "variables", "editheader"];

if true {
    if allof(header :matches "from" "*", not header :is "reply-to" "${1}")
    {
        if header :matches "Subject" "*"
        {
            deleteheader "Subject";
            addheader :last "Subject" "[PHISHING] ${1}";
        }
    }
}