Mail forwarded even if it was marked as spam

Discussion in 'General' started by Eddie Svensson, Oct 2, 2019.

  1. Eddie Svensson

    Eddie Svensson New Member

    Hello!
    So i've been trying to understand why emails still getting forwarded when they have been flagged as spam.
    The .sieve file have the line "stop;" which someone here propsed would stop it from forwarding/redirect an incoming email.
    -------------------------
    Below does not work
    It still "redirects" even if marked as spam
    -------------------------

    if header :contains "X-Spam-Flag" "YES" {
    fileinto "Junk";
    stop;
    }
    redirect "somemail@somedomain";
    keep;
    -------------------------
    This works, obviously
    -------------------------
    if header :contains "X-Spam-Flag" "YES" {
    fileinto "Junk";
    stop;
    } else {
    redirect "somemail@somedomain";
    }
    keep;
    However this means i have to manually edit the .sieve files and when updating through the web interface it overwrites these settings.
    What am i doing wrong. Do i have to manually do this or is there something else we could do here?
    Best regards!

     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    That looks right from memory. When you say, "flagged as spam," what do you mean? Specifically, does the message have a X-Spam-Flag header?
     
  3. Eddie Svensson

    Eddie Svensson New Member

    Oh yes, I deleted those lines. I've included all below

    require ["fileinto", "regex", "date", "relational", "vacation"];

    # Move spam to spam folder
    if header :contains "X-Spam-Flag" "YES" {
    fileinto "Junk";
    # Stop here so that we do not reply on spams
    stop;​
    } else {
    # Send a copy of email to
    redirect "someone@someone";​
    }

    keep;

    If it is supposed to work without the "else case" then maybe i'm doing something wrong elsewehere.​
     

Share This Page