Problem
I am setting the SCL value via Exchange-based rules. The rules are applied correctly when desired conditions are matched and the SCL value is properly set, as evidenced in message headers. Also, the SCL value set (6) matches Junk SCL threshold (default value, 5).
However, the Exchange server does not put message into Junk folder.
I'm looking either for tip on what may be wrong, what might be disrupting the proper workflow, anything. Or any tips on additional diagnostic steps to be performed.
Scenario
I'm currently staging a migration to Exchange 2016 in a following scenario (example values):
- DNS MX record directs sender to old server,
- old server performs spam analysis via SpamAssassin and adds corresponding headers to message, including
X-Spam-Score
, - messages to recipients that are not known to old servers (ie. migrated mailboxes) are forwarded to Exchange,
- Exchange applies a rule on
X-Spam-Score
header value, matching pattern[+]{4}
(four or more+
characters, which are equivalent to4.0+
score), setting SCL level to6
.
The exact configuration for rule (based on Get-TransportRule
display):
HeaderMatchesMessageHeader : X-Spam-Score
HeaderMatchesPatterns : {[+]{4}}
SetSCL : 6
I know that this works so far, as the recieved messages with X-Spam-Score
matching the pattern DO get the X-MS-Exchange-Organization-SCL: 6
header.
Yet the message ends up in Inbox instead being forwarded to Junk folder :(
Sample resultant set of headers in the delivered message:
X-Spam-Score: 8.0 (++++++++)
X-MS-Exchange-Organization-SCL: 6
X-MS-Exchange-Organization-AuthSource: mbx-a.example.com
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Transport-EndToEndLatency: 00:00:01.0250276
X-MS-Exchange-Processed-By-BccFoldering: 15.01.1531.003
Additional info
The above configuration is basically an analogue of standard Exchange Online Protection configuration, in which the EOP server could be seen as an equivalent of old server with SpamAssassin. In this regard, EOP documentation suggest a very similar configuration, differing only on the source headers used to determine message status. The further deployment schedule assumes deploying EOP before old server, and afterwards removing old server with it's spam protection role.
The server configuration regarding the junk/delete/reject SCL thresholds is pretty much default so far, in detail:
Get-OrganizationConfig:
SCLJunkThreshold : 4
Get-ContentFilterConfig:
SCLRejectThreshold : 7
SCLRejectEnabled : True
SCLDeleteThreshold : 9
SCLDeleteEnabled : False
SCLQuarantineThreshold : 9
SCLQuarantineEnabled : False
The Exchange setup does not include Edge Transport servers, and AntiSpam Agents are not installed/enabled on Mailbox servers, but Microsoft documentation does not mention anywhere such requirement, eg:
- https://docs.microsoft.com/.../ensure-that-spam-is-routed-to-each-user-s-junk-email-folder
- https://docs.microsoft.com/en-us/exchange/edge-transport-servers
Update 1
I've installed Antispam Agents on all nodes and performed following tests:
- sending a fabricated mail to trigger SenderID fail;
- sending a fabricated mail to trigger high SCL result without triggering upfront rejection.
Both tests did result in SCL6 message being delivered, but again, to Inbox instead of Junk folder.
This proves that the issue is not relevant to Transport Rules. Regardless of which mechanism raises/sets SCL level, message ends up in Inbox.