public class SPF extends Object implements SPFChecker
| Constructor and Description |
|---|
SPF(DNSService dnsProbe,
Logger logger)
Uses passed logger and passed dnsServicer
|
SPF(DNSService dnsProbe,
SPFRecordParser parser,
Logger logger,
MacroExpand macroExpand,
SPFExecutor executor)
Uses passed services
|
| Modifier and Type | Method and Description |
|---|---|
DNSLookupContinuation |
checkSPF(SPFSession spfData)
Run check for SPF with the given values.
|
SPFResult |
checkSPF(String ipAddress,
String mailFrom,
String hostName)
Run check for SPF with the given values.
|
FallbackPolicy |
getFallbackPolicy()
Return the FallbackPolicy object which can be used to
provide default spfRecords for hosts which have no records
|
OverridePolicy |
getOverridePolicy()
Return the OverridePolicy object which can be used to
override spfRecords for hosts
|
LinkedList<SPFChecker> |
getPolicies()
Return a default policy for SPF
|
void |
setDefaultExplanation(String defaultExplanation)
Set the default explanation which will be used if no explanation is found in the SPF Record
|
void |
setSPFMustEqualsTXT(boolean mustEquals)
Set to true if a PermError should returned when a domain publish a SPF-Type
and TXT-Type SPF-Record and both are not equals.
|
void |
setTimeOut(int timeOut)
Set the amount of time (in seconds) before an TermError is returned when
the dnsserver not answer.
|
void |
setUseBestGuess(boolean useBestGuess)
Set to true for using best guess.
|
void |
setUseTrustedForwarder(boolean useTrustedForwarder)
Set to true to enable trusted-forwarder.org whitelist.
|
public SPF(DNSService dnsProbe, Logger logger)
dnsProbe - the dns providerlogger - the logger to usepublic SPF(DNSService dnsProbe, SPFRecordParser parser, Logger logger, MacroExpand macroExpand, SPFExecutor executor)
dnsProbe - the dns providerparser - the parser to uselogger - the logger to usepublic SPFResult checkSPF(String ipAddress, String mailFrom, String hostName)
ipAddress - The ipAddress the connection is comming frommailFrom - The mailFrom which was providedhostName - The hostname which was provided as HELO/EHLOpublic DNSLookupContinuation checkSPF(SPFSession spfData) throws PermErrorException, NoneException, TempErrorException, NeutralException
SPFCheckercheckSPF in interface SPFCheckerspfData - The SPF1Data which should be used to run the checkPermErrorException - Get thrown if an error was detectedNoneException - Get thrown if no Record was foundTempErrorException - Get thrown if a DNS problem was detectedNeutralException - Get thrown if the result should be neutralSPFChecker.checkSPF(org.apache.james.jspf.core.SPFSession)public LinkedList<SPFChecker> getPolicies()
public void setTimeOut(int timeOut)
timeOut - The timout in secondspublic void setDefaultExplanation(String defaultExplanation)
defaultExplanation - The explanation to use if no explanation is found in the SPF Recordpublic void setUseBestGuess(boolean useBestGuess)
useBestGuess - true to enable best guesspublic FallbackPolicy getFallbackPolicy()
public void setUseTrustedForwarder(boolean useTrustedForwarder)
useTrustedForwarder - true or falsepublic OverridePolicy getOverridePolicy()
public void setSPFMustEqualsTXT(boolean mustEquals)
mustEquals - true or falseCopyright © 2006–2016 The Apache Software Foundation. All rights reserved.