RblFilterGetRblStatusesOfMailOriginatingIPAddress Method
Gets the statuses of the IP address the given e-mail originated from, in the specified DNS RBL databases.

Namespace: MailBee.AntiSpam
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public RblStatusCollection GetRblStatusesOfMailOriginatingIPAddress(
	MailMessage msg,
	int receivedIndex,
	string[] rblHosts
)

Parameters

msg
Type: MailBee.MimeMailMessage
A mail message with at least one Received header which contains the IP address the message came from.
receivedIndex
Type: SystemInt32
The zero-based index of Received header to examine. Usually, zero (denotes the most recent header).
rblHosts
Type: SystemString
The RBLs' host names.

Return Value

Type: RblStatusCollection
The collection of statuses of the e-mail originating IPv4 address in the specified RBLs, or a null reference (Nothing in Visual Basic) if no matching IPv4 address was found in the specified Received header.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionmsg is a null reference (Nothing in Visual Basic), or rblHosts is a null reference or contains at least one value which is a null reference or an empty string, or receivedIndex is negative or does not denote a valid index in msg's TimeStamps collection.
MailBeeExceptionAnother error occurred (e.g. timeout from DNS server) for all RBLs in the list.
Remarks

This method extracts the originating IPv4 address from Received header and then uses GetRblStatusesOfIPAddress(String, String) method to get the statuses of this IP address in the specified RBLs.

Usually, the most recent Received header must be examined (receivedIndex must be zero). However, in case if mail flow in your network is more complex (e.g. all mail is forwarded through some gateway), you may need to analyze not the most recent Received but next to it. In this case, receivedIndex must be 1.

The header may look like Received: from [19.43.20.143] (helo=zebra.domain.com) by mx.afterlogic.com with esmtp (Exim 4.85) id 1ctx6r-119Hei-S8 for support@afterlogic.com; Fri, 31 Mar 2017 07:01:03 -0700.

In the above, 19.43.20.143 denotes the originating IP address.

This method supports multi-threading to check multiple RBLs at once. To enable multi-threading, set MaxThreadCount to -1.

For each RBL, its own status is set. Unlike Boolean-returning methods like IsMailOriginatingIPAddressInRbl(MailMessage, Int32, String), this method provides more extensive info for an IP address. In particular, RblReplyText property of each RblStatus object in the resulting collection may contain the exact reason of the IP addresses being blacklisted. You need to refer to the documentation of the corresponding RBL to find out how to treat the return codes.

For instance, return codes of the popular Spamhaus Zen RBL can be found at https://www.spamhaus.org/zen/.

Note Note
This method won't throw an exception if only certain RBLs in the list failed to be checked. If at least one DNS query succeeded, the method will return normally. For RBLs which failed, IsError will be true. To monitor errors during this method's execution, subscribe to ErrorOccurred event.
Examples
See multi-threaded sample in RblFilter topic, single-threaded sample - in RblFilter topic.
See Also