Gmail has a feature to detect email phishing and it marks them with a red header alert saying "Warning" This message may not be from whom......", I believe this red alert has nothing to do with spf record of that email, so how does it detect it as phishing email? We have spf record and I sent an email from another server, when I received that emai the spf record was "softfail" but it does not have that red alert.

Is there a way to add this header to emails which appear to be sent from us but actually not?