Back to index

courier  0.68.2
spf.h
Go to the documentation of this file.
00001 /*
00002 ** Copyright 2004 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #ifndef       rfc1035_spf_h
00007 #define       rfc1035_spf_h
00008 
00009 
00010 #include "rfc1035/rfc1035.h"
00011 
00012 #ifdef  __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 /*
00017    An SPF client evaluates an SPF record and produces one of seven
00018    results:
00019 
00020      None: The domain does not publish SPF data.
00021 
00022      Neutral (?): The SPF client MUST proceed as if a domain did not
00023      publish SPF data.  This result occurs if the domain explicitly
00024      specifies a "?" value, or if processing "falls off the end" of
00025      the SPF record.
00026 
00027      Pass (+): the message meets the publishing domain's definition of
00028      legitimacy.  MTAs proceed to apply local policy and MAY accept or
00029      reject the message accordingly.
00030 
00031      Fail (-): the message does not meet a domain's definition of
00032      legitimacy.  MTAs MAY reject the message using a permanent
00033      failure reply code.  (Code 550 is RECOMMENDED.  See [RFC2821]
00034      section 7.1.)
00035 
00036      Softfail (~): the message does not meet a domain's strict
00037      definition of legitimacy, but the domain cannot confidently state
00038      that the message is a forgery.  MTAs SHOULD accept the message
00039      but MAY subject it to a higher transaction cost, deeper scrutiny,
00040      or an unfavourable score.
00041 
00042    There are two error conditions, one temporary and one permanent.
00043 
00044      Error: indicates an error during lookup; an MTA SHOULD reject the
00045      message using a transient failure code, such as 450.
00046 
00047      Unknown: indicates incomplete processing: an MTA MUST proceed as
00048      if a domain did not publish SPF data.
00049 */
00050 
00051 #define SPF_NONE 0
00052 #define SPF_NEUTRAL '?'
00053 #define SPF_PASS '+'
00054 #define SPF_FAIL '-'
00055 #define SPF_SOFTFAIL '~'
00056 #define SPF_ERROR '4'
00057 
00058        /* Everything else is SPF_UNKNOWN */
00059 #define SPF_UNKNOWN '5'
00060 
00061 char rfc1035_spf_lookup(const char *mailfrom,
00062                      const char *tcpremoteip,
00063                      const char *tcpremotehost,
00064                      const char *helodomain,
00065                      const char *mydomain,
00066                      char *errmsg_buf,
00067                      size_t errmsg_buf_size);
00068 
00069 #ifdef  __cplusplus
00070 }
00071 #endif
00072 
00073 #endif