# Basic mail handling

## Mail folders

If you receive a lot of emails, you will probably soon find that your Inbox folder is growing to the point where you have a hard time finding an email again, even if you received it just a few days ago. This is why Claws Mail, like most good mail clients, provides you with multiple possibilities in organising your mails.

You can create as many folders and subfolders as you need. For example, one folder for your family, one folder for friends, folders for mailing-lists, archive folders for old mails that you still want to have available, etc. To create a new folder, simply right-click on its parent folder and choose New folder... from the drop-down menu. If you want to create a folder Friends inside your Inbox folder, for example, just right-click on the Inbox folder, choose New folder..., and type in Friends in the dialogue that appears. Click the OK button, and the new folder is created.

## Folder organisation

Now that you have created folders, you can manipulate them and their contents using menu items or drag 'n' drop. Moving one folder into another, for example, can be done by right-clicking on the folder you want to move, choosing the Move folder... menu item, and selecting the destination folder. This will move the folder, with the mail it contains, to a subfolder of the chosen folder. Alternatively, you can drag a folder to another one by clicking on it, keeping the mouse pressed, moving the mouse cursor over the destination folder and releasing the button.

If you want to remove a folder and the mail it contains, simply right-click on the folder and choose Delete folder.... As this is potentially harmful, (the mails in the folder will be deleted and not recoverable), you will be asked for confirmation.

In the same manner that you move a folder to another one, you can move emails from one folder to another. The same method applies for this: either drag 'n' drop emails to a folder, or choose Move... after right-clicking on the mail. You can select multiple emails by using the Control or Shift key while clicking on them. You can also copy emails to another folder by pressing the Control key when drag'n'dropping, or by choosing Copy... from the email's contextual menu.

## IMAP subscriptions

The IMAP protocol allows one to store a list of subscribed folders. Most mail user agents hide the unsubscribed folders away from the GUI, and have a little window allowing to subscribe to these unsubscribed folders. In Claws Mail, subscriptions are respected by default, and only subscribed folders will be displayed. If you want to see all your folders, you can just uncheck Show subscribed folders only in the IMAP mailbox' contextual menu or the account preferences. You'll be able to subscribe and unsubscribe folders from this contextual menu too. If the unsubscribed folders are hidden from the list, you will have two ways to subscribe to a folder: either show all folders, subscribe the ones you want, and hide unsubscribed folders again; or, if you know the folder's name, use Create new folder in its parent's contextual menu.

## Filtering

Once you have a nice folder hierarchy in place, you'll probably want Claws Mail to sort your incoming emails automatically, in order to avoid having to move messages manually each time they arrive. For this you can use the Filtering feature.

You will find the filtering preferences via the Configuration menu, Filtering item. From this dialogue you will be able to define new rules, modify or delete existing rules, re-order the rules, and enable/disable them. Filtering rules are defined by five things: the enabled status, a name, an account name, a condition, and an action. All disabled rules are simply ignored. The Name entry is optional, it's there to help you identify your rules. An account name can be chosen, which will restrict the rule to mail retrieved from the named account only, skipping it for mail retrieved from all other accounts. The default value is All, which means that the rule is global and will be applied to all mail, regardless of the account from which it was retrieved, (see paragraph below). The condition format is an expression defining what Claws Mail should look for when filtering mail, for example: to matchcase claws-mail-users is for messages sent to any address containing claws-mail-users. You can easily define conditions by clicking the Define... button at the right of the field. The last part of a filtering rule is the action, which instructs Claws Mail what to do with mail matching the condition we just defined. For example, mark_as_read marks the mail as read as soon as it arrives in your inbox, or move #mh/Mailbox/inbox/Friends moves the mail to your Friends subfolder. Here, too, a Define... button is available to help you define the action to take.

Filtering rules can be assigned to a single, specific account. To do this select an account from the Account combo below the Name entry. When you set a specific account the filtering rule will only be applied to messages retrieved from the named account. The default value is All, which means that the rule will be applied globally, to messages retrieved from any account. When filtering messages manually, if there are any per-account filtering rules defined, you will be asked what you wish to do with those rules. Possible choices are to skip the rules, or apply these rules regardless of the account to which they belong, or use the rules for the currently selected account. Caution: if you unset the Show this message next time checkbox and click Filter, on subsequent manual filtering this choice will be applied without any confirmation. Account specific rules are only available for filtering, (at incorporation or manually), the feature is not available for folder Processing or Pre/Post-Processing.

Once you have defined the rule, you can add it to the list of rules with the Add button. Don't forget that the order of the rules is important: if Claws Mail finds a rule suitable for an email that either moves or deletes the email, it will stop looking for further rules for that email. This is why, at the right of the rules list, you will find four buttons allowing the re-ordering of rules. The rules can also be reordered by drag 'n' drop.

There is also a quick method of creating filtering rules based on the selected message. After selecting a mail of the type you want to filter, choose Create filter rule... from the Tools menu, and choose a type from the submenu: Automatically mainly helps for mailing-lists posts, by From creates a filter based on the sender of the email, by To creates a filter based on the recipient, and by Subject creates a filter based on the subject. Each one of these types of filtering has its advantages, it's up to you to find out what would be the more practical. Usually, by From is nice to sort out your regular contacts' mails, whereas by To is more useful to sort mails sent to your different accounts.

## Searching

There are several methods for searching your emails.

One of them is relatively standard, and can be found in the Edit menu, it's the Search folder... item. This will open a window where you can specify one or more fields to search in: From, To, Subject, and Body. After having specified your criteria, click on the Back or Forward buttons to navigate through the matching emails, or use Find all to select all the matching emails at once. Be aware that searching for text in the body of emails is much slower than searching in its headers, because the body of emails isn't cached by Claws Mail. Extended Search mode can be turned on by clicking the relevant checkbox, thus allowing you to use match expressions like those used in Filtering rules.

If you're looking at a large email and want to find a particular part of it, you can use the Find in current message... item of the Edit menu. This works like search in a text document.

The final way of searching for emails is using Quick Search, which you can display or hide by clicking the little magnifying glass icon under the Message List. It is also accessible from the Quick Search item of the Edit menu. Quick Search is more powerful than the normal search as it can search in standard headers (From, To, Subject) or in Extended mode using just about any criteria you can think of. When in Extended mode, the Information button is visible, enabling you to see the search syntax. An Edit button is also available which allows you to quickly create a rule. You can also configure Quick Search to search recursively through subfolders, whether it should reset itself when you change folders, and whether to use Type-ahead search (this is a search which results update dynamically if you pause in the typing).

When you hit Enter after having specified the search string, the Message List will shrink to present you with only the matching messages. If you set the search to be recursive, any subfolder of the current one that has matching emails will change its icon to a magnifying glass icon. This way, you can search in your whole mailbox at once. If the search is in Sticky mode, the filter will stay applied when you go to another folder. This can be disturbing at first, as you can forget about it, but is useful in some cases, for example if you want to search in the body of emails and are not sure of which folder contains the searched email: a recursive search on the body of emails in a whole mailbox can be really slow.