|
|
|
|
|
|
|
|
sockaddr_in *SaIn = (sockaddr_in *) HostAddr; // Fetch the IP address.
|
|
|
sockaddr_in *SaIn = (sockaddr_in *) HostAddr; // Fetch the IP address.
|
|
|
|
|
|
|
|
|
Context->ConnectionData.HostName = HostName; // Load the info.
|
|
|
Context->ConnectionData.HostName = HostName; // Load the info.
|
|
|
Context->ConnectionData.HostIP = ntohl(SaIn->sin_addr.s_addr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (0 == SaIn) { // If HostAddr is 0...
|
|
|
|
|
|
|
|
|
|
|
|
Context->ConnectionData.HostIP = "127.0.0.1"; // Set to a valid value.
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
Context->ConnectionData.HostIP = ntohl(SaIn->sin_addr.s_addr);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
if (MilterDebugMode) {
|
|
|
if (MilterDebugMode) {
|
|
|
ostringstream Temp;
|
|
|
ostringstream Temp;
|
|
|
|
|
|
|
|
|
logInfo(ContextName, InfoCode, Temp.str());
|
|
|
logInfo(ContextName, InfoCode, Temp.str());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (0 == SaIn) { // If HostAddr is 0, don't do a scan.
|
|
|
|
|
|
|
|
|
|
|
|
return FailSafeMilterResponse;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
SNFMilterAction IpScanResult; // Perform IP scan.
|
|
|
SNFMilterAction IpScanResult; // Perform IP scan.
|
|
|
|
|
|
|
|
|
IpScanResult = Context->milterEngine.scanIP(Context->ConnectionData.HostIP);
|
|
|
IpScanResult = Context->milterEngine.scanIP(Context->ConnectionData.HostIP);
|