Downloads the public Enron e-mail corpus (CMU, May 7 2015
release; ~423 MB, one time, cached locally), selects a subset by
custodian, folder, and date, and ingests it into the connected IMAP
server through ingest_maildir -- i.e., through the
package's own APPEND implementation. One server folder is
created per custodian. It is meant to be run against the disposable
local Docker IMAP server shipped in
system.file("docker", package = "mRpostman"), providing real
data for demonstrations and teaching on top of the synthetic corpus of
sandbox_corpus.
enron_sandbox( con, custodians = c("kaminski-v", "lay-k", "skilling-j"), folder_pattern = "^_?sent(_items|_mail)?$", sent_since = NULL, sent_before = NULL, max_msgs = Inf, cache_dir = tools::R_user_dir("mRpostman", "cache"), url = "https://www.cs.cmu.edu/~enron/enron_mail_20150507.tar.gz", ask = TRUE, mute = FALSE )
| con | An |
|---|---|
| custodians | A character vector of custodian directory names, e.g.
|
| folder_pattern | A regular expression matched against the
custodians' folder names. The default,
|
| sent_since, sent_before | Optional |
| max_msgs | Maximum number of messages per custodian, applied after
the other filters. Default is |
| cache_dir | Directory where the corpus tarball and its extraction
are cached across sessions. Default is
|
| url | URL of the corpus tarball. Default is the CMU distribution point. |
| ask | A |
| mute | A |
Invisibly, a data.frame with one row per ingested message:
custodian, path (relative to the corpus root),
size, date (parsed from the header; NA when
unparseable), and appended.
The corpus was released into the public domain by the U.S.
Federal Energy Regulatory Commission and is curated at Carnegie Mellon
University (https://www.cs.cmu.edu/~enron/); it contains about
517,000 messages from 150 custodians in maildir layout, without
attachments. Nothing is downloaded when the cache is already in place.
If the download fails (offline use, moved URL), the function fails
gracefully with an informative message and leaves the cache untouched.
Date filtering parses each candidate file's Date: header
locale-independently; messages without a parseable date are kept unless
both limits are set.
Other sandbox:
ingest_maildir(),
populate_sandbox(),
sandbox_corpus()
if (FALSE) { con <- configure_imap(url = "imap://localhost:1430", username = "enron", password = "sandbox", use_ssl = FALSE) # sent mail of three central custodians, 2000-2002 manifest <- enron_sandbox(con, custodians = c("kaminski-v", "lay-k", "skilling-j"), sent_since = "2000-01-01", sent_before = "2002-07-01") table(manifest$custodian, manifest$appended) }