Skip to content

How to set hash type for single dnsbl (querying more than one dnsbl that use different hash type) #5

Description

@Edobeta

Hi,
this plugin works great in Spamassassin.
Just a question about how to set different hash type for different dnsbl.

For example this is in my current local.cf (apart for non-existent dnsbl addresses invented for this example), where both the dnsbl using sha1, this works great for me.

ifplugin Mail::SpamAssassin::Plugin::AttachHash

attach_hash_type sha1

# first dnsbl
attachhashdnsbl   EXMPLE1_ATTACHHASH     ex1.justfor.exmple.
body              EXMPLE1_ATTACHHASH     eval:check_attachhash('EXMPLE1_ATTACHHASH')
describe          EXMPLE1_ATTACHHASH     attached file hash classified as malware by exmaple1 dnsbl
priority          EXMPLE1_ATTACHHASH     -100 # required priority to launch async lookups early
tflags            EXMPLE1_ATTACHHASH     net
score             EXMPLE1_ATTACHHASH     2.5
# second dnsbl
attachhashdnsbl   EXMPLE2_ATTACHHASH     ex2.justfor.anotherexmple.
body              EXMPLE2_ATTACHHASH     eval:check_attachhash('EXMPLE2_ATTACHHASH')
describe          EXMPLE2_ATTACHHASH     attached file hash classified as malware by exmaple2 dnsbl
priority          EXMPLE2_ATTACHHASH     -100 # required priority to launch async lookups early
tflags            EXMPLE2_ATTACHHASH     net
score             EXMPLE2_ATTACHHASH     1.5 

endif

But what if the first or second dnsbl require md5?
How to specify per-dnsbl hash algorithm?
A way like this (but doesn't work currently):

attach_hash_type      EXMPLE1_ATTACHHASH     sha1 
.
.
.
attach_hash_type      EXMPLE2_ATTACHHASH     md5 

Best regards
Luca

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions