15 changed files with 71 additions and 33 deletions
@ -0,0 +1,37 @@ |
|||
#' #' Split out all SPF records in a domain's TXT record |
|||
#' #' |
|||
#' #' Given a vector of TXT records, this function will return a list of vectors |
|||
#' #' of all the SPF records for each. If the given TXT record is not an SPF |
|||
#' #' record, \code{NA} is returned (which makes it easy to skip with \code{purrr} |
|||
#' #' functions). |
|||
#' #' |
|||
#' #' @param dkim_rec a character vector of DNS TXT records |
|||
#' #' @export |
|||
#' parse_dkim <- function(dkim_rec) { |
|||
#' purrr::map_df(dkim_rec, .parse_dkim) |
|||
#' } |
|||
#' |
|||
#' .parse_dkim <- function(dkim_rec) { |
|||
#' |
|||
#' if (has_dkim(dkim_rec)) { |
|||
#' spf_rec <- stringi::stri_trim(stringi::stri_replace_all_regex(dkim_rec, '"', "")) |
|||
#' recs <- stri_trim(unlist(stringi::stri_split_regex(dkim_rec, ";"))) |
|||
#' recs <- grep("v=DKIM1", recs, invert=TRUE, value=TRUE) |
|||
#' purrr::keep(recs, stringi::stri_detect_fixed, "=") %>% |
|||
#' purrr::map_df(~{ |
|||
#' x <- stringi::stri_match_all_regex(.x, "(.*)=(.*)")[[1]] |
|||
#' data_frame(key=x[,2], value=x[,3]) |
|||
#' }) |
|||
#' } else { |
|||
#' NULL |
|||
#' } |
|||
#' |
|||
#' } |
|||
#' |
|||
#' #' Test for whether a DNS TXT record is a DKIM record |
|||
#' #' |
|||
#' #' @param spf_rec a character vector of DNS TXT records |
|||
#' #' @export |
|||
#' has_dkim <- function(dkim_rec) { |
|||
#' grepl("v=DKIM1", dkim_rec) |
|||
#' } |
@ -1,19 +1,17 @@ |
|||
## Test environments |
|||
* local OS X install, R 3.3.1 |
|||
* Travis OS X (R 3.3.1 and oldrel) |
|||
* ubuntu 12.04 (on travis-ci), R 3.3.1 & oldrel |
|||
* win-builder (devel and release) (caught it today just before the crash) |
|||
* local OS X install, R 3.4.0 |
|||
* ubuntu 12.04 (on travis-ci), R 3.4.0 & oldrel |
|||
* win-builder (devel and release) |
|||
|
|||
## R CMD check results |
|||
|
|||
0 errors | 0 warnings | 1 note (new pkg) |
|||
|
|||
* This is a new release. |
|||
0 errors | 0 warnings | 1 note (maintainer & acronyms) |
|||
|
|||
## Reverse dependencies |
|||
|
|||
This is a new release, so there are no reverse dependencies. |
|||
None |
|||
|
|||
--- |
|||
|
|||
Added URL ref in DESCRIPTION per note from Kurt (#ty!) |
|||
* This is an update release to fix CRAN checks due to the crazy way purrr does dplyr ops. This pkg now Imports the necessary dplyr functions. |
|||
* Mis-spelled words aren't mis-spelled. Too many necessary acronyms to use "'" pairs. |
|||
|
Loading…
Reference in new issue