Learn R Programming

mRpostman (version 0.3.1)

rename_mailbox: Rename Mailbox

Description

Rename a mailbox.

Usage

rename_mailbox(imapconf, new_name, reselect_mbox = TRUE, 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.

new_name

A string containing the new name to be set.

reselect_mbox

If TRUE, calls select_mailbox(mbox = to_mbox) before returning the output. Default is FALSE for moving and copying operations, whereas it is TRUE for renaming mailboxes.

retries

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

Value

An (invisible) imaconf object with the newer selected mailbox added to it. If reselect_mbox is FALSE, it returns the imaconf object with the former mailbox name.

See Also

Other mailbox commands: examine_mailbox, list_mailboxes, list_server_capabilities, select_mailbox

Examples

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

# rename mailbox "Sent"
imapconf %>%
  select_mailbox(mbox = "Sent") %>%
  rename_mailbox(new_name = "Sent Mail")

# }

Run the code above in your browser using DataLab