Learn R Programming

mRpostman (version 0.3.1)

expunge: Expunge Messages

Description

Expunge a specific message (using specific UID) or all messages marked as "DELETED" in a mailbox.

Usage

expunge(imapconf, specific_UID = NULL, retries = 2)

Arguments

imapconf

An object of class imapconf generated with configure_imap and with a mbox item added after a mailbox selection with select_mailbox.

specific_UID

A numeric vector containing one or more messages UIDs, if specific messages should be expunged and not the whole mailbox.

retries

Number of attempts to connect and execute the command. Default is 2.

Value

The (invisible) imapconf object that was previously inputed.

See Also

Other miscellaneous: add_flags, copy_msg, count_msgs, delete_msg, get_max_id, get_min_id, move_msg, remove_flags, replace_flags

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# configure IMAP
library(mRpostman)
imapconf <- configure_imap(url="imaps://your.imap.server.com",
                           username="your_username",
                           password=rstudioapi::askForPassword()
                          )

# deleting a message using specific UID
result1 <- imapconf %>%
    select_mailbox(mbox = "TAM") %>%
    delete_msg(msg_id = 71171, by = "UID") %$%
    expunge(imapconf = imapconf, specific_UID = msg_id)


# expunge all message smarked as "DELETED" in INBOX
result2 <- imapconf %>%
    select_mailbox(mbox = "INBOX") %>%
    expunge()

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab