DESCRIPTION |
Purpose |
The DMARC_POLICY_T is an opaque structure used to communicate on a per message
basis with the library. It is to enter information into policy and to receive information
from policy.
|
Synopsis |
#include <dmarc.h>
DMARC_POLICY_T *pctx;
|
DMARC_POLICY_T |
This opaque data type must be initialized using opendmarc_policy_connect_init() and later freed using opendmarc_policy_connect_shutdown().
In generally you may initialize it when the connection is first accepted and keep it active until the remote client disconnects. If there are multiple envelopes per envelope, you may call opendmarc_policy_connect_rset() to reset the opaque structure for re-use with the next message.
|
Usage |
Each connection from a client to your SMTP server will require its own DMARC_POLICY_T pointer. Be certain to free this structure by calling when the connection is discontinued to avoid a memory leak.
|
NOTES |
- DMARC_POLICY_T is thread safe provided it is not used concurrently by two or more threads. There should be a minimum of one DMARC_POLICY_T pointer per thread.
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_xml_parse.html 0000644 0001750 0001750 00000004265 11776457243 025153 0 ustar kitterma kitterma
opendmarc_xml_parse()
opendmarc_xml_parse()
[back to index]
SYNOPSIS |
#include <dmarc.h>
u_char ** opendmarc_xml_parse(
char *fname, char *err_buf, size_t err_len
);
Parse and XML Report by reading it from a file.
|
DESCRIPTION |
Called When |
opendmarc_xml_parse()
Any time you have received a DMARC report, and have already extracted it from its zip file.
|
|
---|
ARGUMENTS |
Argument | Description |
fname |
The full or relative path name of the file to read.
|
err_buf |
The size of a buffer in bytes to recieve error messages.
|
err_len |
The size of the buffer err_buf in bytes.
|
|
RETURN VALUES |
- u_char ** -- On success, a NULL terminated array of CSV data lines.
- NULL -- Failure, with the reason in the err_buf buffer.
|
NOTES |
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_policy_fetch_ruf.html 0000644 0001750 0001750 00000006260 12366622405 026470 0 ustar kitterma kitterma
opendmarc_policy_fetch_ruf()
opendmarc_policy_fetch_ruf()
[back to index]
SYNOPSIS |
#include <dmarc.h>
u_char ** opendmarc_policy_fetch_ruf(
DMARC_POLICY_T *pctx,
u_char *list_buf, size_t size_of_buf, int constant
);
Query the library to find the list of ruf= values from the DMARC record.
|
DESCRIPTION |
Called When |
opendmarc_policy_fetch_ruf()
is called after the DMARC record has been fetched and parsed.
|
|
---|
ARGUMENTS |
Argument | Description |
pctx |
The address of a structure of type
DMARC_POLICY_T as returned from opendmarc_policy_connect_init().
|
list_buf |
If not NULL, the address of a buffer to receive a comma delimited list as a single string.
|
size_of_buf |
If list_buf was not NULL, the the length of that buffer in bytes.
|
constant |
This function returns an argv-style array of stings. Set this to 0 if you will free that array
when you are finished with it. Set this to 1 if you want to treat that array as const and have
the library magically free it for you.
|
|
RETURN VALUES |
- != NULL -- On success.
- NULL -- The pctp pointer was NULL.
- NULL -- If the DMARC record contained no ruf=
|
NOTES |
- If you set constant to 1, you must not free the array returned. To do so will have unpredictable results.
- Call this function only after a DMARC record was fetched and parsed with
opendmarc_policy_query_dmarc()
or supplied to the library with
opendmarc_policy_store_dmarc().
- Note that each returned record is looked up using DNS to find if it is accepting reports for the from_domain. If not, it is eliminated from the returned list.
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_policy_query_dmarc.html 0000644 0001750 0001750 00000006160 11776457243 027047 0 ustar kitterma kitterma
opendmarc_policy_query_dmarc()
opendmarc_policy_query_dmarc()
[back to index]
SYNOPSIS |
#include <dmarc.h>
OPENDMARC_STATUS_T opendmarc_policy_query_dmarc(
DMARC_POLICY_T *pctx,
u_char *domain
);
Cause the DMARC record to be looked up using DNS.
|
DESCRIPTION |
Called When |
opendmarc_policy_query_dmarc()
may be called either before you have stored the From: domain, or in place of storing that domain.
|
|
---|
ARGUMENTS |
|
RETURN VALUES |
- DMARC_PARSE_OKAY -- Success.
- DMARC_PARSE_ERROR_NULL_CTX -- If you passed in a pctx value that was NULL.
- DMARC_PARSE_ERROR_EMPTY -- if domain was NULL and there was no From: domain.
- DMARC_PARSE_ERROR_NO_DOMAIN -- if domain wasn't really a domain name.
- DMARC_DNS_ERROR_NXDOMAIN -- No such domain found in DNS.
- DMARC_DNS_ERROR_TMPERR -- DNS returned a temporary failure.
- DMARC_DNS_ERROR_NO_RECORD -- The domain exists but no DMARC record was found, either at that domain or a found organizational domain.
|
NOTES |
- If the DMARC record is found it is parsed, so this function can also return the values of opendmarc_policy_parse_dmarc().
- This function uses the standard resolver library. As of this release there are no hooks for an asynchronous resolver library.
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_lib_t.html 0000644 0001750 0001750 00000006271 12042256417 024234 0 ustar kitterma kitterma
OPENDMARC_LIB_T
OPENDMARC_LIB_T
[back to index]
DESCRIPTION |
Purpose |
The OPENDMARC_LIB_T is used to pass startup information into the library.
It is designed to require that nothing inside it needs to ever be allocated nor freed.
|
Synopsis |
#include <dmarc.h>
OPENDMARC_LIB_T lib;
|
OPENDMARC_LIB_T |
The items inside the OPENDMARC_LIB_T structure, and their legal values are:
int tld_type
Can be assigned one of two possible values:
- OPENDMARC_TLD_TYPE_NONE -- If you do not want to use any TLD file to resolve the organizational domain
- OPENDMARC_TLD_TYPE_MOZILLA -- If you will supply a current version of the effective_tld_names.dat
file from mozilla.org.
u_char tld_source_file[MAXPATHLEN]
The full or relative path to the TLD file to parse and use.
NOTE: If and only if your resolver library lacks the res_setservers() interface, the following hooks
are avaliable as a substitute.
int nscount
If you want the dmarc records looked up by other than the name servers listed in
/etc/resolv.conf and your resolver library lacks the res_setservers() interface. This is the count of the number of entries in nsaddr_list.
struct sockaddr_in nsaddr_list[MAXNS]
If your resolver library lacks the res_setservers() interface,
this is an array of IP addresses of name servers to use
converted to the type struct sockaddr_in.
|
Usage |
When your program first starts to run, it should pass a pointer to this OPENDMARC_LIB_T structure
to the opendmarc_policy_library_init function, and when
your program finally shuts down, it should pass a pointer to this OPENDMARC_LIB_T structure
to the opendmarc_policy_library_shutdown function.
|
NOTES |
- OPENDMARC_LIB_T is not thread safe. It must only be used once from inside
the main thread for startup and shutdown purposes. Multiple threads must not independently
attempt to start/stop the library with separate settings.
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_policy_fetch_sp.html 0000644 0001750 0001750 00000005412 11776457243 026326 0 ustar kitterma kitterma
opendmarc_policy_fetch_sp()
opendmarc_policy_fetch_sp()
[back to index]
SYNOPSIS |
#include <dmarc.h>
OPENDMARC_STATUS_T opendmarc_policy_fetch_sp(
DMARC_POLICY_T *pctx,
int *p
);
Query the library to find the sp= value from the DMARC record.
|
DESCRIPTION |
Called When |
opendmarc_policy_fetch_sp()
is called after the DMARC record has been fetched and parsed.
|
|
---|
ARGUMENTS |
Argument | Description |
pctx |
The address of a structure of type
DMARC_POLICY_T as returned from opendmarc_policy_connect_init().
|
sp |
The address of an integer to receive the value following the sp=, a value of:
DMARC_RECORD_P_UNSPECIFIED if the sp= was absent or
DMARC_RECORD_P_NONE if sp=none or
DMARC_RECORD_P_QUARANTINE if sp=quarantine or
DMARC_RECORD_P_REJECT if sp=reject.
|
|
RETURN VALUES |
- DMARC_PARSE_OKAY -- On success.
- DMARC_PARSE_ERROR_EMPTY -- The pctp pointer was NULL.
- DMARC_PARSE_ERROR_NULL_CTX -- If you passed in a sp value that was NULL.
|
NOTES |
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_status_t.html 0000644 0001750 0001750 00000006077 12000355240 025001 0 ustar kitterma kitterma
OPENDMARC_STATUS_T
OPENDMARC_STATUS_T
[back to index]
DESCRIPTION |
Purpose |
The OPENDMARC_STATUS_T is the type returned by many of the functions in this library.
|
Synopsis |
#include <dmarc.h>
OPENDMARC_STATUS_T return_value;
|
OPENDMARC_STATUS_T |
The values that can be returned from functions that return OPENDMARC_STATUS_T include:
- DMARC_PARSE_OKAY -- Success.
- DMARC_PARSE_ERROR_EMPTY -- An argument was empty or NULL or zero length.
- DMARC_PARSE_ERROR_NULL_CTX -- Received a NULL pointer as the context or library initializer.
- DMARC_PARSE_ERROR_BAD_VERSION -- DMARC record contained a bad v=.
- DMARC_PARSE_ERROR_BAD_VALUE -- DMARC record a bad value, e.g. p=bob.
- DMARC_PARSE_ERROR_NO_REQUIRED_P -- DMARC record lacked a required p=.
- DMARC_PARSE_ERROR_NO_DOMAIN -- Parsing required a domain but got <>.
- DMARC_PARSE_ERROR_NO_ALLOC -- Memory allocation error. Also sets errno to ENOMEM.
- DMARC_PARSE_ERROR_BAD_SPF_MACRO -- Bad value given to opendmarc_policy_store_dkim().
- DMARC_DNS_ERROR_NO_RECORD -- No DMARC record was found.
- DMARC_DNS_ERROR_NXDOMAIN -- No such domain exists.
- DMARC_DNS_ERROR_TMPERR -- Lookup of DMARC record got a recoverable error. Try again later.
- DMARC_TLD_ERROR_UNKNOWN -- Type of TLD file was not a known type.
- DMARC_FROM_DOMAIN_ABSENT -- Expected a From: domain but it was absent.
|
Usage |
- Individual functions return specific values. Only check for those documented per function.
- You may used these macros anywhere an integer expression may be used.
|
NOTES |
- You should use these macros rather than looking for particular integers, such as zero.
- These underlying values
currently conflict with some errno values and may be changed in the future.
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_policy_fetch_aspf.html 0000644 0001750 0001750 00000005333 11776457243 026637 0 ustar kitterma kitterma
opendmarc_policy_fetch_aspf()
opendmarc_policy_fetch_aspf()
[back to index]
SYNOPSIS |
#include <dmarc.h>
OPENDMARC_STATUS_T opendmarc_policy_fetch_aspf(
DMARC_POLICY_T *pctx,
int *aspf
);
Query the library to find the aspf= value from the DMARC record.
|
DESCRIPTION |
Called When |
opendmarc_policy_fetch_aspf()
is called after the DMARC record has been fetched and parsed.
|
|
---|
ARGUMENTS |
Argument | Description |
pctx |
The address of a structure of type
DMARC_POLICY_T as returned from opendmarc_policy_connect_init().
|
aspf |
The address of an integer to receive the value following the aspf=, a value of:
DMARC_RECORD_A_UNSPECIFIED if the aspf= was absent or
DMARC_RECORD_A_STRICT if aspf=s or
DMARC_RECORD_A_RELAXED if aspf=r.
|
|
RETURN VALUES |
- DMARC_PARSE_OKAY -- On success.
- DMARC_PARSE_ERROR_EMPTY -- The pctp pointer was NULL.
- DMARC_PARSE_ERROR_NULL_CTX -- If you passed in a aspf value that was NULL.
|
NOTES |
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_policy_connect_clear.html 0000644 0001750 0001750 00000004303 11776457243 027330 0 ustar kitterma kitterma
opendmarc_policy_connect_clear()
opendmarc_policy_connect_clear()
[back to index]
SYNOPSIS |
#include <dmarc.h>
DMARC_POLICY_T * opendmarc_policy_connect_clear(
DMARC_POLICY_T * pctx
);
Clears an already allocated opaque context to all NULLs and zeros. This is appropriate for a program that wishes to preallocate a fixed number of opaque contexts and to clear and reuse them as needed.
|
DESCRIPTION |
Called When |
opendmarc_policy_connect_clear()
may be called anytime you want to completely clear an opaque context.
|
|
---|
ARGUMENTS |
|
RETURN VALUES |
- DMARC_POLICY_T * -- on success
- NULL -- Only if the pointer passed into it is NULL.
|
NOTES |
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_spf_test.html 0000644 0001750 0001750 00000007447 12366622405 025003 0 ustar kitterma kitterma
opendmarc_spf_test()
opendmarc_spf_test()
[back to index]
SYNOPSIS |
#include <dmarc.h>
int opendmarc_spf_test(
char *ip_address, char *mail_from_domain, char *helo_domain,
char *spf_record, int softfail_okay_flag, char *human_readable,
size_t human_readable_len, int *used_mfrom
);
Validate a passed in SPF record or look up one and validate it.
|
DESCRIPTION |
Called When |
opendmarc_spf_test()
May be called anytime all its needed information is gathered. The envelope sender (MAIL From: or mlfi_envfrom)
is the earliest it can be called. The mlfi_eom() is the optimum time because that is the only
routine that can add a header.
|
|
---|
ARGUMENTS |
Argument | Description |
ip_address |
A pointer to a string representation of an IPv4 or IPv6 address.
|
mail_from_domain |
This can be the domain itself, or the full sender address or even the
angle brace enclosed address. Any of of those will work, including the
empty address <> and the literal MAILER_DAEMON.
|
helo_domain |
This is the domain specified with the HELO command. This domain is ignored
if the mail_from_domain contains an actual domain.
|
spf_record |
If not NULL, is a string containing the SPF record to validate.
If NULL, the record will be looked up based on either the mail_from_domain or helo_domain/.
|
softfail_okay_flag |
If zero softfails (~all and ?all) are treated the same as if the are hard fails.
If non-zero, softfails are threated as a pass.
|
human_readable |
If not NULL, is the address of a string buffer into which to scribble a human readble reason for
any result.
|
human_readable_len |
The sizeof() or number of characters available in human_readable.
|
used_mfrom |
Address of an integer into which either TRUE or FALSE will be written. If TRUE,
the mail_from_domain was used to validate the SPF record. If FALSE,
the helo_domain was used to validate the SPF record.
|
|
RETURN VALUES |
- DMARC_POLICY_SPF_OUTCOME_PASS -- On success
- DMARC_POLICY_SPF_OUTCOME_FAIL -- If the SPF record check failed.
- DMARC_POLICY_SPF_OUTCOME_TMPFAIL -- If there was as recoverable failure.
- DMARC_POLICY_SPF_OUTCOME_NONE -- If domain did not have an spf record.
|
NOTES |
- This spf record check performs it own DNS lookups. There are no hooks provided
to subsitute your own DNS lookup routines at this time.
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/docs/opendmarc_policy_library_shutdown.html 0000644 0001750 0001750 00000004236 11776457243 030135 0 ustar kitterma kitterma
opendmarc_policy_library_shutdown()
opendmarc_policy_library_shutdown()
[back to index]
SYNOPSIS |
#include <dmarc.h>
OPENDMARC_STATUS_T opendmarc_policy_library_shutdown(
OPENDMARC_LIB_T *lib
);
Final shutdown of the library for use at program conclusion.
|
DESCRIPTION |
Called When |
opendmarc_policy_library_shutdown()
is called after multi-threading operation cease and before the program terminates.
|
|
---|
ARGUMENTS |
Argument | Description |
lib |
The address of a structure of type
OPENDMARC_LIB_T that your code has filled out with appropriate values.
|
|
RETURN VALUES |
- DMARC_PARSE_OKAY -- Always.
|
NOTES |
- This function is not thread safe and must only be called once and only once after
multi-threading ceases and before the program terminates.
- If you used a TLD file, the library will free any recourses allocated for that use.
|
Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the license.
opendmarc-1.3.1+dfsg/libopendmarc/opendmarc_xml.c 0000644 0001750 0001750 00000043134 12366622405 022273 0 ustar kitterma kitterma /***********************************************************************
** OPENDMARC_XML.C
** OPENDMARC_XML -- Parse a blob of xml DMARC report data
** OPENDMARC_XML_PARSE -- Read a file into a blob
** Copyright (c) 2012-2014, The Trusted Domain Project. All rights reserved.
************************************************************************/
# include "opendmarc_internal.h"
/* libbsd if found */
#ifdef USE_BSD_H
# include
#endif /* USE_BSD_H */
/* libstrl if needed */
#ifdef USE_STRL_H
# include
#endif /* USE_STRL_H */
/* opendmarc_strl if needed */
#ifdef USE_DMARCSTRL_H
# include
#endif /* USE_DMARCSTRL_H */
static char *Taglist[] = {
"adkim",
"aspf",
"auth_results",
"begin",
"comment",
"count",
"date_range",
"disposition",
"dkim",
"domain",
"email",
"end",
"extra_contact_info",
"feedback",
"header_from",
"human_result",
"identifiers",
"org_name",
"p",
"pct",
"policy_evaluated",
"policy_published",
"reason",
"record",
"report_id",
"report_metadata",
"result",
"row",
"source_ip",
"sp",
"spf",
"type",
NULL,
};
static int
tag_lookup(char *tag)
{
char **cpp;
for (cpp = Taglist; *cpp != NULL; ++cpp)
{
if (strcasecmp(*cpp, tag) == 0)
return TRUE;
}
return FALSE;
}
/***********************************************************************
** OPENDMARC_XML -- Parse a blob of xml DMARC report data
** Arguments:
** b -- The blob of xml report data
** blen -- Size of blob
** Returns:
** Nothing yet NEED TO DESIGN OUTPUT
** Side Effects:
** Pushes and pops off local stack, no recursion.
************************************************************************/
# define MAX_STACK_DEPTH (10)
# define MAX_STACK_LINE_LEN (256)
# define MAX_ITEM_NAME_LEN (256)
typedef char STACK[MAX_STACK_DEPTH][MAX_STACK_LINE_LEN];
u_char **
opendmarc_xml(char *b, size_t blen, char *e, size_t elen)
{
STACK stack;
int sidx = -1;
char *cp, *ep, *sp, *tagp;
int i;
int inside = FALSE;
char org_name[MAX_ITEM_NAME_LEN];
u_char ** ary = NULL;
int ary_cnt = 0;
char begin[MAX_ITEM_NAME_LEN];
char end[MAX_ITEM_NAME_LEN];
char source_ip[MAX_ITEM_NAME_LEN];
char report_id[MAX_ITEM_NAME_LEN];
char email[MAX_ITEM_NAME_LEN];
char count[MAX_ITEM_NAME_LEN];
char disposition[MAX_ITEM_NAME_LEN];
char policy_eval_dkim[MAX_ITEM_NAME_LEN];
char policy_eval_spf[MAX_ITEM_NAME_LEN];
char domain[MAX_ITEM_NAME_LEN];
char reason_type[MAX_ITEM_NAME_LEN];
char reason_comment[MAX_ITEM_NAME_LEN];
char adkim[8];
char aspf[8];
char p[32];
char pct[8];
char header_from[MAX_ITEM_NAME_LEN];
char auth_dkim_domain[MAX_ITEM_NAME_LEN];
char auth_dkim_result[MAX_ITEM_NAME_LEN];
char auth_dkim_human[MAX_ITEM_NAME_LEN];
char auth_spf_domain[MAX_ITEM_NAME_LEN];
char auth_spf_result[MAX_ITEM_NAME_LEN];
char auth_spf_human[MAX_ITEM_NAME_LEN];
char obuf[BUFSIZ * 2];
char e_buf[128];
if (e == NULL)
{
e = e_buf;
elen = sizeof e_buf;
}
(void) memset(auth_dkim_domain, '\0', sizeof auth_dkim_domain);
(void) memset(auth_dkim_human, '\0', sizeof auth_dkim_human);
(void) memset(auth_dkim_result, '\0', sizeof auth_dkim_result);
(void) memset(auth_spf_domain, '\0', sizeof auth_spf_domain);
(void) memset(auth_spf_human, '\0', sizeof auth_spf_human);
(void) memset(auth_spf_result, '\0', sizeof auth_spf_result);
(void) memset(count, '\0', sizeof count);
(void) memset(disposition, '\0', sizeof disposition);
(void) memset(email, '\0', sizeof email);
(void) memset(header_from, '\0', sizeof header_from);
(void) memset(policy_eval_dkim, '\0', sizeof policy_eval_dkim);
(void) memset(policy_eval_spf, '\0', sizeof policy_eval_spf);
(void) memset(source_ip, '\0', sizeof source_ip);
(void) memset(stack, '\0', sizeof(STACK));
(void) memset(obuf, '\0', sizeof obuf);
(void) strlcpy(obuf, "begin,end,org_name,email,domain,adkim,aspf,p,pct,source_ip,count,disposition,policy_eval_dkim,policy_eval_spf,reason_type,reason_comment,header_from,auth_dkim_domain,auth_dkim_result,auth_dkim_human,auth_spf_domain,auth_spf_result,auth_spf_human", sizeof obuf);
ary = opendmarc_util_pushargv((u_char *)obuf, ary, &ary_cnt);
ep = b + blen;
for (cp = b; cp < ep; ++cp)
{
if (isspace((int) *cp))
continue;
if (inside == FALSE)
{
if (*cp != '<')
continue;
++cp;
for(sp = cp; *sp != '\0'; ++sp)
{
if (*sp == '?')
break;
if (isalpha((int) *sp) || *sp == '_' ||*sp == '/')
continue;
break;
}
if (*sp == '?')
continue;
*sp = '\0';
if (*cp == '/')
tagp = cp+1;
else
tagp = cp;
if (tag_lookup(tagp) == FALSE)
{
continue;
}
if (*cp == '/')
{
if (sidx == -1)
{
//(void) fprintf(stderr, "<%s>: %s\n",
// cp, "End token with never a start token (ignored)");
cp = sp;
continue;
}
if (strcasecmp(cp+1, "record") == 0)
{
(void) memset(obuf, '\0', sizeof obuf);
(void) strlcat(obuf, begin, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, end, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, org_name, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, email, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, domain, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, adkim, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, aspf, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, p, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, pct, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, source_ip, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, count, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, disposition, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, policy_eval_dkim, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, policy_eval_spf, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, reason_type, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, reason_comment, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, header_from, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, auth_dkim_domain, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, auth_dkim_result, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, auth_dkim_human, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, auth_spf_domain, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, auth_spf_result, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
(void) strlcat(obuf, auth_spf_human, sizeof obuf);
(void) strlcat(obuf, ",", sizeof obuf);
ary = opendmarc_util_pushargv((u_char *)obuf, ary, &ary_cnt);
if (ary == NULL)
{
int xerror = errno;
(void) strlcpy(e, "Allocate memory :", elen);
(void) strlcat(e, strerror(xerror), elen);
return ary;
}
(void) memset(count, '\0', sizeof count);
(void) memset(source_ip, '\0', sizeof source_ip);
(void) memset(disposition, '\0', sizeof disposition);
(void) memset(policy_eval_dkim, '\0', sizeof policy_eval_dkim);
(void) memset(policy_eval_spf, '\0', sizeof policy_eval_spf);
(void) memset(reason_type, '\0', sizeof reason_type);
(void) memset(reason_comment, '\0', sizeof reason_comment);
(void) memset(header_from, '\0', sizeof header_from);
(void) memset(auth_dkim_domain, '\0', sizeof auth_dkim_domain);
(void) memset(auth_dkim_result, '\0', sizeof auth_dkim_result);
(void) memset(auth_dkim_human, '\0', sizeof auth_dkim_human);
(void) memset(auth_spf_domain, '\0', sizeof auth_spf_domain);
(void) memset(auth_spf_result, '\0', sizeof auth_spf_result);
(void) memset(auth_spf_human, '\0', sizeof auth_spf_human);
}
/*
** If matches current , pop off the stack.
** Possiblle bug here, for bad case of text
** My understanding is that XML clauses may not overlap. That is,
** the following is illegal:
** texttexttext
*/
if (strcasecmp(cp+1, stack[sidx]) == 0)
{
--sidx;
cp = sp;
if (sidx < -1)
break;
continue;
}
else
{
/* recover gracefully how? */
}
for (i = sidx; i > 0; --i)
{
if (strcasecmp(cp+1, stack[sidx]) == 0)
break;
}
if (i < 0)
{
//(void) fprintf(stderr, "<%s>: %s\n",
// cp, "End token with no start token (ignored)");
cp = sp;
continue;
}
if (sidx >= 0)
--sidx;
cp = sp;
continue;
}
else
{
++sidx;
if (sidx >= MAX_STACK_DEPTH)
{
(void) strlcpy(e, "<", elen);
(void) strlcat(e, cp, elen);
(void) strlcat(e, ">: Too much stack depth", elen);
return (ary = opendmarc_util_clearargv(ary));
}
(void) strlcpy(stack[sidx], cp, MAX_STACK_LINE_LEN);
cp = sp;
inside = TRUE;
continue;
}
}
else
{
if (*cp == '<')
{
inside = FALSE;
--cp;
continue;
}
for(sp = cp; *sp != '\0'; ++sp)
{
if (*sp == '<')
break;
continue;
}
if (*sp != '<')
{
cp = sp-1;
continue;
}
*sp = '\0';
if (strcasecmp(stack[sidx], "org_name") == 0)
{
(void) memset(org_name, '\0', sizeof org_name);
(void) strlcpy(org_name, cp, sizeof org_name);
}
else if (strcasecmp(stack[sidx], "report_id") == 0)
{
(void) memset(report_id, '\0', sizeof report_id);
(void) strlcpy(report_id, cp, sizeof report_id);
}
else if (strcasecmp(stack[sidx], "email") == 0)
{
(void) memset(email, '\0', sizeof email);
(void) strlcpy(email, cp, sizeof email);
}
else if (strcasecmp(stack[sidx], "begin") == 0)
{
time_t t;
struct tm *tm;
t = strtoul(cp, NULL, 10);
tm = gmtime(&t);
(void) memset(begin, '\0', sizeof begin);
(void) strftime(begin, sizeof begin, "%F-%H:%M:%S", tm);
}
else if (strcasecmp(stack[sidx], "end") == 0)
{
time_t t;
struct tm *tm;
t = strtoul(cp, NULL, 10);
tm = gmtime(&t);
(void) memset(end, '\0', sizeof end);
(void) strftime(end, sizeof end, "%F-%H:%M:%S", tm);
}
else if (strcasecmp(stack[sidx], "source_ip") == 0)
{
(void) strlcpy(source_ip, cp, sizeof source_ip);
}
else if (sidx > 1 && strcasecmp(stack[sidx-2], "auth_results") == 0 &&
strcasecmp(stack[sidx-1], "dkim") == 0 &&
strcasecmp(stack[sidx], "domain") == 0)
{
if (*auth_dkim_domain == '\0')
(void) strlcpy(auth_dkim_domain, cp, sizeof auth_dkim_domain);
else
{
(void) strlcat(auth_dkim_domain, "|", sizeof auth_dkim_domain);
(void) strlcat(auth_dkim_domain, cp, sizeof auth_dkim_domain);
}
}
else if (sidx > 1 && strcasecmp(stack[sidx-2], "auth_results") == 0 &&
strcasecmp(stack[sidx-1], "dkim") == 0 &&
strcasecmp(stack[sidx], "result") == 0)
{
if (*auth_dkim_result == '\0')
(void) strlcpy(auth_dkim_result, cp, sizeof auth_dkim_result);
else
{
(void) strlcat(auth_dkim_result, "|", sizeof auth_dkim_result);
(void) strlcat(auth_dkim_result, cp, sizeof auth_dkim_result);
}
}
else if (sidx > 1 && strcasecmp(stack[sidx-2], "auth_results") == 0 &&
strcasecmp(stack[sidx-1], "dkim") == 0 &&
strcasecmp(stack[sidx], "human_result") == 0)
{
if (*auth_dkim_human == '\0')
(void) strlcpy(auth_dkim_human, cp, sizeof auth_dkim_human);
else
{
(void) strlcat(auth_dkim_human, "|", sizeof auth_dkim_human);
(void) strlcat(auth_dkim_human, cp, sizeof auth_dkim_human);
}
}
else if (sidx > 1 && strcasecmp(stack[sidx-2], "auth_results") == 0 &&
strcasecmp(stack[sidx-1], "spf") == 0 &&
strcasecmp(stack[sidx], "domain") == 0)
{
if (*auth_spf_domain == '\0')
(void) strlcpy(auth_spf_domain, cp, sizeof auth_spf_domain);
else
{
(void) strlcat(auth_spf_domain, "|", sizeof auth_spf_domain);
(void) strlcat(auth_spf_domain, cp, sizeof auth_spf_domain);
}
}
else if (sidx > 1 && strcasecmp(stack[sidx-2], "auth_results") == 0 &&
strcasecmp(stack[sidx-1], "spf") == 0 &&
strcasecmp(stack[sidx], "result") == 0)
{
if (*auth_spf_result == '\0')
(void) strlcpy(auth_spf_result, cp, sizeof auth_spf_result);
else
{
(void) strlcat(auth_spf_result, "|", sizeof auth_spf_result);
(void) strlcat(auth_spf_result, cp, sizeof auth_spf_result);
}
}
else if (sidx > 1 && strcasecmp(stack[sidx-2], "auth_results") == 0 &&
strcasecmp(stack[sidx-1], "spf") == 0 &&
strcasecmp(stack[sidx], "human_result") == 0)
{
if (*auth_spf_human == '\0')
(void) strlcpy(auth_spf_human, cp, sizeof auth_spf_human);
else
{
(void) strlcat(auth_spf_human, "|", sizeof auth_spf_human);
(void) strlcat(auth_spf_human, cp, sizeof auth_spf_human);
}
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "policy_published") == 0 &&
strcasecmp(stack[sidx], "domain") == 0)
{
(void) memset(domain, '\0', sizeof domain);
(void) strlcpy(domain, cp, sizeof domain);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "policy_published") == 0 &&
strcasecmp(stack[sidx], "adkim") == 0)
{
(void) memset(adkim, '\0', sizeof adkim);
(void) strlcpy(adkim, cp, sizeof adkim);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "policy_published") == 0 &&
strcasecmp(stack[sidx], "aspf") == 0)
{
(void) memset(aspf, '\0', sizeof aspf);
(void) strlcpy(aspf, cp, sizeof aspf);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "policy_published") == 0 &&
strcasecmp(stack[sidx], "pct") == 0)
{
(void) memset(pct, '\0', sizeof pct);
(void) strlcpy(pct, cp, sizeof pct);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "policy_published") == 0 &&
strcasecmp(stack[sidx], "p") == 0)
{
(void) memset(p, '\0', sizeof p);
(void) strlcpy(p, cp, sizeof p);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "reason") == 0 &&
strcasecmp(stack[sidx], "type") == 0)
{
if (strlen(reason_type) > 0)
(void) strlcat(reason_type, " ", sizeof reason_type);
(void) strlcat(reason_type, cp, sizeof reason_type);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "reason") == 0 &&
strcasecmp(stack[sidx], "comment") == 0)
{
if (strlen(reason_comment) > 0)
(void) strlcat(reason_comment, " ", sizeof reason_comment);
(void) strlcat(reason_comment, cp, sizeof reason_comment);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "identifiers") == 0 &&
strcasecmp(stack[sidx], "header_from") == 0)
{
/*
* Some sites put a full address in here.
* Some others list mutilple address here.
*/
if (*header_from == '\0')
(void) strlcpy(header_from, cp, sizeof header_from);
else
{
(void) strlcat(header_from, "|", sizeof header_from);
(void) strlcat(header_from, cp, sizeof header_from);
}
}
else if (strcasecmp(stack[sidx], "count") == 0)
{
(void) strlcpy(count, cp, sizeof count);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "policy_evaluated") == 0 &&
strcasecmp(stack[sidx], "disposition") == 0)
{
(void) strlcpy(disposition, cp, sizeof disposition);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "policy_evaluated") == 0 &&
strcasecmp(stack[sidx], "dkim") == 0)
{
(void) strlcpy(policy_eval_dkim, cp, sizeof policy_eval_dkim);
}
else if (sidx > 0 && strcasecmp(stack[sidx-1], "policy_evaluated") == 0 &&
strcasecmp(stack[sidx], "spf") == 0)
{
(void) strlcpy(policy_eval_spf, cp, sizeof policy_eval_spf);
}
*sp = '<';
cp = sp-1;
inside = FALSE;
continue;
}
}
return ary;
}
u_char **
opendmarc_xml_parse(char *fname, char *err_buf, size_t err_len)
{
struct stat statb;
FILE * fp;
char * bufp;
char e_buf[128];
int ret;
u_char ** ary = NULL;
int xerror;
size_t rb;
if (fname == NULL)
{
xerror = errno;
(void) snprintf(err_buf, err_len, "%s: %s", fname, "File name was NULL");
errno = EINVAL;
return NULL;
}
if (err_buf == NULL)
{
err_buf = e_buf;
err_len = sizeof e_buf;
}
ret = lstat(fname, &statb);
if (ret != 0)
{
xerror = errno;
(void) snprintf(err_buf, err_len, "%s: %s", fname, strerror(errno));
errno = xerror;
return NULL;
}
if (statb.st_size == 0)
{
xerror = errno;
(void) snprintf(err_buf, err_len, "%s: %s", fname, "Empty file.");
errno = xerror;
return NULL;
}
bufp = calloc(statb.st_size, 1);
if (bufp == NULL)
{
xerror = errno;
(void) snprintf(err_buf, err_len, "%s: %s", fname, strerror(errno));
errno = xerror;
return NULL;
}
fp = fopen(fname, "r");
if (fp == NULL)
{
xerror = errno;
(void) snprintf(err_buf, err_len, "%s: %s", fname, strerror(errno));
(void) free(bufp);
errno = xerror;
return NULL;
}
rb = fread(bufp, 1, statb.st_size, fp);
if (rb != statb.st_size)
{
xerror = errno;
(void) snprintf(err_buf, err_len, "%s: truncated read", fname);
(void) free(bufp);
(void) fclose(fp);
errno = xerror;
return NULL;
}
else if (ferror(fp))
{
xerror = errno;
(void) snprintf(err_buf, err_len, "%s: %s", fname, strerror(errno));
(void) free(bufp);
(void) fclose(fp);
errno = xerror;
return NULL;
}
(void) fclose(fp);
ary = opendmarc_xml(bufp, statb.st_size, err_buf, err_len);
xerror = errno;
(void) free(bufp);
errno = xerror;
return ary;
}
opendmarc-1.3.1+dfsg/libopendmarc/dmarc.h 0000644 0001750 0001750 00000016510 12472713535 020537 0 ustar kitterma kitterma /* Copyright (c) 2012-2015, The Trusted Domain Project. All rights reserved. */
#ifndef DMARC_H
#define DMARC_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include
#include
#include
#include
#include
#define OPENDMARC_LIB_VERSION 0x01030100
#define DMARC_MAXHOSTNAMELEN (256)
# define DMARC_POLICY_IP_TYPE_IPV4 (4)
# define DMARC_POLICY_IP_TYPE_IPV6 (6)
# define DMARC_POLICY_SPF_ORIGIN_MAILFROM (1)
# define DMARC_POLICY_SPF_ORIGIN_HELO (2)
# define DMARC_POLICY_SPF_OUTCOME_NONE (0)
# define DMARC_POLICY_SPF_OUTCOME_PASS (1)
# define DMARC_POLICY_SPF_OUTCOME_FAIL (2)
# define DMARC_POLICY_SPF_OUTCOME_TMPFAIL (3)
# define DMARC_POLICY_SPF_ALIGNMENT_PASS (4)
# define DMARC_POLICY_SPF_ALIGNMENT_FAIL (5)
# define DMARC_POLICY_DKIM_OUTCOME_NONE (0)
# define DMARC_POLICY_DKIM_OUTCOME_PASS (1)
# define DMARC_POLICY_DKIM_OUTCOME_FAIL (2)
# define DMARC_POLICY_DKIM_OUTCOME_TMPFAIL (3)
# define DMARC_POLICY_DKIM_ALIGNMENT_PASS (4)
# define DMARC_POLICY_DKIM_ALIGNMENT_FAIL (5)
#define DMARC_RECORD_A_UNSPECIFIED ('\0') /* adkim and aspf */
#define DMARC_RECORD_A_STRICT ('s') /* adkim and aspf */
#define DMARC_RECORD_A_RELAXED ('r') /* adkim and aspf */
#define DMARC_RECORD_P_UNSPECIFIED ('\0') /* p and sp */
#define DMARC_RECORD_P_NONE ('n') /* p and sp */
#define DMARC_RECORD_P_QUARANTINE ('q') /* p and sp */
#define DMARC_RECORD_P_REJECT ('r') /* p and sp */
#define DMARC_RECORD_RF_UNSPECIFIED (0x0) /* rf, a bitmap */
#define DMARC_RECORD_RF_AFRF (0x1) /* rf, a bitmap */
#define DMARC_RECORD_RF_IODEF (0x2) /* rf, a bitmap */
#define DMARC_RECORD_FO_UNSPECIFIED (0x0) /* fo, a bitmap */
#define DMARC_RECORD_FO_0 (0x1) /* fo, a bitmap */
#define DMARC_RECORD_FO_1 (0x2) /* fo, a bitmap */
#define DMARC_RECORD_FO_D (0x4) /* fo, a bitmap */
#define DMARC_RECORD_FO_S (0x8) /* fo, a bitmap */
#define DMARC_PARSE_OKAY (0) /* Okay to continue */
#define DMARC_PARSE_ERROR_EMPTY (1) /* Nothing to parse */
#define DMARC_PARSE_ERROR_NULL_CTX (2) /* Got a NULL context */
#define DMARC_PARSE_ERROR_BAD_VERSION (3) /* Such as v=DBOB1 */
#define DMARC_PARSE_ERROR_BAD_VALUE (4) /* Bad token value like p=bob */
#define DMARC_PARSE_ERROR_NO_REQUIRED_P (5) /* Required p= missing */
#define DMARC_PARSE_ERROR_NO_DOMAIN (6) /* No domain, e.g. <> */
#define DMARC_PARSE_ERROR_NO_ALLOC (7) /* Memory Allocation Faliure */
#define DMARC_PARSE_ERROR_BAD_SPF_MACRO (8) /* Was not a macro from above */
#define DMARC_PARSE_ERROR_BAD_DKIM_MACRO DMARC_PARSE_ERROR_BAD_SPF_MACRO
#define DMARC_DNS_ERROR_NO_RECORD (9) /* No DMARC record was found */
#define DMARC_DNS_ERROR_NXDOMAIN (10) /* No such domain exists */
#define DMARC_DNS_ERROR_TMPERR (11) /* Recoverable DNS error */
#define DMARC_TLD_ERROR_UNKNOWN (12) /* Undefined TLD type */
#define DMARC_FROM_DOMAIN_ABSENT (13) /* No From: domain was supplied */
#define DMARC_POLICY_ABSENT (14) /* Policy up to you. No DMARC record found */
#define DMARC_POLICY_PASS (15) /* Policy OK so accept message */
#define DMARC_POLICY_REJECT (16) /* Policy says to reject message */
#define DMARC_POLICY_QUARANTINE (17) /* Policy says to quarantine message */
#define DMARC_POLICY_NONE (18) /* Policy says to monitor and report */
#ifndef OPENDMARC_POLICY_C
typedef struct dmarc_policy_t DMARC_POLICY_T;
#endif
#define OPENDMARC_STATUS_T int
#ifndef MAXPATHLEN
# define MAXPATHLEN (2048)
#endif
#ifndef MAXNS
# define MAXNS (3)
#endif
#define OPENDMARC_MAX_NSADDRLIST (8)
typedef struct {
int tld_type;
u_char tld_source_file[MAXPATHLEN];
int nscount;
struct sockaddr_in nsaddr_list[MAXNS];
} OPENDMARC_LIB_T;
#define OPENDMARC_TLD_TYPE_NONE (0) /* Will not use a tld file */
#define OPENDMARC_TLD_TYPE_MOZILLA (1) /* mozilla.org effective_tld_names.dat */
/*
* Library one time initialization.
*/
OPENDMARC_STATUS_T opendmarc_policy_library_init(OPENDMARC_LIB_T *lib_init);
OPENDMARC_STATUS_T opendmarc_policy_library_shutdown(OPENDMARC_LIB_T *lib_init);
/*
* Context management.
*/
DMARC_POLICY_T * opendmarc_policy_connect_init(u_char *ip_addr, int ip_type);
DMARC_POLICY_T * opendmarc_policy_connect_clear(DMARC_POLICY_T *pctx);
DMARC_POLICY_T * opendmarc_policy_connect_rset(DMARC_POLICY_T *pctx);
DMARC_POLICY_T * opendmarc_policy_connect_shutdown(DMARC_POLICY_T *pctx);
/*
* Store information routines.
*/
OPENDMARC_STATUS_T opendmarc_policy_store_from_domain(DMARC_POLICY_T *pctx, u_char *domain);
OPENDMARC_STATUS_T opendmarc_policy_store_dkim(DMARC_POLICY_T *pctx, u_char *domain, int result, u_char *human_result);
OPENDMARC_STATUS_T opendmarc_policy_store_spf(DMARC_POLICY_T *pctx, u_char *domain, int result, int origin, u_char *human_result);
/*
* The DMARC record itself.
*/
OPENDMARC_STATUS_T opendmarc_policy_query_dmarc(DMARC_POLICY_T *pctx, u_char *domain);
OPENDMARC_STATUS_T opendmarc_policy_parse_dmarc(DMARC_POLICY_T *pctx, u_char *domain, u_char *record);
OPENDMARC_STATUS_T opendmarc_policy_store_dmarc(DMARC_POLICY_T *pctx, u_char *dmarc_record, u_char *domain, u_char *organizationaldomain);
/*
* Access to parts of the DMARC record.
*/
OPENDMARC_STATUS_T opendmarc_get_policy_to_enforce(DMARC_POLICY_T *pctx);
OPENDMARC_STATUS_T opendmarc_policy_fetch_alignment(DMARC_POLICY_T *pctx, int *dkim_alignment, int *spf_alignment);
OPENDMARC_STATUS_T opendmarc_policy_fetch_pct(DMARC_POLICY_T *pctx, int *pctp);
OPENDMARC_STATUS_T opendmarc_policy_fetch_adkim(DMARC_POLICY_T *pctx, int *adkim);
OPENDMARC_STATUS_T opendmarc_policy_fetch_aspf(DMARC_POLICY_T *pctx, int *aspf);
OPENDMARC_STATUS_T opendmarc_policy_fetch_p(DMARC_POLICY_T *pctx, int *p);
OPENDMARC_STATUS_T opendmarc_policy_fetch_sp(DMARC_POLICY_T *pctx, int *sp);
u_char ** opendmarc_policy_fetch_rua(DMARC_POLICY_T *pctx, u_char *list_buf, size_t size_of_buf, int constant);
u_char ** opendmarc_policy_fetch_ruf(DMARC_POLICY_T *pctx, u_char *list_buf, size_t size_of_buf, int constant);
OPENDMARC_STATUS_T opendmarc_policy_fetch_utilized_domain(DMARC_POLICY_T *pctx, u_char *buf, size_t buflen);
OPENDMARC_STATUS_T opendmarc_policy_query_dmarc_xdomain(DMARC_POLICY_T *pctx, u_char *uri);
/*
* TLD processing
*/
int opendmarc_tld_read_file(char *path_fname, char *commentstring, char *drop, char *except);
void opendmarc_tld_shutdown();
/*
* XML Parsing
*/
u_char ** opendmarc_xml(char *b, size_t blen, char *e, size_t elen);
u_char ** opendmarc_xml_parse(char *fname, char *err_buf, size_t err_len);
/*
* Utility routines
*/
void opendmarc_dns_fake_record(const char *name, const char *answer);
u_char ** opendmarc_util_clearargv(u_char **ary);
const char * opendmarc_policy_status_to_str(OPENDMARC_STATUS_T status);
int opendmarc_policy_check_alignment(u_char *subdomain, u_char *tld, int mode);
int opendmarc_policy_to_buf(DMARC_POLICY_T *pctx, char *buf, size_t buflen);
/*
* SPF Processing
*/
int opendmarc_spf_test(char *ip_address, char *mail_from_domain, char *helo_domain, char *spf_record, int soft_fail_as_pass, char *human_readable, size_t human_readable_len, int *use_mailfrom);
int opendmarc_spf2_test(char *ip_address, char *mail_from_domain, char *helo_domain, char *spf_record, int softfail_okay_flag, char *human_readable, size_t human_readable_len, int *used_mfrom);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* DMARC_H */
opendmarc-1.3.1+dfsg/libopendmarc/tests/ 0000755 0001750 0001750 00000000000 12472720170 020430 5 ustar kitterma kitterma opendmarc-1.3.1+dfsg/libopendmarc/tests/testfiles/ 0000755 0001750 0001750 00000000000 12472720170 022432 5 ustar kitterma kitterma opendmarc-1.3.1+dfsg/libopendmarc/tests/testfiles/Makefile.in 0000644 0001750 0001750 00000030125 12472707120 024500 0 ustar kitterma kitterma # Makefile.in generated by automake 1.13.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = libopendmarc/tests/testfiles
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_pthread.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/build-config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HEX_VERSION = @HEX_VERSION@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBDMARC_DIR = @LIBDMARC_DIR@
LIBMILTER_INCDIRS = @LIBMILTER_INCDIRS@
LIBMILTER_LIBDIRS = @LIBMILTER_LIBDIRS@
LIBMILTER_LIBS = @LIBMILTER_LIBS@
LIBOBJS = @LIBOBJS@
LIBOPENDMARC_VERSION_INFO = @LIBOPENDMARC_VERSION_INFO@
LIBRESOLV = @LIBRESOLV@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SQL_BACKEND = @SQL_BACKEND@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_aux_dir = @ac_aux_dir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
miltertest = @miltertest@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libopendmarc/tests/testfiles/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign libopendmarc/tests/testfiles/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags-am uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
opendmarc-1.3.1+dfsg/libopendmarc/tests/testfiles/Makefile.am 0000644 0001750 0001750 00000000031 11775772043 024473 0 ustar kitterma kitterma AUTOMAKE_OPTIONS=foreign
opendmarc-1.3.1+dfsg/libopendmarc/tests/testfiles/effective_tld_names.dat 0000644 0001750 0001750 00000344637 12307420767 027141 0 ustar kitterma kitterma // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// ===BEGIN ICANN DOMAINS===
// ac : http://en.wikipedia.org/wiki/.ac
ac
com.ac
edu.ac
gov.ac
net.ac
mil.ac
org.ac
// ad : http://en.wikipedia.org/wiki/.ad
ad
nom.ad
// ae : http://en.wikipedia.org/wiki/.ae
// see also: "Domain Name Eligibility Policy" at http://www.aeda.ae/eng/aepolicy.php
ae
co.ae
net.ae
org.ae
sch.ae
ac.ae
gov.ae
mil.ae
// aero : see http://www.information.aero/index.php?id=66
aero
accident-investigation.aero
accident-prevention.aero
aerobatic.aero
aeroclub.aero
aerodrome.aero
agents.aero
aircraft.aero
airline.aero
airport.aero
air-surveillance.aero
airtraffic.aero
air-traffic-control.aero
ambulance.aero
amusement.aero
association.aero
author.aero
ballooning.aero
broker.aero
caa.aero
cargo.aero
catering.aero
certification.aero
championship.aero
charter.aero
civilaviation.aero
club.aero
conference.aero
consultant.aero
consulting.aero
control.aero
council.aero
crew.aero
design.aero
dgca.aero
educator.aero
emergency.aero
engine.aero
engineer.aero
entertainment.aero
equipment.aero
exchange.aero
express.aero
federation.aero
flight.aero
freight.aero
fuel.aero
gliding.aero
government.aero
groundhandling.aero
group.aero
hanggliding.aero
homebuilt.aero
insurance.aero
journal.aero
journalist.aero
leasing.aero
logistics.aero
magazine.aero
maintenance.aero
marketplace.aero
media.aero
microlight.aero
modelling.aero
navigation.aero
parachuting.aero
paragliding.aero
passenger-association.aero
pilot.aero
press.aero
production.aero
recreation.aero
repbody.aero
res.aero
research.aero
rotorcraft.aero
safety.aero
scientist.aero
services.aero
show.aero
skydiving.aero
software.aero
student.aero
taxi.aero
trader.aero
trading.aero
trainer.aero
union.aero
workinggroup.aero
works.aero
// af : http://www.nic.af/help.jsp
af
gov.af
com.af
org.af
net.af
edu.af
// ag : http://www.nic.ag/prices.htm
ag
com.ag
org.ag
net.ag
co.ag
nom.ag
// ai : http://nic.com.ai/
ai
off.ai
com.ai
net.ai
org.ai
// al : http://www.ert.gov.al/ert_alb/faq_det.html?Id=31
al
com.al
edu.al
gov.al
mil.al
net.al
org.al
// am : http://en.wikipedia.org/wiki/.am
am
// an : http://www.una.an/an_domreg/default.asp
an
com.an
net.an
org.an
edu.an
// ao : http://en.wikipedia.org/wiki/.ao
// http://www.dns.ao/REGISTR.DOC
ao
ed.ao
gv.ao
og.ao
co.ao
pb.ao
it.ao
// aq : http://en.wikipedia.org/wiki/.aq
aq
// ar : https://nic.ar/normativa-vigente.xhtml
ar
com.ar
edu.ar
gob.ar
int.ar
mil.ar
net.ar
org.ar
tur.ar
// arpa : http://en.wikipedia.org/wiki/.arpa
// Confirmed by registry 2008-06-18
arpa
e164.arpa
in-addr.arpa
ip6.arpa
iris.arpa
uri.arpa
urn.arpa
// as : http://en.wikipedia.org/wiki/.as
as
gov.as
// asia : http://en.wikipedia.org/wiki/.asia
asia
// at : http://en.wikipedia.org/wiki/.at
// Confirmed by registry 2008-06-17
at
ac.at
co.at
gv.at
or.at
// au : http://en.wikipedia.org/wiki/.au
// http://www.auda.org.au/
au
// 2LDs
com.au
net.au
org.au
edu.au
gov.au
asn.au
id.au
csiro.au
// Historic 2LDs (closed to new registration, but sites still exist)
info.au
conf.au
oz.au
// CGDNs - http://www.cgdn.org.au/
act.au
nsw.au
nt.au
qld.au
sa.au
tas.au
vic.au
wa.au
// 3LDs
act.edu.au
nsw.edu.au
nt.edu.au
qld.edu.au
sa.edu.au
tas.edu.au
vic.edu.au
wa.edu.au
act.gov.au
// nsw.gov.au Bug 547985 - Removed at request of
// nt.gov.au Bug 940478 - Removed at request of Greg Connors
qld.gov.au
sa.gov.au
tas.gov.au
vic.gov.au
wa.gov.au
// aw : http://en.wikipedia.org/wiki/.aw
aw
com.aw
// ax : http://en.wikipedia.org/wiki/.ax
ax
// az : http://en.wikipedia.org/wiki/.az
az
com.az
net.az
int.az
gov.az
org.az
edu.az
info.az
pp.az
mil.az
name.az
pro.az
biz.az
// ba : http://en.wikipedia.org/wiki/.ba
ba
org.ba
net.ba
edu.ba
gov.ba
mil.ba
unsa.ba
unbi.ba
co.ba
com.ba
rs.ba
// bb : http://en.wikipedia.org/wiki/.bb
bb
biz.bb
com.bb
edu.bb
gov.bb
info.bb
net.bb
org.bb
store.bb
// bd : http://en.wikipedia.org/wiki/.bd
*.bd
// be : http://en.wikipedia.org/wiki/.be
// Confirmed by registry 2008-06-08
be
ac.be
// bf : http://en.wikipedia.org/wiki/.bf
bf
gov.bf
// bg : http://en.wikipedia.org/wiki/.bg
// https://www.register.bg/user/static/rules/en/index.html
bg
a.bg
b.bg
c.bg
d.bg
e.bg
f.bg
g.bg
h.bg
i.bg
j.bg
k.bg
l.bg
m.bg
n.bg
o.bg
p.bg
q.bg
r.bg
s.bg
t.bg
u.bg
v.bg
w.bg
x.bg
y.bg
z.bg
0.bg
1.bg
2.bg
3.bg
4.bg
5.bg
6.bg
7.bg
8.bg
9.bg
// bh : http://en.wikipedia.org/wiki/.bh
bh
com.bh
edu.bh
net.bh
org.bh
gov.bh
// bi : http://en.wikipedia.org/wiki/.bi
// http://whois.nic.bi/
bi
co.bi
com.bi
edu.bi
or.bi
org.bi
// biz : http://en.wikipedia.org/wiki/.biz
biz
// bj : http://en.wikipedia.org/wiki/.bj
bj
asso.bj
barreau.bj
gouv.bj
// bm : http://www.bermudanic.bm/dnr-text.txt
bm
com.bm
edu.bm
gov.bm
net.bm
org.bm
// bn : http://en.wikipedia.org/wiki/.bn
*.bn
// bo : http://www.nic.bo/
bo
com.bo
edu.bo
gov.bo
gob.bo
int.bo
org.bo
net.bo
mil.bo
tv.bo
// br : http://registro.br/dominio/dpn.html
// Submitted by registry 2011-03-01
br
adm.br
adv.br
agr.br
am.br
arq.br
art.br
ato.br
b.br
bio.br
blog.br
bmd.br
cim.br
cng.br
cnt.br
com.br
coop.br
ecn.br
eco.br
edu.br
emp.br
eng.br
esp.br
etc.br
eti.br
far.br
flog.br
fm.br
fnd.br
fot.br
fst.br
g12.br
ggf.br
gov.br
imb.br
ind.br
inf.br
jor.br
jus.br
leg.br
lel.br
mat.br
med.br
mil.br
mus.br
net.br
nom.br
not.br
ntr.br
odo.br
org.br
ppg.br
pro.br
psc.br
psi.br
qsl.br
radio.br
rec.br
slg.br
srv.br
taxi.br
teo.br
tmp.br
trd.br
tur.br
tv.br
vet.br
vlog.br
wiki.br
zlg.br
// bs : http://www.nic.bs/rules.html
bs
com.bs
net.bs
org.bs
edu.bs
gov.bs
// bt : http://en.wikipedia.org/wiki/.bt
bt
com.bt
edu.bt
gov.bt
net.bt
org.bt
// bv : No registrations at this time.
// Submitted by registry 2006-06-16
bv
// bw : http://en.wikipedia.org/wiki/.bw
// http://www.gobin.info/domainname/bw.doc
// list of other 2nd level tlds ?
bw
co.bw
org.bw
// by : http://en.wikipedia.org/wiki/.by
// http://tld.by/rules_2006_en.html
// list of other 2nd level tlds ?
by
gov.by
mil.by
// Official information does not indicate that com.by is a reserved
// second-level domain, but it's being used as one (see www.google.com.by and
// www.yahoo.com.by, for example), so we list it here for safety's sake.
com.by
// http://hoster.by/
of.by
// bz : http://en.wikipedia.org/wiki/.bz
// http://www.belizenic.bz/
bz
com.bz
net.bz
org.bz
edu.bz
gov.bz
// ca : http://en.wikipedia.org/wiki/.ca
ca
// ca geographical names
ab.ca
bc.ca
mb.ca
nb.ca
nf.ca
nl.ca
ns.ca
nt.ca
nu.ca
on.ca
pe.ca
qc.ca
sk.ca
yk.ca
// gc.ca: http://en.wikipedia.org/wiki/.gc.ca
// see also: http://registry.gc.ca/en/SubdomainFAQ
gc.ca
// cat : http://en.wikipedia.org/wiki/.cat
cat
// cc : http://en.wikipedia.org/wiki/.cc
cc
// cd : http://en.wikipedia.org/wiki/.cd
// see also: https://www.nic.cd/domain/insertDomain_2.jsp?act=1
cd
gov.cd
// cf : http://en.wikipedia.org/wiki/.cf
cf
// cg : http://en.wikipedia.org/wiki/.cg
cg
// ch : http://en.wikipedia.org/wiki/.ch
ch
// ci : http://en.wikipedia.org/wiki/.ci
// http://www.nic.ci/index.php?page=charte
ci
org.ci
or.ci
com.ci
co.ci
edu.ci
ed.ci
ac.ci
net.ci
go.ci
asso.ci
aéroport.ci
int.ci
presse.ci
md.ci
gouv.ci
// ck : http://en.wikipedia.org/wiki/.ck
*.ck
!www.ck
// cl : http://en.wikipedia.org/wiki/.cl
cl
gov.cl
gob.cl
co.cl
mil.cl
// cm : http://en.wikipedia.org/wiki/.cm
cm
gov.cm
// cn : http://en.wikipedia.org/wiki/.cn
// Submitted by registry 2008-06-11
cn
ac.cn
com.cn
edu.cn
gov.cn
net.cn
org.cn
mil.cn
公司.cn
网络.cn
網絡.cn
// cn geographic names
ah.cn
bj.cn
cq.cn
fj.cn
gd.cn
gs.cn
gz.cn
gx.cn
ha.cn
hb.cn
he.cn
hi.cn
hl.cn
hn.cn
jl.cn
js.cn
jx.cn
ln.cn
nm.cn
nx.cn
qh.cn
sc.cn
sd.cn
sh.cn
sn.cn
sx.cn
tj.cn
xj.cn
xz.cn
yn.cn
zj.cn
hk.cn
mo.cn
tw.cn
// co : http://en.wikipedia.org/wiki/.co
// Submitted by registry 2008-06-11
co
arts.co
com.co
edu.co
firm.co
gov.co
info.co
int.co
mil.co
net.co
nom.co
org.co
rec.co
web.co
// com : http://en.wikipedia.org/wiki/.com
com
// coop : http://en.wikipedia.org/wiki/.coop
coop
// cr : http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do
cr
ac.cr
co.cr
ed.cr
fi.cr
go.cr
or.cr
sa.cr
// cu : http://en.wikipedia.org/wiki/.cu
cu
com.cu
edu.cu
org.cu
net.cu
gov.cu
inf.cu
// cv : http://en.wikipedia.org/wiki/.cv
cv
// cw : http://www.una.cw/cw_registry/
// Confirmed by registry 2013-03-26
cw
com.cw
edu.cw
net.cw
org.cw
// cx : http://en.wikipedia.org/wiki/.cx
// list of other 2nd level tlds ?
cx
gov.cx
// cy : http://en.wikipedia.org/wiki/.cy
*.cy
// cz : http://en.wikipedia.org/wiki/.cz
cz
// de : http://en.wikipedia.org/wiki/.de
// Confirmed by registry |
---|
|
---|
|
---|