rspamd/rspamd.com

Flags `milter` example with curl to remove headers

Opened this issue · 0 comments

how to use milter to remove headers from /checkv2 response and calculated score

Request:

curl "http://localhost:11333/checkv2" -H "Subject: Test Subject" -d 'Some spam content'

Response:

{
    "is_skipped": false,
    "score": 10.4,
    "required_score": 15,
    "action": "add header",
    "thresholds": {
        "reject": 15,
        "add header": 6,
        "greylist": 4
    },
    "symbols": {
        "ARC_NA": {
            "name": "ARC_NA",
            "score": 0,
            "metric_score": 0,
            "description": "ARC signature absent"
        },
        "MISSING_FROM": {
            "name": "MISSING_FROM",
            "score": 2,
            "metric_score": 2,
            "description": "Missing From: header"
        },
        "MISSING_TO": {
            "name": "MISSING_TO",
            "score": 2,
            "metric_score": 2,
            "description": "To header is missing"
        },
        "MISSING_SUBJECT": {
            "name": "MISSING_SUBJECT",
            "score": 0.5,
            "metric_score": 2,
            "description": "Subject header is missing"
        },
        "MISSING_DATE": {
            "name": "MISSING_DATE",
            "score": 1,
            "metric_score": 1,
            "description": "Message date is missing"
        },
        "MIME_GOOD": {
            "name": "MIME_GOOD",
            "score": -0.1,
            "metric_score": -0.1,
            "description": "Known content-type",
            "options": [
                "text/plain"
            ]
        },
        "DMARC_NA": {
            "name": "DMARC_NA",
            "score": 0,
            "metric_score": 0,
            "description": "No DMARC record",
            "options": [
                "No From header"
            ]
        },
        "R_DKIM_NA": {
            "name": "R_DKIM_NA",
            "score": 0,
            "metric_score": 0,
            "description": "Missing DKIM signature"
        },
        "MIME_TRACE": {
            "name": "MIME_TRACE",
            "score": 0,
            "metric_score": 0,
            "options": [
                "0:+"
            ]
        },
        "HFILTER_HOSTNAME_UNKNOWN": {
            "name": "HFILTER_HOSTNAME_UNKNOWN",
            "score": 2.5,
            "metric_score": 2.5,
            "description": "Unknown client hostname (PTR or FCrDNS verification failed)"
        },
        "RCVD_COUNT_ZERO": {
            "name": "RCVD_COUNT_ZERO",
            "score": 0,
            "metric_score": 0,
            "description": "Message has no Received headers",
            "options": [
                "0"
            ]
        },
        "MISSING_MID": {
            "name": "MISSING_MID",
            "score": 2.5,
            "metric_score": 2.5,
            "description": "Message id is missing"
        }
    },
    "messages": {},
    "message-id": "undef",
    "time_real": 0.01236,
    "milter": {
        "remove_headers": {
            "X-Spam": 0
        }
    }
}

rspamd version: 3.5