Exchange 2010: Add SPAMHaus.org to the IP blocklist provider of the AntiSPAM Agents

In a previous article I have described how the Spam Filter Agents are installed on an internal Hub Transport Server. If you want to filter spam using a blacklist such as SpamHouse.org can configure this blacklist as an IP blacklist provider.

The procedure is the same on an edge transport and on a hub transport server:

Via Exchange Management Console

First switch to "Organization Configuration" and "Hub Transport" in the Exchange Management Console. If the filter agents are installed correctly, the "Antispam" tab should appear there.

IP blacklist provider

Double-click on "IP blacklist provider" to open the configuration dialog

Under the "Provider" tab, we now click on "Add"

Now we enter "Display name" and "Lookup domain", in this case "SpamHaus.org" as the name and "zen.spamhaus.org" as the lookup domain. Next, we specify that only certain return codes should be assigned and enter the value 127.0.0.1 in the "Match with the following mask" field. Explanation: Spamhaus.org is a so-called DNS blacklist, i.e. a DNS query is made to zen.Spamhaus.org for the delivering mail server. If the mail server in question is on the blacklist, Spamhaus.org responds to the DNS query with 127.0.0.1. This has no effect on the normal DNS resolution but only relates to blacklist queries. For other blacklists, these return codes may need to be adapted; information on this can usually be found on the blacklist operator's website.

If you wish, you can now add a text under the error messages section telling the sender why their mail was rejected. You could kindly enter a text such as "Your IP is blacklisted by Spamhaus.org".

Per Exchange Management Shell:

On the Management Shell, the following command is sufficient to add Spamhaus.org as a blacklist:

Add-IPBlockListProvider -Name "Spamhaus.org" -LookupDomain "zen.spamhaus.org" -BitMaskMatch 127.0.0.1

Note:

Before adding Spamhaus.org as an IP blacklist provider, you should find out whether the free or paid version is an option. You can find the relevant information here:

http://www.spamhaus.org/organization/dnsblusage.html

14 thoughts on “Exchange 2010: SPAMHaus.org zu IP-Sperrlistenanbieter der AntiSPAM Agents hinzufügen”

  1. Hallo,
    Danke für Deinen Artikel, doch wenn ich Spamhouse eintrage,werden alle Mails mit Spam abgewiesen, 550.5.7.1.
    Was mache ich da falsch?

    Reply
    • Hi,

      haben seit heute dasselbe Problem. Mit dem Unterschied, dass wir schon seit Ewigkeiten Spamhaus eingetragen hatten und seit dieser Nacht plötzlich wegen diesem Eintrag keine E-Mails mehr an uns geschickt werden konnte.
      Nachdem wir den Eintrag entfernt hatte lief wieder alles.
      Gefühlt sah es für uns so aus, als würde Spamhaus einfach alles abweisen.

      Ich denke also, dass du da nichts falsch gemacht hast. Wahrscheinlich hat Spamhaus ein Problem.

      Gruß

      Riyan

      Reply
      • Hallo Riyan Danke für die Info. Habe mich jetzt für das 3rd Partyprodukt Spamfighter entschieden. Läuft perfekt bis jetzt

        Reply
  2. Ist zwar noch etwas älter :-), aber über die Shell geht es mit den richtigen Anführungszeichen in Exchange 2010:
    Add-IPBlockListProvider -Name ’Spamhaus.org’ -LookupDomain ’zen.spamhaus.org’ -BitMaskMatch $null -IPAddressesMatch ’127.0.0.2’,’127.0.0.3’,’127.0.0.4’,’127.0.0.5’,’127.0.0.6’,’127.0.0.7’,’127.0.0.10’,’127.0.0.11’ -RejectionResponse ‘NO SPAM!’ -Priority 1

    Habe meinen Spam damit heute etwas eingeschränkt.

    Danke an Ronny!

    Gruß
    Dirk

    Reply
  3. Über die Shell wie von Ronny beschrieben scheint es nicht zu klappen.

    Die Argumenttransformation für den Parameter „IPAddressesMatch“ kann nicht verarbeitet werden. Der Wert „127.0.0.2´,“ k
    ann nicht in den Typ „Microsoft.Exchange.Data.MultiValuedProperty`1[System.Net.IPAddress]“ konvertiert werden. Fehler:
    „Fehler beim Konvertieren von 127.0.0.2´, von System.String in System.Net.IPAddress. Fehler: Fehler beim Konvertieren d
    er Zeichenfolge ‚127.0.0.2´,‘ in den Ergebnistyp System.Net.IPAddress: Es wurde eine ungültige IP-Adresse angegeben.“
    + CategoryInfo : InvalidData: (:) [Add-IPBlockListProvider], ParameterBindin…mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Add-IPBlockListProvider

    Gruß, Tom

    Reply
  4. Ist zwar etwas alt aber, falls es noch jemand beraucht, dass sollte in 2010 gehen:

    Add-IPBlockListProvider -Name ‚Spamhaus.org‘ -LookupDomain ‚zen.spamhaus.org‘ -BitMaskMatch $null -IPAddressesMatch ‚127.0.0.2‘,’127.0.0.3′,’127.0.0.4′,’127.0.0.5′,’127.0.0.6′,’127.0.0.7′,’127.0.0.10′,’127.0.0.11′ -RejectionResponse ‚NO SPAM!‘ -Priority 1

    Reply
  5. Hi,

    danke erst einmal für das Tut!
    Ich habe allerdings Probleme sowohl über die GUI als auch über Powershell die BitMaskMatch einzugeben!
    Es taucht immer die Fehlermeldung auf, dass die Adressen 127.0…. keine gültigen Werte wären?!

    Antwort der Powershell nachdem ich den String von H.Amster verwendet habe:

    Add-IPBlockListProvider : „System.Object[]“ kann nicht in den Typ „System.Net.IPAddress“ konvertiert werden, der für de
    n Parameter „BitmaskMatch“ erforderlich ist. Die angegebene Methode wird nicht unterstützt.
    Bei Zeile:1 Zeichen:92
    + Add-IPBlockListProvider -Name „Spamhaus.org“ -LookupDomain „zen.spamhaus.org“ -BitMaskMatch <<<< "127.0.0.2", "127.0
    .0.3", "127.0.0.4", "127.0.0.5", "127.0.0.6", "127.0.0.7", "127.0.0.10", "127.0.0.11" -rejectionmessage "Your IP is lis
    ted on spamhaus.org for abusive mail interaction with the outer world. Please fix your mailserver first." -Priority 1
    + CategoryInfo : InvalidArgument: (:) [Add-IPBlockListProvider], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Exchange.Management.SystemConfigurationTasks.NewIPBlockL
    istProvider

    Weiß einer Rat? Danke schonmal!

    Reply
  6. Besser:
    Add-IPBlockListProvider -Name “Spamhaus.org” -LookupDomain “zen.spamhaus.org” -BitMaskMatch „127.0.0.2“, „127.0.0.3“, „127.0.0.4“, „127.0.0.5“, „127.0.0.6“, „127.0.0.7“, „127.0.0.10“, „127.0.0.11“ -RejectionMessage „Fuck Off SPAM!“ -Priority 1

    grz A.Hamster

    Reply
  7. Hallo, Ich verstehe das mit den Rückgabe-Code nicht ganz, kann ich die Codes alle unter „jede der folgenden Antworten zuordnen“ eintragen? Irgendwie stehe ich da auf dem Schlauch.

    Reply
    • Hi Sascha,

      Die Rückgabe Codes teilen dir mit ob eine Domain oder ein Host auf der Blacklist steht. Im Prinzip funktioniert das wie ein DNS-Lookup, Exchange fragt bei der Blacklist an ob ein bestimmter Host auf der Liste steht, ist dem so bekommst du eine Antwort mit dem jeweiligem Code und Exchange lehnt den Host ab. Mit den jeweiligen Rückgabe Codes steuerst du also das Verhalten von Exchange wann ein Host zurückgewiesen wird.

      Mfg

      Frank

      Reply
  8. Kannst Du mir sagen warum Du in dem Beispiel die IP 127.0.0.1 genommen hast. Den Return Code gibt es bei Spamhaus garnicht.

    Reply

Leave a Comment