View source: R/ingest-maildir.R
| ingest_maildir | R Documentation |
Uploads every message file found under a local directory to a
folder on the connected IMAP server, using the package's own
APPEND implementation (ImapCon$append_msg()). Message files
are read as raw bytes and appended verbatim, so any RFC 5322-conformant
maildir-style layout (one message per file) can be ingested – mail
server backups, exported archives, or public corpora such as the Enron
corpus (see enron_sandbox).
ingest_maildir(
con,
path = NULL,
folder = basename(path),
create = TRUE,
recursive = TRUE,
files = NULL,
mute = FALSE,
retries = 1
)
con |
An |
path |
A string with the path to a local directory containing message files. |
folder |
A string with the name of the destination folder on the
server. Default is |
create |
A |
recursive |
A |
files |
An optional character vector of message file paths to ingest,
overriding the directory listing. When provided, |
mute |
A |
retries |
Number of attempts for each |
APPEND via libcurl stores messages with the \Seen
flag and the current internal date (see populate_sandbox
for the implications); header-based SENT* searches are therefore
the appropriate way to query ingested corpora by date. Files that fail
to upload (e.g., malformed messages rejected by the server) are skipped
with a warning rather than aborting the ingestion.
Invisibly, a data.frame with one row per message file:
path, size, and appended (a logical
indicating whether the upload succeeded).
Other sandbox:
enron_sandbox(),
populate_sandbox(),
sandbox_corpus()
## Not run:
con <- configure_imap(url = "imap://localhost:1430",
username = "testuser", password = "sandbox",
use_ssl = FALSE)
# upload a locally stored maildir folder to the server
manifest <- ingest_maildir(con, path = "~/backup/maildir/archive2020",
folder = "archive2020")
table(manifest$appended)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.