[prev in list] [next in list] [prev in thread] [next in thread]
List: james-dev
Subject: svn commit: r469528 -
From: bago () apache ! org
Date: 2006-10-31 15:36:34
Message-ID: 20061031153634.67A9B1A9846 () eris ! apache ! org
[Download RAW message or body]
Author: bago
Date: Tue Oct 31 07:36:33 2006
New Revision: 469528
URL: http://svn.apache.org/viewvc?view=rev&rev=469528
Log:
Fix failing unit test on MX mechanism when remote address in an IPv6
Modified:
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java
Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java?view=diff&rev=469528&r1=469527&r2=469528
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java \
(original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java Tue \
Oct 31 07:36:33 2006 @@ -59,10 +59,13 @@
// Get the right host.
String host = expandHost(spfData);
+ // if the remote IP is an ipv6 we check ipv6 addresses, otherwise ip4
+ boolean isIPv6 = IPAddr.isIPV6(spfData.getIpAddress());
+
// get the ipAddress
- checkAddress = IPAddr.getAddress(spfData.getIpAddress(), getIp4cidr());
+ checkAddress = IPAddr.getAddress(spfData.getIpAddress(), isIPv6 ? \
getIp6cidr() : getIp4cidr());
- List mxRecords = getMXRecords(dnsService, host);
+ List mxRecords = getMXRecords(dnsService, host, isIPv6 ? DNSService.AAAA : \
DNSService.A);
// no mx record found
if (mxRecords == null) return false;
@@ -77,10 +80,11 @@
/**
+ * @param type
* @see org.apache.james.jspf.core.DNSService#getMXRecords(java.lang.String,
* int)
*/
- public List getMXRecords(DNSService dnsProbe, String domainName)
+ private List getMXRecords(DNSService dnsProbe, String domainName, int type)
throws PermErrorException, TempErrorException {
try {
List mxR = null;
@@ -96,7 +100,7 @@
if (mx != null && mx.length() > 0) {
log.debug("Add MX-Record " + mx + " to list");
- List res = dnsProbe.getRecords(mx, DNSService.A);
+ List res = dnsProbe.getRecords(mx, type);
if (res != null) {
if (mxR == null) {
mxR = new ArrayList();
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic