Fortinet white logo
Fortinet white logo

CLI Reference

maildir

maildir

Use these commands to archive old mail, rebuild mail folders and preference files.

Syntax

diagnose maildir status mailbox <user_email> <folder_name>

diagnose maildir archive mailbox <user_email> <folder_name> {<emails_int> | <date_str>} <archive-folder_name>

diagnose maildir rebuild preference <user_email> {no | yes}

diagnose maildir rename mailbox <user_email> <folder_name>

diagnose maildir rename user <user_name> <new-user_name> <protected-domain_name>

diagnose maildir reset folder-size archive <archive-account_name>

diagnose maildir reset folder-size quarantine

diagnose maildir reset folder-size mail <protected-domain_name> <user_name>

diagnose maildir reset quota-size <user_email>

diagnose maildir rebuild mailbox archive <archive-account_name> [<folder_name>]

diagnose maildir rebuild mailbox quarantine <system-quarantine-account_name> [<folder_name>]

diagnose maildir rebuild mailbox domain <protected-domain_name> [<folder_name>]

diagnose maildir rebuild mailbox user [<folder_name>]

Variable

Description

Default

{no | yes}

Select whether or not to overwrite any existing files.

<archive-account_name>

Enter the email archive account name.

<archive-folder_name>

Enter the name of a folder where FortiMail will move the archived email.

<date_str>

Enter a date such as 2025-05-22. Emails older than this date will be archived.

<emails_int>

Enter how many of the oldest email will be archived.

<folder_name>

Enter the name of a mail folder, such as Inbox or Trash.

If the folder name is optional, then the command affects all mail folders within the scope of the command.

<new-folder_name>

Enter the new name of the folder.

<new-user_name>

Enter the new name of the local part (username).

<protected-domain_name>

Enter the name of a protected domain, such as example.com.

<system-quarantine-account_name>

Enter the system quarantine account name.

<user_email>

Enter the email address of a user in a protected domain, such as user@example.com.

<user_name>

Enter the local part (username) of an email address in the protected domain.

Example

FortiMail # diagnose maildir status mailbox user@example.com Sent

System Time:  2025-05-23 14:12:26 EDT (Uptime: 15d 3h 9m)
3 emails exist in Sent

Related topics

cleanqueue

user-config

maildir

maildir

Use these commands to archive old mail, rebuild mail folders and preference files.

Syntax

diagnose maildir status mailbox <user_email> <folder_name>

diagnose maildir archive mailbox <user_email> <folder_name> {<emails_int> | <date_str>} <archive-folder_name>

diagnose maildir rebuild preference <user_email> {no | yes}

diagnose maildir rename mailbox <user_email> <folder_name>

diagnose maildir rename user <user_name> <new-user_name> <protected-domain_name>

diagnose maildir reset folder-size archive <archive-account_name>

diagnose maildir reset folder-size quarantine

diagnose maildir reset folder-size mail <protected-domain_name> <user_name>

diagnose maildir reset quota-size <user_email>

diagnose maildir rebuild mailbox archive <archive-account_name> [<folder_name>]

diagnose maildir rebuild mailbox quarantine <system-quarantine-account_name> [<folder_name>]

diagnose maildir rebuild mailbox domain <protected-domain_name> [<folder_name>]

diagnose maildir rebuild mailbox user [<folder_name>]

Variable

Description

Default

{no | yes}

Select whether or not to overwrite any existing files.

<archive-account_name>

Enter the email archive account name.

<archive-folder_name>

Enter the name of a folder where FortiMail will move the archived email.

<date_str>

Enter a date such as 2025-05-22. Emails older than this date will be archived.

<emails_int>

Enter how many of the oldest email will be archived.

<folder_name>

Enter the name of a mail folder, such as Inbox or Trash.

If the folder name is optional, then the command affects all mail folders within the scope of the command.

<new-folder_name>

Enter the new name of the folder.

<new-user_name>

Enter the new name of the local part (username).

<protected-domain_name>

Enter the name of a protected domain, such as example.com.

<system-quarantine-account_name>

Enter the system quarantine account name.

<user_email>

Enter the email address of a user in a protected domain, such as user@example.com.

<user_name>

Enter the local part (username) of an email address in the protected domain.

Example

FortiMail # diagnose maildir status mailbox user@example.com Sent

System Time:  2025-05-23 14:12:26 EDT (Uptime: 15d 3h 9m)
3 emails exist in Sent

Related topics

cleanqueue

user-config