Skip to main content
chels
New Member
Jul 11, 2018 7:15 AM UTC
Question

Header From field check

Hello,

 

Since some time, I have more spam where From SMTP address is different from Header From address.

In MS Outlook Header From is displayed; this address is used to steal identity.

 

Can I configure Fortimail in order to also check Header From address?

 

Thank you

 

(Fortimail 5.4.x)

10 replies

Dirty_Wizard_FTNT
Staff
Staff
Jul 18, 2018 8:06 PM UTC

Check header From against what?

You can set FortiMail to check the header From email domain against SPF:

config antispam settings

set spf-checking strict-anti-spoofing end

 

Page 44: https://docs.fortinet.com/uploaded/files/4495/fortimail-cli-reference-546.pdf

 

Is the header From email spoofed as your own domain?

Translate
Carl_Windsor_FTNT
Staff
Staff
Jul 19, 2018 9:20 PM UTC

If the spam is spoofing the protected domain, you can use the 6.0 Impersonation detection feature.   

 

In the next major release we will be separating the header alignment check from the spf-checking strict-anti-spoofing setting to allow more flexibility in configuration - although blocking all lack of alignment will generate false positives so it is recommended to tag the subject/top of email rather than block.

Translate
Hosemacht
Explorer
Jul 20, 2018 8:05 AM UTC

you can use the dictonary filter to set a regular expression for the header:

 

[EHeAdEr]^from:.*\b\@example.com\b

 

Change "@example.com" to your Domain name 

set "Search Header" enabled and add it to your antispam profile.

Translate
Hosemacht
Explorer
Jan 14, 2020 4:43 PM UTC

i would highly recommend not to use whitelistening based on a Header From Field.

Every email matches this header will get through without an AS check.

 

Furthermore i guess its not possible at the moment with a FortiMail.

 

Regards

Translate
live89
Explorer III
May 17, 2020 8:36 AM UTC

I think this is what you're lookiing for

 

https://kb.fortinet.com/k....do?externalID=FD45736

Translate
Novox
New Member
Feb 12, 2021 5:13 PM UTC

Hi, I'm trying to use:

 

[EHeAdEr]^From:.*\b\@domain.com\b

 

However, shouldn't the period before .com be preceded with \ so that \. matches literally "."  Otherwise it's matching any char (which is also fine, since "." will match "period").

 

My confusion is in the "[EHeAdEr]" part...

 

As far as I understand RegEx's, this means choose ONE of the following literal characters E, H, e, A, d, E, r.  And I don't know why this would be necessary because ^ means "beginning of line or string"

 

Also, should there be a /i at the end for "case-insensitive"?

 

Previously, I had:

/^from:.*\bdomain\.com\b/i

 

which was causing issues?!   (matching things it should never match).

 

Thank you!

Translate
Jeff_Roback
New Member
Mar 4, 2021 10:28 PM UTC

I don't know why support keeps giving out this Regex string.    As pointed out above, it has two problems:

1) The . in domain.com is evaluated as matching any character since it's not escaped.

2) The [EHeAdEr] isn't helping since a match of any of those characters will work.

 

This string seems to have originated from this post: https://forum.fortinet.com/tm.aspx?m=190591&high=fortimail+spf  but I'm not entirely if it was a typo from the author or a misunderstanding,

 

In any event, it's a bit troubling that support keeps giving this out. 

 

Here's what we've been testing with:

 

^From:.*<.*\@mydomain\.com>$

 

Here's a really handy site that lets you put in a regex string and test it against text. It will also break down the command for you.

 

https://regexr.com/

 

 

 

 

Translate
Stai
New Member
Apr 2, 2024 2:49 PM UTC

I'm having the exact same problem and even after explaining to support multiple times they are just not able to help out.

From: someones@domain.com

Header From: myprotected@domain.com

 

Sender alignment check will just result in a ton of false positives.

 

I'd go for the RegEx/dictionary check but I don't know what this is supposed to mean:

"set "Search Header" enabled and add it to your antispam profile."

Do I need to create this regex with my domain and if it matches the mail will get blocked? Where exactly do I have to set this up?

Translate
Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024