GNU Mailutils Manual (split by node):   Section:   Chapter:FastBack: Programs   Up: mailutils   FastForward: Libraries   Contents: Table of ContentsIndex: Function Index

3.20.15 mailutils imap

The mailutils imap command invokes an interactive IMAP4 client shell. It reads commands from the standard input, executes them and displays the results on the standard output. The shell is similar to the mailutils pop (see mailutils pop) shell.

IMAP protocol commands

Most commands in this group correspond (with minor differences) to IMAP commands described in RFC 35015.

imap command: connect [-tls] host [port]

Opens connection to the server host. If the -tls option is given, TLS encryption (also known as IMAPS protocol) will be used. If port argument is not supplied, the command uses port 143 for a plain IMAP connection or 993 for IMAPS (if -tls is given).

imap command: capability [-reread] [name...]

Lists server capabilities. Any number of names is accepted. If at least one is given, the shell will display only the named capabilities, otherwise it displays the entire list. By default, capability reuses the response of its previous invocation (if there was any), instead of resending the CAPABILITY command to the server. To force it do so, use the -reread option.

imap command: starttls

Starts TLS negotiation. This command is valid only after unencrypted connection has been successfully initiated using connect without the -tls option.

imap command: login user [password]

Logs in to the server as user with optional password. If the pass argument is omitted, the shell will ask you to enter it. While entering, both echoing and history recording will be disabled. Use this to avoid compromising your password.

imap command: logout
imap command: quit

Quits the imap session.

imap command: id [-test kw] [arg...]

Sends IMAP ID command. See RFC 29716, for a discussion of arguments. By default, this command outputs entire ID list. If, however, the -test option is given, it will check whether the keyword kw is defined and display its value if so.

imap command: check

Requests a server checkpoint.

imap command: select [mbox]

Selects the named mailbox. Without argument, selects ‘INBOX’.

imap command: examine [mbox]

Examines the named mailbox, i.e. selects it in read-only mode. If mbox is not given, ‘INBOX’ is assumed.

imap command: status mbox kw [kw...]

Gets mailbox status. Valid keywords (kw arguments) are: ‘MESSAGES’, ‘RECENT’, ‘UIDNEXT’, ‘UIDVALIDITY’, and ‘UNSEEN’. Keywords are case-insensitive.

imap command: fetch msgset items

Fetches message data. See RFC 3501, section 6.4.57, for a discussion of its arguments.

imap command: store msgset items

Alters mailbox data. See RFC 3501, section 6.4.68, for a discussion of its arguments.

imap command: close

Closes the currently selected mailbox (with expunge).

imap command: unselect

Closes the currently selected mailbox (without expunge).

imap command: delete mbox

Deletes the mailbox mbox.

imap command: rename old-name new-name

Renames existing mailbox old-name to new-name.

imap command: expunge

Permanently removes messages marked for deletion.

imap command: create name

Creates new mailbox with the given name.

imap command: append [-time datetime] [-flag flag] mailbox file

Reads an RFC-822 message from file and appends it to the mailbox. Use the -time option to supply envelope date for the message. Use the -flag option to supply message flags. For example:

append -time "25-Aug-2002 18:00:00 +0200" -flag \Seen INBOX input.msg
imap command: list ref mbox

Lists matching mailboxes. See RFC 3501, section 6.3.89, for a discussion of its arguments.

imap command: lsub ref mbox

Lists subscribed mailboxes (RFC 3501, section 6.3.910).

imap command: subscribe mbox

Subscribes to a mailbox.

imap command: unsubscribe mbox

Removes mailbox mbox from the subscription list.

imap command: noop

Sends a no operation command.

imap command: disconnect

Closes existing connection.

Internal commands

The imap shell implements the same set of internal commands as pop shell: See Internal commands. There is only one imap-specific internal command:

imap command: uid [on|off]

Controls the UID mode. When the UID mode is on, the commands fetch and store operate on and return message UIDs instead of their sequence numbers.

To examine the current state of the UID mode, issue the uid command without arguments.

Footnotes

(5)

See http://www.faqs.org/rfcs/rfc3501.html.

(6)

http://www.faqs.org/rfcs/rfc2971.html

(7)

http://tools.ietf.org/html/rfc3501#section-6.4.5

(8)

http://tools.ietf.org/html/rfc3501#section-6.4.6

(9)

http://tools.ietf.org/html/rfc3501#section-6.3.8

(10)

http://tools.ietf.org/html/rfc3501#section-6.3.9

GNU Mailutils Manual (split by node):   Section:   Chapter:FastBack: Programs   Up: mailutils   FastForward: Libraries   Contents: Table of ContentsIndex: Function Index