The commands can be split into 3 different categories:

Account

add

Add a new mail account

Usage:

ion-mail account add

list

Alias: ls

Displays a list of all configured accounts. The currently active account (used by default for mail commands) will be highlighted.

Usage:

ion-mail account list

use

Sets the specified account as the default for all following mail and folder operations.

Arguments:

Usage:

ion-mail account use <ACCOUNT>

whoami

Shows details for the account currently in use, including the email address, display name, and connection settings.

Usage:

ion-mail account whoami

edit

Update specific details like the name or server. If no flags are provided, the currently active account will be edited.

Options:

Usage:

ion-mail account edit [OPTIONS]

logout

This command removes the account configuration from your local machine. This action is IRREVERSIBLE and does not delete the actual mail on the server.

Options:

Usage:

ion-mail account logout [OPTIONS]

Mail

send

Construct and send a new email

If required fields (to, subject, body) are missing from the flags, the application will prompt for them interactively.

Options:

Usage:

ion-mail mail send [OPTIONS]

read

This command fetches the entire message (sender, subject, body) from the server using the index number provided by the ‘folder view’ command.

Arguments:

Usage:

ion-mail mail read <FOLDER> <ID>

download

This command downloads all attachments into the save folder. If the attachment ID is set, only the attachments with this index will be downloaded.

Arguments:

Options:

Usage:

ion-mail mail download [OPTIONS] <FOLDER> <ID> <SAVE_FOLDER>

Search for messages matching a specific sender or query

This command performs a client-side search of your mail. It scans headers, subjects, and body content to find relevant matches.

Options:

Usage:

ion-mail mail search [OPTIONS] --query <QUERY>

move

This command transfers a specific email between folders on the server.

Arguments:

Options:

Usage:

ion-mail mail move [OPTIONS] <FROM> <TO>

delete

This command permanently deletes a message. This action cannot be undone.

Options:

Usage:

ion-mail mail delete [OPTIONS] --folder <FOLDER>

Folder

list

Alias: ls

Fetches the complete directory tree of your mailbox. This includes standard folders (INBOX, Sent, Trash) and any custom labels or subfolders you have created.

Options:

Note: Enabling this may take longer as the program must query the status of each folder individually.

Usage:

ion-mail folder list [OPTIONS]

view

This command retrieves the message infos (sender, subject, received date) from the requested folder and displays them in a list. It is the primary way to browse through your Mailboxes.

Arguments:

Options:

Usage:

ion-mail folder view [OPTIONS] <FOLDER>

create

This command adds a new mailbox to your account. You can create top-level folders or subfolders by using the server’s delimiter (usually a forward slash or a dot).

Arguments:

Options:

Usage:

ion-mail folder create [OPTIONS] <NAME>

delete

This action will delete the folder and, depending on your server configuration, may also delete all messages contained within it. This cannot be undone.

Arguments:

Options:

Usage:

ion-mail folder delete [OPTIONS] [NAME]...

empty

This command permanently removes every email inside the target folder while keeping the folder structure intact. This is commonly used to clear out ‘Trash’ or ‘Spam’ folders.

Arguments:

Usage:

ion-mail folder empty <NAME>