Description

This article provides information on how to enable the custom tag in the mail header, when e-mail is detected as spam.

Symptoms

When tag-header is correctly configured, the tag will be displayed in the mail header:

Received: from test.com ([1.1.1.1]) by test2.com with Microsoft SMTPSVC(6.0.3790.4675);
Tue, 14 Sep 2013 10:19:35 -0700
MySpamHeader: is_spam > Inserted tag
From: "user1" <[email protected]>
To: "user2" <[email protected]>
Subject: Test AS tag-header
Tue, 14 Sep 2013 10:19:40 -0700  
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0021_01CB53F6.7B365690"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Return-Path: [email protected]
Message-ID: <[email protected]>
However, if only tag-header is configured:
root@SRX-UTM> show configuration security utm
feature-profile {
    anti-spam {
        address-blacklist black_list;
        sbl {
            profile as-profile {
                spam-action tag-header ; < tag-header is configured
            }
        }
    }
}
utm-policy custom-utm-policy {
    anti-spam {
        smtp-profile junos-as-defaults;
    }
}
root@SRX-UTM>
The result is as follows:
Received: from test.com ([1.1.1.1]) by test2.com with Microsoft SMTPSVC(6.0.3790.4675);
Tue, 14 Sep 2013 10:19:35 -0700   <=== No tag inserted
From: "user1" <[email protected]>
To: "user2" <[email protected]>
Subject: Test AS tag-header
Tue, 14 Sep 2013 10:19:40 -0700  
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0021_01CB53F6.7B365690"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Return-Path: [email protected]
Message-ID: <[email protected]>
No tag is added in the mail header. What is the correct configuration to use tag-header ? Is this an issue?

Solution

This is not a bug. the default string of tag-header" / "tag-subject is  ***SPAM*** . The feature inserts the tag in the mail header. However, the default string is not a vaild header format. The header tag string must have a colon ( : ); for example, MySpamHeader : is_spam .

Otherwise the whole mail will be invalid and cause issues. So, for the tag-header option, if the custom string does not a colon in it, it will just be ignored.

The following message is noticed in utm traceoption :

Jan 11 00:44:15 00:44:15.798109:CID-0:RT: custom header tag is invalid

This is only for the tag-header and not for tag-subject .

For the tag-header spam action, the custom string should be specified in the " <tag name> : <custome message> " format, as illustrated below, before the default or custom message:

root@SRX-UTM> show configuration security utm
feature-profile {
    anti-spam {
        address-blacklist black_list;
        sbl {
            profile as-profile {
                spam-action tag-header;
                custom-tag-string "MySpamHeader : is_spam";   < custom-tag-string contains ":"
            }
        }
    }
}
utm-policy custom-utm-policy {
    anti-spam {
        smtp-profile junos-as-defaults;
    }
}
root@SRX-UTM>

The user can customize * <tag name> and define the * <custom message> .

Related Information