Stores the deterministic corpus generated by sandbox_corpus in a mailbox, using the package's own IMAP operations: each message is uploaded with APPEND (ImapCon$append_msg()), a secondary folder is created with CREATE, and flags are set with STORE. It is meant to be run against the disposable local Docker IMAP server shipped in system.file("docker", package = "mRpostman") — see the "A reproducible IMAP sandbox with Docker" vignette — but works against any IMAP account (mind your provider's rate limits).

populate_sandbox(
  con,
  n = 200,
  seed = 3501,
  extra_folder = "ProjectAtlas",
  mute = FALSE
)

Arguments

con

An ImapCon object, as returned by configure_imap.

n

Number of messages to append to INBOX. Default is 200.

seed

An integer used as the RNG seed for sandbox_corpus. Default is 3501, after RFC 3501.

extra_folder

A string with the name of a secondary folder to be created and populated with every 10th message (for folder, COPY, and MOVE demonstrations), or NULL to skip it. Default is "ProjectAtlas".

mute

A logical. If FALSE, prints progress and a final summary. Default is FALSE.

Value

Invisibly, the info data.frame of the generated corpus (see sandbox_corpus).

Details

APPEND via libcurl stores messages with the \Seen flag (hardcoded in libcurl's IMAP module) and the current internal date, so flags are adjusted afterwards with ImapCon$add_flags() and ImapCon$remove_flags(). Internal-date searches (BEFORE/SINCE/ON, WITHIN) therefore only make sense relative to the population time; searches on fixed dates should use the SENT* variants, which read the Date: header — spread over the year 2020 in this corpus.

See also

Examples

if (FALSE) {
# against the local Docker sandbox (see the vignette):
con <- configure_imap(url = "imap://localhost:1430",
                      username = "testuser",
                      password = "sandbox",
                      use_ssl = FALSE)
info <- populate_sandbox(con, n = 200)
}