# Using &kmail;

## The Main Window

The main window is the window that appears when &kmail; is started. It is by default divided into three panes:

Folder list (on the left)

- Folder Pane Folder Pane

  Folder Pane

  This pane contains the list of your message folders (other email programs may call them mailboxes). To select a folder, simply click on it. The messages contained in the folder will now appear in the Headers pane. The folder list can be displayed in both a short view, which takes up only a small portion of the left side of the screen, and a long view, which takes up the entire left side of the screen but is able to show more mailboxes. You can toggle between these two views under Appearance/Layout in the Settings Configure &kmail;... dialog. The top section of the folder pane contains quick links to your favorite folders. Add folders here through the &RMB; context menu Add to Favorite Folders. Please see the Folders Section for detailed information about how to use folders.

Message list (in the upper right by default)

- Message List with Message View Message List and Message View

  Message List and Message View

  This pane lists header information (message Status Flags, Sender, Subject, Date, and other optional columns like Size, Attachment Flag, Important Flag, etc.) for the messages in the currently selected folder. Clicking on a header will select that message and display it in the Message pane; you can also select more than one message by holding down the &Ctrl; key when clicking on messages. Change the view of your message list by selecting View Message List Theme. You have several options here.

  - Classic A simple, backward compatible, single row with clickable sort columns.

  - Smart A smart multi-line, multi-item with status icons, no sort columns.

  - Smart with clickable status A smart multi-line, multi-item, status icons and clickable sort icons.

  - Configure... Allows you to customize your own Message List Theme ⪚ add or remove columns from the clickable sort bar.

  If you have chosen a theme with a clickable status, you may sort the messages by clicking on the column that you wish to sort; if you click on the same column more than once, sort order will toggle between ascending/descending and some alternative sorting criteria will become available (like sorting by Status when you click on the header of the Subject column). Clicking the &RMB; on the list header shows a pop up menu, which allows you to show or hide several columns in the list. You can customize the columns visible on the sort bar, see Configure Appearance Message List for details.

Message preview pane (in the lower right by default)

- This pane displays the currently selected message. Below you will find options to adjust the reader window to your preference.

  The top of the reader window contains various header options. Go to View Headers and try them out until you find one you like! Details for the various headers are as follows:

  - Enterprise Headers A minimal header with title, From, and To, with a graphical design.

  - Fancy Headers Minimal header with a spam status notification.

  - Brief Headers Title, and in parentheses you will find From and the date.

  - Standard Headers Title, From, and To.

  - Long Headers Title, Date, From, and To.

  - All Headers List everything you ever wanted to know about the email, including every server it went through, virus/spam scanners it went through, &etc;

  - Custom Headers See Message Window configuration Headers: to set up custom headers that can be selected here.

  - Example An example header from the Download New Themes....

  - Example Fancy An example fancy header from the Download New Themes....

  - Download New Themes... Allows you to download custom themes created by other &kmail; users.

  If you prefer to view your email in &HTML; format instead of plain text (Default) click on the bar located on the left hand side of the pane. The text on the bar will inform you which view you are in. If this bar is missing you can enable it in the Settings Configure &kmail;... dialog, from there you want the Message Window tab, and select Show &HTML; status bar.

  If you would like to change how your attachments appear in your messages, go to View Attachments. Your options are as follows:

  - As Icons, all attachments appear as icons at the bottom of the message.

  - Smart will show attachments as icons, unless the message suggests that they should be displayed inline. You can suggest that certain attachments should be shown inline in your own messages when you select Suggest automatic display in the attachment's properties dialog.

  - Inline shows the contents of the attachments at the bottom of the message. Attachments that cannot be displayed, ⪚ compressed files, will still be shown as an icon.

  - Hide will not show attachments.

  For complex messages you can show the structure of the message by selecting View Show Message Structure, this will show in the message structure viewer below the preview pane.

  You can scroll through the message page-by-page using the Page Up and Page Down keys, or line-by-line using the Up arrow and Down arrow keys; you can also use keyboard shortcuts to skip through your messages without having to use the mouse.

## Keyboard Shortcuts

The following keyboard shortcuts are supported in the main window:

Keyboard Shortcut | Action
Space | Scroll down in the current message or go to the next unread message if you are already at the bottom.
Right Arrow or N | Go to the next message in the current folder and display the message preview.
Left Arrow key or P | Go to the previous message in the current folder and display the message preview.
&Alt;Right Arrow | Scroll down the message list in the current folder, the message preview does not change.
&Alt;Left Arrow | Scroll up the message list in the current folder, the message preview does not change.
+ | Go to the next unread message in the current folder.
- | Go to the previous unread message in the current folder.
&Ctrl;+ | Go to the next folder with unread messages.
&Ctrl;- | Go to the previous folder with unread messages.
&Alt;Up Arrow | Go to the next folder in the folder list (if the folder list has focus.)
&Alt;Down Arrow | Go to the previous folder in the folder list (if the folder list has focus.)
&Ctrl;Left Arrow | Focus on previous folder. Use &Ctrl;Space to actually enter the folder.
&Ctrl;Right Arrow | Focus on next folder. Use &Ctrl;Space to actually enter the folder.
&Ctrl;Space | Enter the folder that has focus, &ie; the folder that you navigated to using &Ctrl;Left Arrow or &Ctrl;Right Arrow.
&Shift;Left Arrow and &Shift;Right Arrow | Select messages in the header pane, starting with the current message.

For more keyboard shortcuts have a look at the Settings Configure Shortcuts... dialog.

## The Composer Window

The composer window is used to write new, reply, and forward messages; it can be invoked in several ways. Here you will find the various options to composing messages.

### Composing a Message

New Message...

- The New Message composer window can be invoked the following ways:

  - File New New Message...

  - Message New Message...

  - The New icon on the main toolbar.

  To write your message, fill in the appropriate fields in the composer window. Use the View menu to select which header fields are displayed. Some field options offer a Sticky checkbox, that if checked, your selection will remain as the default when you open a new composer window. The following list describes the various headers.

  - The Identity drop down box allows you to select an identity to use.

  - The Dictionary drop down box allows you to choose your dictionary of choice for use with spellchecking.

  - The Sent-Mail folder allows you to change the location to save sent emails.

  - The Mail transport allows you to select the outgoing mail server you would like to use.

  - Your traditional From:, Reply To:, To:, and Subject: fields.

  - The Use Fixed Font allows you to toggle fixed fonts on and off.

  - The Snippets allows you to show the snippets window to store and use often used parts of text.

  - The Translator allows you to translate your text within the composer window.

  There are a variety of shortcuts to help you with writing your messages. The Select... buttons next to the To:, CC:, and BCC: fields will call up the address book so that you can select addresses from there.

  When you start typing an address in the To:/CC:/BCC: fields, a popup will appear that offers matching addresses that have been used recently and matching addresses from your address book; if you do not like the automatic popup you can disable it by clicking with the &RMB; on the field and choosing a different completion mode.

  Whenever you want to add more than one recipient in one of the fields, use a comma to separate each address from the next one. You may need to specify fully qualified addresses (&ie; `user@example.com`) even for local users, depending on your system configuration.

  When you are finished with your message, you click the Send icon (the envelope) to send the message now, or click the Queue icon to put the message in the outbox. If your message is not finished yet, select Message Save as Draft to save for later editing. If you would like to print your message, select Message Print Preview to preview the message, and Message Print to print it.

  Message Send Later allows you to schedule your emails to send at a specific date and time. Please see Send Later Agent for details.

File New Message From Template `My Super Template`

- Compose a new Message from Template is useful if you have created a masterpiece message that you would like to save as a template for use in future new messages. Select Message Save as Template and this will place your new template in the templates: folder. You can revise the template at anytime by selecting it in this folder. The saved template will now be listed under this menu to use for new messages. Please see Compose New Message for further details on composing a message.

### Signing and Encrypting Messages

If you want to send an encrypted or digitally signed message, select the Sign Message or Encrypt Message icons in the toolbar. Moreover you can select the format that should be used to sign and/or encrypt the message. Depending on the installed encryption programs you can choose between:

Any

- &kmail; will use a format which is understood by all recipients of the message. The preferred format of the recipients can be specified in the &kde; Address Book.

Inline OpenPGP (deprecated)

- This format is outdated. If you use this format then only the message text will be signed and/or encrypted. Attachments will neither be signed nor encrypted. &HTML; messages cannot be signed with this format. You should only use this format if necessary, &ie; if you send messages to users of email clients that cannot handle the more advanced formats.

OpenPGP/&MIME;

- This format is the successor of the inline OpenPGP format. If you use this format then the message text and all attachments will be signed and/or encrypted (at least by default). This is the recommended format if you use OpenPGP.

S/&MIME;

- This format is an alternative format to OpenPGP/&MIME;. If you use this format then the message text and all attachments will be signed and/or encrypted (at least by default). This format is mostly used by corporations.

S/&MIME; opaque

- This format is a variant of the S/&MIME; format. It should only be used if necessary.

### Creating &HTML; Messages

Note that &HTML; messages are often regarded as an annoyance; therefore, you should avoid sending &HTML; messages if possible. Particularly, you should never send &HTML; messages to a mailing list unless &HTML; messages are explicitly allowed.

In order to be able to create &HTML; messages you first have to enable the markup tools. To do this enable Rich text editing in the Options menu. A toolbar with several tools to format the message will appear. Via the drop down box you can select between standard text and six different types of lists (three bulleted lists with different symbols and three numbered lists with different numbering). Moreover, you can select the font family, the font size, the font style (bold, italic, underlined) and the text color. Last but not least, you can select the alignment of the text (left aligned, centered, right aligned).

Creating tables and embedding images is currently not possible.

### Adding Attachments

You can attach files to your message by using one of the methods below:

- Click the Attach File (paper clip) icon and select the file you wish to attach;

- Drag a file from the desktop or another folder into the composer window;

- Drag a message from &kmail;'s message list into the composer window -- that message will then be attached;

- Select one of the options in the Attach menu.

- Select Message Insert Recent text file.

Once a file is attached to your message, it appears in the attachments pane at the bottom of the composer window. You can use the &RMB; on each attachment to Open, View, Save As... or Remove the attachment.

Use the Properties item to open the Message Part Properties dialog. The first field contains the attachment's &MIME; type. Just like the Name field, it should be automatically filled with an appropriate value. Sometimes the &MIME; type value may be wrong. You can then type in any &MIME; type or choose from the list of common &MIME; types. You can also select an encoding method for your file from the list of encoding options (normally, the default value works fine). Check the Suggest automatic display option if you want to suggest to the recipient the automatic (inline) display of this attachment. Whether this works or not depends on the recipient's email client and on his settings.

You can also attach public keys to the message by using the appropriate options in the Attach menu. GnuPG key attachments are handled like file attachments.

### Checking the Spelling of your Message

&kmail; will automatically check the spelling of your message (in &HTML; mode this currently does not work) and display unknown words using red color. If there are too many unknown words &kmail; will disable its checking. To select the language used for checking, select View Dictionary. You can disable automatic spellchecking in the Options menu.

If you need to write mails in different languages, enable the Dictionary drop down box with View Dictionary from the menu. Using this drop down box allows you to change the spellchecker's language with one mouse click.

To check the spelling of your message using a dialog, select Tools Spelling.... &kmail; uses &sonnet; to check spelling, which is the &kde; frontend to the ispell or aspell spelling checker. Note that you may first need to configure the spellchecker using Settings Spellchecker....

### Setting Up the Text Snippets Tool

When editing in the composer window you can store often used parts of text as snippets. To configure the capabilities of the mail snippets part select View Snippets from the menubar. A new panel will appear on the right side of the composer.

To add a new snippet to Snippet Panel, right click on panel, click on Add Snippet in the context menu. A snippet editor dialog will appear, in which new text can be added and the snippet can be given a name. Also a Shortcut can be associated with the snippet. Snippets can be grouped together as well by creating groups and adding snippets to a particular group. If you want to view the stored text in a tooltip window keep the mouse cursor over the title of that snippet.

The Snippets tool allows for a variable text in predefined places any time you insert a snippet into a file. To accomplish this Snippets provides its own variables mechanism. You can insert variables in the snippet text itself by using separators ( $ ) that enclose the variable names. For example: $variablename$, $invoicenumber$, $weekno$.

The variable separator can be changed to another character by changing `snippetDelimiter` in the [SnippetPart] section in the Text Snippet configuration file, which can be found at $KDEHOME/share/config/kmailsnippetrc .

    snippetDelimiter=$

### Using the Built-in Translator

&kmail; 2 composer provides a built-in translator that can be accessed by selecting View Translator from the menubar. A new panel will appear at the bottom of the composer.

To translate a section of text, first select the text you would like translated to the box with the Drag text that you want to translate.. Select the language it currently is, in the From: drop down box. Select the language you would like to translate to in the To: drop down box, and click the Translate button. Your translated text will appear in the next box. If you need to translate in the other direction you can just click the Invert button. To clear all text, click the Clear button.

## Message Folders

Folder Setup Example Folder Setup Example

Folder Setup Example

Message Folders are used to organize your email messages. When you first start &kmail; the Local Folders containing inbox, outbox, sent-mail, trash, drafts and templates folders are created. These folders each have special functions:

inbox:

- Where &kmail; by default puts your new messages when you ask it to check your mail.

  &imap; accounts will not use this inbox. The inbox is located on the &imap; server.

outbox:

- Where messages are put while they are waiting to be delivered. Note that you should not drag and drop messages here to send them, use the Send icon in the composer window instead.

sent-mail:

- By default copies of all messages that you have sent are put into this folder.

trash:

- By default all messages that you have moved to trash are moved into this folder.

drafts:

- Contains messages you started to edit but then saved to this folder through Message Save as Draft.

templates:

- This folder holds your templates created via Message Save as Template in the composer window. Please see New Composer Templates for details.

### Creating and Using Folders

Organize your emails, ⪚ by mailing lists, bill receipts &etc;, by creating new folders. To create a new folder, select Folder Add Folder... or Add Folder... from the &RMB; context menu. A dialog will pop up, enter the name of the new folder in the text box. You can fully customize each folder ⪚ views, replies, &etc; in the properties for a folder by selecting the folder you wish to modify in the folders pane and select Folder Properties from the &RMB; context menu. See Properties of Folder for details.

To move messages from one folder into another, select the message(s) you want to move and press the M key or select Message Move Messages To. A list of folders will appear; select the folder from the list that you want to move the messages to. Messages can also be moved by dragging them from the Message list to a folder in the Folder list.

If you have folders that are frequently accessed, you can add them to your favorite folders pane in the upper left corner. Add them through the &RMB; context menu Add to Favorite Folders.

You can create a virtual folder with search parameters by going to either Edit Find Messages..., Tools Find Messages..., or Keyboard shortcut S. Enter your search parameters into the dialog. Name your search at the bottom Search folder name: textbox, ⪚ `emails with the word Blog`. Click the Search button. Now select the Open Search Folder. Your results folder will be at the bottom of the Folder pane.

Creating filters to automatically move messages to specified folders is a great way to organize messages by mailing list, sender, subject &etc; Please see Filters for details.

In the case that you receive emails from a trusted source, ⪚ a Blog you signed up for, that is formatted in &HTML; and you would like to enable &HTML; view for just those emails. You can achieve this by doing the following: Create a new folder, set up a filter to place those emails in the new folder, select the folder and select Folder Message Default Format Prefer &HTML; to Plain Text.

Some common folder actions are:

Folder Move All Messages to Trash

- Moves all your messages in the selected folder to the trash folder.

Folder Archive Folder

- Create an archive of the folder. See Archive Folder for details.

Folder Delete Folder

- Remove a folder with all its messages and sub-folders.

Folder Remove Duplicate Messages

- This will search the currently selected folder for duplicates and delete them.

### Folder Properties

Folder Properties Example Folder Properties Example

Folder Properties Example

The Properties of Folder dialog lets you rename and specify all of its properties. Note that most properties are only available for your own folders and not for default folder like inbox &etc; Default folders also cannot be renamed.

#### General

If you need to rename a folder change the entry in the Name: field.

Act on new/unread mail in this folder is enabled by default on new folders, it allows notifications about new mail that arrives in the folder. Uncheck this option on folders like SPAM and trash that you do not desire notifications.

When replying to messages in this folder, check Keep replies in this folder if you want the replies to be stored in this folder rather than into the default configured sent-mail folder.

Check Hide this folder in the folder selection dialog if you do not want this folder to be shown in folder selection dialogs, such as the Jump to Folder and Move Message to dialogs.

By default new folders use the default identity. Uncheck Use default identity and select a new one from the Sender identity drop down menu. See Identities configuration for information on Identities. Replies to messages that were sent directly to you will still default to the message's To address if an according identity is found.

If you have groupware, you can change the contents ⪚ calendar, notes, &etc; of the folder in the Folder contents: drop down box.

If you share the folder with other users, you can Share unread state with all users which will show the same unread state for all users.

For example, a ticket system that all emails must be read and multiple users are responsible for reading unread tickets.

#### View

The Use custom icons option lets you choose icons that are different from the default ones in the folder list.

With Show column drop down you can set the visible columns in the header pane to Default, Sender, or Receiver. This is useful if you use a folder to save your own sent messages.

In the Message List section you can select and configure an Aggregation and Theme for this folder different from the default configured in &kmail;s settings. For more details see the Message List tab in the Appearance page.

#### Retrieval

If you have an account that does not receive much mail and you don't want &kmail; to query the server as often, you can uncheck Use options from parent folder or account to set a higher interval in Automatically synchronize after: spin box.

In Retrieval Options you can change Always retrieve full messages option to Retrieve message bodies on demand if you have a slow connection. You can set how long the message will remain locally in the following spin box.

#### Templates

On this tab you can define folder-specific templates for your custom folders. For more details see the Standard Templates tab in the Composer page

#### Expiry

You can set automatic cleanup or deletion of emails in this tab. Check the box if you would like to automatically expire read or unread messages respectively. Set the amount of days in the spinbox. If you do not want to permanently delete the messages you can assign a folder to move them to in Move expired messages to: textbox or folder selection dialog. Once you have reviewed the messages and want to permanently delete them, you can go to the folder expiry options of the folder you chose to move them to and set the option Delete expired messages permanently, then click the Save Settings and Expire Now.

Messages that are deleted during expiration of old messages cannot be restored, so be careful with this setting.

#### Access Control tab (&imap; only)

Here you can manage the access control lists (&acl;s) of &imap; folders.

The &imap; server must have user level &acl; configured and enabled for this tab to be visible.

The currently active &acl; is shown in the list. It consists of pairs of User Ids and the Permissions granted to users identified by that User Id.

Note that a single User Id might refer to more than one user. Depending on the &imap; server and its configuration, there may be User Ids that correspond to groups of users, anonymous users, or any user. Consult the manual of your specific &imap; server implementation for more information.

&acl;s are settable per-folder.

As with everything else when using disconnected &imap;, you need to sync with the server for the changes to be transferred to the server.

&imap; &acl;s define a lot of fine-grained permissions that you can grant or deny other users. For the sake of clarity, &kmail; will present them as the following five categories that you can choose from (see table-acl-summary for the details if you already know &imap; &acl;s).

None

- Grants the users identified by User Id no rights at all. This is also the default for users not explicitly (or implicitly, as a group) listed in the &acl;. These users will not see this folder in the list of &imap; folders presented to them by their mail clients.

Read

- Grants the users identified by User Id reading rights for this folder. This also includes the ability for their mail clients to mark mails as read and store this information on the server.

  Every user has their own list of read mail, so none of your unread mails will suddenly be marked as read just because someone else has already read them.

  These users will see this folder in the list of &imap; folders presented to them by their mail clients.

  Use this to create a shared folder that others can read, but not modify.

  If you were the editor of a company's news letter, you could create a folder for the purpose of distributing the news letter, grant everyone reading rights, and save the letter to this folder instead of sending it out by email to a catch-all address.

Append

- (also known as Post)

  Grants the users identified by User Id reading (see above) and posting rights for this folder.

  Use this to create a shared folder that others can read and post messages to, but cannot otherwise modify.

  If you wanted to create a company-wide discussion forum, instead of using a web-based form or a separate company-private usenet server, you could create a bunch of folders (one per topic), and grant everyone reading and posting rights. Instead of posting to an &nntp; server or writing their messages into a web form, people would just write emails and store them in the folder suiting the topic of the message.

Write

- Grants the users identified by User Id reading, posting (see above), and writing rights for this folder.

  The right to write to a folder includes deleting of messages, creating subfolders, and storing other attributes than read/unread on the server (⪚ answered).

  Use this to create a shared folder that everyone has (almost, see folders-properties-acl-all) the same rights for.

  In the folders-properties-acl-append example, you could assign write rights to a group of people acting as moderators, which would then be able to remove off-topic posts, and create sub-topic-folders for high-traffic folders.

All

- Grants the users identified by User Id reading, posting, writing (see above), as well as administration rights, &ie; the right to modify the &acl; of this folder.

  This is the default set of rights for the owner of a folder.

table-acl-summary summarizes the &imap; &acl; rights associated with each permission level.

#### &acl; Rights Summary

&acl; right | folders-properties-acl-none | folders-properties-acl-read | folders-properties-acl-append | folders-properties-acl-write | folders-properties-acl-all
Lookup |  | x | x | x | x
Read |  | x | x | x | x
Store Seen |  | x | x | x | x
Insert |  |  | x | x | x
Post |  |  | x | x | x
Write Flags |  |  |  | x | x
Create |  |  |  | x | x
Delete |  |  |  | x | x
Administer |  |  |  |  | x

#### Mailing List

If you are going to use the folder for a mailing list open the Mailinglist Folder Properties dialog with Folder Mailing List Management from the menu. Then you should check Folder holds a mailing list to associate this folder with the mailing list. Next you should click on Detect Automatically. &kmail; will then try to guess some information about the mailing list from the currently selected message. If &kmail; could not determine some addresses then you can add the missing information manually. To do this first select the Address type for which you want to add an address. You can choose between:

Post to List

- This address is used for sending messages to the mailing list. This is usually an email address.

Subscribe to List

- This address is used for subscribing to the mailing list. This can be an email address or the address of a web page.

Unsubscribe From List

- This address is used for unsubscribing from the mailing list. This can be an email address or the address of a web page.

List Archives

- This is the address of the archive of the mailing list. This is usually the address of a web page.

List Help

- This address is used for requesting help for this mailing list. This is usually an email address.

After selecting the appropriate Address type you enter the email address or the address of the web page and then click on Add. With Remove you can remove addresses.

If all addresses have been added then you can execute an action, ⪚ go to the list archives, by selecting the appropriate Address type and then clicking on Invoke Handler. If there is an email address and an address of a web page for the desired action then you will have to select the Preferred handler prior to clicking on Invoke Handler. Select KMail if you want to send a message to the email address and select Browser if you want to go to the web page.

Alternatively to invoking the handler for Post to List you can send a new message to the mailing list via Message New Message to Mailing-List...

#### Shortcut

You can define a keyboard shortcut to access the folder.

#### Maintenance

This tab shows an overview about the folder type and its size, the number of read and unread messages in the folder and allows you to enable text indexing.

## Message Filters

After using &kmail; for a while, you may find that you have trouble sorting out the new messages in your inbox when they arrive. Filters allow you to automatically perform certain actions on incoming messages and to manually perform actions on selected messages in a folder.

Filters consist of: filter criteria, whose rules are used as criteria to determine whether this filter should be applied to a given message; and a list of filter actions, which describe what is to be done with, or to, the message if the search pattern matches. Read more about filter criteria and filter actions in the following subsections.

Filters are considered one after the other, starting with the first filter in the list. The first one whose pattern matches the given message gets executed; you can request that the remaining filters also be applied, but the default is to stop processing at the first matching filter.

Usually, filters are used on incoming messages, but they can also be applied to sent messages or to an arbitrary message or group of messages. To selectively filter messages, select the messages you want to filter in the message list and either type &Ctrl;J or select Message Apply Filter: this will apply all filters that have been marked for manual filtering in the filter dialog to those messages.

### Fast Filter Creation

There are two methods for creating a filter; the quick method is to use Message Create Filter and select a criteria from the submenu: this will call the filter dialog and present you with a new filter which has the first rule of the search pattern and the first action (as Move into Folder) preset. In most cases, all you have to do is select the folder where the message should be moved to; but you can, of course, edit the filter as you like.

When creating a filter on mailing list messages this method will try really hard to find a criterion that uniquely identifies messages from that list; If it succeeds, the guessed name of the list is presented in the Message Create Filter Filter on Mailing-List... menu entry.

The second method is to manually construct a filter from scratch by calling the filter dialog through Settings Configure Filters.... The filter dialog is described in detail in the following subsection.

### The Filter Dialog

This dialog allows you to manage and edit your list of filters.

You can reach it either via Message Create Filter or Settings Configure Filters....

The dialog is divided into three main sections on the General and Advanced tab:

Available Filters

- This group contains the list of filters and some action buttons to modify the filters, namely: to create new filters; to move them up or down the list; to delete them; or to rename them. If you select a filter from the list, its properties are shown in the right-hand half of the dialog.

Filter Criteria

- In this group you can edit the pattern that messages must match for the filter to be applied to them. You can select here whether all of the defined rules must match or whether it suffices that any one of them matches. See Search Patterns below for a detailed description of each search rule type.

  You can click on More to get an additional (initially empty) rule if you want to define more-complex patterns and on Fewer to remove the last rule. Clear clears the pattern, &ie; it removes all but two rules from screen and resets those two.

  Invalid or empty rules are not evaluated.

Filter Actions

- In this group you can edit the list of actions that are applied to all messages that match the defined filter criteria. See Filter Actions below for a detailed description of each action type.

  You can click on More to get a new, empty action (if you want to define more than one action) and on Fewer to remove the last action. Clear clears the list, &ie; it removes all but one action and resets that one.

  Invalid or empty actions are not executed.

Advanced Options

- In this group you can define a few advanced options for filters that allow you to refine your filtering.

  Using the first row of check boxes, you can toggle when the filter is applied: the Apply this filter to incoming messages option means that the filter is applied to messages when you receive them (&ie; on Check Mail). The filter can be applied to all messages, to all but online IMAP accounts and to a selection of incoming folders.

  The Apply this filter to sent messages option means that the filter is applied to messages when you send them and the Apply this filter on manual filtering option controls whether to apply this filter when filtering is specifically selected (&ie; via Message Apply Filters.)

  If Apply this filter to sent messages is checked the filter will be triggered after the message is sent and it will only affect the local copy of the message. If the recipient's copy also needs to be modified, please use Apply this filter before sending messages.

  The If this filter matches, stop processing here check box controls whether or not the filters after the current filter will be applied, if the current filter matches.

  If the Add this filter to the Apply Filter menu check box is selected, this filter will be inserted in the Message Apply Filter submenu. You can then apply this filter to a message. Another way of applying filters is to use Message Apply Filters menu option, which applies all the filters - one after another until they are all used or one of the filters that matches has the If the filters matches, stop processing here.

Filters are automatically named unless you explicitly rename them using the Rename... button. The dialog assumes that it should continue auto-naming the filter as long as the filter name starts with <.

If you apply filter changes, via OK or Apply, only valid filters are actually copied to the internal filter manager.

Similarly, empty rules and actions are removed from the pattern and action list respectively, before the filter is saved.

### Search Patterns

The most common use of filters is to filter on the sender of messages; this can be done by choosing From. A good bet for a mailing list would be <recipients>, but there are other criteria a filter can search for (note that all patterns are interpreted case-insensitively):

<message>

- Searches the whole message (&ie; headers, body and attachments, if any);

<body>

- Searches the body of the message (&ie; the whole message except the headers);

<any header>

- Searches the headers of the message;

<recipients>

- Searches the To and CC header fields of the message;

<size in bytes>

- Sets upper or lower bounds on the message size;

<age in days>

- Sets upper or lower bounds on the message age;

<status>

- Sets restrictions on the status of the message;

Any other name

- Searches the header field that is given by that name.

The list of possible rules depends on what you selected in the first drop down box. The available rules are:

Rule | Available for | Description
contains/does not contain | all textual search items | Matches if the searched item contains (or does not contain) the given text.
equals/does not equal | most textual search items | Matches if the searched item is equal to (or not equal to) the given text.
matches regular expr./does not match reg. expr. | all textual search items | Matches if a part of the searched item matches the given regular expression (or does not match it). If the regular expression editor is installed then you can edit the regular expression by clicking on the Edit... button.
has an attachment/has no attachment | <message> | Matches if the message has an attachment (or does not have an attachment).
is in address book/is not in address book | most textual search items | Matches if the searched item contains an address that is in your address book (or if the searched items contains only unknown addresses). Of course, this rule only makes sense for address fields like From or <recipients>
is in category/is not in category | most textual search items | Matches if the searched item contains an address that is in the specified category in your address book (or if the searched item contains no address that is in the specified category). Again, this rule only makes sense for address fields.
is equal to/is not equal to | numerical search items | Matches if the value of the search item is equal to (or not equal to) the specified value.
is less than | numerical search items | Matches if the value of the search item is less than the specified value.
is greater than | numerical search items | Matches if the value of the search item is greater than the specified value.
is less than or equal to | numerical search items | Matches if the value of the search item is less than or equal to the specified value.
is greater than or equal to | numerical search items | Matches if the value of the search item is greater than or equal to the specified value.
is/is not | <status> | Matches if the message has (or does not have) the specified status.

### Filter Action

The most common use of filters is to sort incoming messages to certain folders; this can be done by choosing Move into Folder. Here is a list of all possible actions:

Move Into Folder

- This will file the message into another folder, removing it from its current folder if necessary; you cannot, currently use &imap; folders as a target.

Copy Into Folder

- This will copy the message to another folder.

  You currently cannot use &imap; folders as a target.

Set Identity To

- This will set the identity that will be used if you reply to this message.

Mark As

- This allows you to mark the message as read or important (flagged), but also as forwarded, replied, &etc;

Send Fake MDN

- This will send a faked message disposition notification (&ie; a read receipt) to the sender of the message.

Set Transport To

- This will set the method of transport (⪚ &SMTP;) that will be used if you reply to the message.

Set Reply-To To

- This will modify the Reply-To field of this message. This can be useful for mailing lists that automatically set a Reply-To which you do not like.

Forward To

- This will forward the message inline (&ie; as if you selected Message Forward Inline...) to another email address. You can select the template to be used when forwarding with this filter with the drop down list.

Redirect To

- This will redirect the message as-is to another email address.

Confirm Delivery

- Will try to return a message to the sender that indicates successful delivery of their message, if the sender requested that.

  This action allows you to select who will get delivery receipts from you. Though you can globally enable the sending of delivery confirmations in the Configure &kmail;... dialog (Security page) we recommended not to send them to everyone, since this makes tracking of spam messages, for example, very easy for the sender.

Execute Command

- This will execute a program, but will not modify the message. Specify the full path to the program you want to execute; &kmail; will then block until the program returns. If you do not want &kmail; to block then append '&' to the command. You can feed the program with the parts of the mail: %0, %1, &etc; stand for files representing the message parts; for common messages %0 is the text, %1 the first attachment and so on. Additionally, the whole message is fed into the program's stdin; and every occurrence of %{foo} is replaced by the content of the foo header. If you need to identify the message via its storage location in the Akonadi store, you can use the %{itemid} or %{itemurl} placeholders to achieve that.

  This currently only works if the message has at least one attachment. No, not even %0 will work in the general case!

  You can enter arbitrarily-complex shell commands here, since &kmail; uses a sub shell to execute the command line; therefore, even this command will work (within its limits): ``uudecode` `-o` `$(mktemp kmail-uudecoded.XXXXXX)` && `echo` `$'\a'``

Pipe Through

- This will feed the message to a program: if the program returns output, the entire message (including the headers) will be replaced with this output; if the program does not return output or exits with a return code other than 0 (indicating an error occurred), the message will not change. Specify the full path to the program. The same substitutions (%n, %{foo} as with execute command are performed on the command line.

  Be cautious with this action, as it will easily mess up your messages if the filter program returns garbage or extra lines.

Remove Header

- Will remove all header fields with the given name from the message. This is useful mainly for removing bogus Reply-To: headers.

Add Header

- If no such field is already present this will add a new header field with the given name and value to the message; if there already is a header field with that name, it is overwritten with the given value; if there are already multiple headers with the given name (⪚ Received: headers), an arbitrary one of them is overwritten and the others are left unchanged -- this is a known limitation. You may want to combine this filter with the remove header filter above to make sure that there are no other headers with that name in the message.

Rewrite Header

- Will scan the given header field, modify its contents and write it back. The search string is always interpreted as a case-sensitive regular expression. The replacement string is inserted literally except for occurrences of `\n`, `$n` and `${nn}`, where `n` is a positive (single-digit, except for the third form) number or `0`. These constructs are interpreted as back references to substrings captured with parentheses in the search string.

  Analogous restrictions as in the add header action apply here, too.

Play Sound

- Will play the specified sound.

### Filter Examples

As of yet &kmail; does not highlight or mark mails that have an extra `Priority:` header. If I want to flag all urgent messages as being important, I can use a filter:

### Tagging urgent messages as important

1. Open up the Settings Configure Filters... dialog and click the New icon below the Available Filters list.

2. In the Filter Criteria area, select Anywhere in Headers and contains from the drop down boxes and type `Priority` in the text field. Select the same criteria in the next line and type `urgent` in the text field of the second drop down box.

   So your filter will match all messages containing a Priority: urgent header field.

3. Skip down to the Filter Actions area. Select Mark As from the first drop down box. A new drop down box containing a list of marker flags is shown to the right. Select Important from the drop down box.

4. Since you want this filter to not prevent other filters message rules from being applied, carefully uncheck the If this filter matches, stop processing here option.

5. Click on OK, and you are done.

   Just keep in mind to move the Priority: urgent filter entry to the top of the Available Filters list, each time, when you have added another filter, so your non-stopping filter will always be applied first.

If I am subscribed to the (general) &kde; List, I could create a folder for the list (I will call it `KDE-General`) and use a filter to automatically transfer new messages from my inbox to my `KDE-General` folder if they are from the &kde; List. Here is how to create this filter:

### Filtering a mailing list

1. Try if Message Create filter Filter on Mailing-List... can identify the mailing list (the name of the list should then appear in the menu item); in this case, this works and I am presented a filter that has List-Id contains <kde.kde.org> preset. You select the desired destination folder from the folder pull-down menu in the Filter Action group and that is it.

   If that does not work, think of a unique way of identifying the messages you want to filter. The (almost) unique property of my &kde; List messages is that they always contain kde@kde.org in the To: or CC: field. It is only almost unique, because this fails for cross-posted messages.

2. Select Settings Configure Filters....

3. Press the New button to create an empty filter. It will appear as <unknown>.

4. In the Filter Criteria area, select All Recipients from the first drop down box, contains from the second drop down box, and type `kde@kde.org` in the text field.

5. Skip down to the Filter Actions section. Select Move Into Folder from the first drop down box. Click on the folder icon and a window containing a list of folders will appear. Select the folder that you want the filtered messages to be transferred to. For this example, you would select KDE-General.

You may find that you need to use more powerful criteria to properly filter your messages; for example, you may only want to filter the &kde; List messages that are written by your friend `Fred Johnson <fj@anywhere.com>`. This is where the rest of the matching criteria section comes into play:

### Extending the filter

1. Open up the Configure Filters... window and select the filter you just created.

2. Since you want to filter all messages that have `kde@kde.org` in the To: or CC: field and that are from Fred, check the Match all of the following radio button.

3. Now, go to the second search rule and select the following from the pull-down menus: From, contains. Now, type `fj@anywhere.com` in the text field.

You now have a filter that transfers all &kde; List messages that are from `fj@anywhere.com`.

### Filter Optimization

It is important to know that, for example, the order of the filters has an impact on the speed of the filter process. Here are some ideas which can help you to improve the filtering:

Stop filter processing as early as possible:

- If you know that a filter finally processes a certain class of messages, please make sure to check the option If this filter matches, stop processing here for the filter. This will avoid the evaluation of the filter rules of all subsequent filters. (See the advanced options in the Filter Dialog).

  An example is filtering messages from mailing lists via List-Id header into separate folders. Having found out that a message came from list A means that you can avoid checking the next filter for messages from list B.

Consider the costs of the evaluation of filter rules:

- The time required to evaluate a filter rule depends on the way the rule is constructed. In particular, scanning for a substring using the contains operation is faster than a pattern matching using the matches regular expr. operation.

  Another dependency is on the amount of data which is used for the evaluation of a filter rule. If the rule is based on a message header, its evaluation should normally be much faster than the evaluation of a rule based on the complete message.

  You should try to keep the filter rules as simple as possible.

Check the order of your filters:

- All the different filter actions have a different complexity. The most expensive filter actions are Pipe Through and Execute Command, because both need external programs to be run. Placing filters containing these filter actions behind other filters that can reduce the number of times these complex actions are required is useful, if the filter logic does allow this.

  An example is filtering messages from a mailing list and detecting spam messages. For the spam detection you will usually use an external tool via a Pipe Through action. Filtering the messages for the mailing list is done via the List-Id header. If you do not want to check the messages from the mailing list for spam too, it is better to use the filter for the mailing list messages before the filter for the spam detection. This way you avoid the expensive and slow spam check for all messages which were identified as mailing list messages.

### Filter Log

If you want to verify that your filters work as intended, you can open a viewer for the filter log via Tools Filter Log Viewer....

In the viewer, there you can configure the logging of the filter processing. You can control the detail level of the log, clear the log or save the log into a file. The log can provide valuable information if you need to debug your filtering process.

## Backing up &kmail;

This section describes various backup solutions within &kmail;.

### Archiving

Folder Archive Folder...

- This feature is also available through the context menu launched with a &RMB;, then select Archive Folder.... This will open a dialog that allows you to create a single archive of the currently selected folder.

  The Folder: shows the currently selected folder, if you wish to change the folder to be archived click the folder icon. The Format: drop down menu allows you to choose a format (choices are: zip, tar, tar.bz2, and tar.gz). If you would like to change the default name or location, click the folder at the end of Archive File.

  Check the Delete folder and subfolders after completion if you would like everything you archived deleted. By default all subfolders will be archived, uncheck Archive all subfolders if you only want to archive the parent folder.

Settings Configure Automatic Archiving...

- This is a powerful tool that can be used to assist in backing up your email. Please see Automatic Archiving for details.

Settings Configure Folder Archive Agent...

- This feature allows you to archive single emails to a specified folder.

  Folder Archive can be enabled on a per account basis to allow you to archive individual emails through the right click menu.

  Screenshot of Folder Archive

  Folder Archive is used to archive single emails to a specified folder. For instance, you need to archive all of those pesky bill receipts in one place. Folder Archive can easily accommodate those needs. Start by using Settings Configure Folder Archive Agent... in &kmail;'s reader window to open a dialog to set up the folder archive agent.

  This dialog will have a tab for each of your configured accounts including Local Folders and you will need to configure all accounts that you wish to use this feature with. The first option allows you to enable/disable the folder archive agent. It is disabled by default, to enable check the Enable checkbox. You can set the location of your Archive folder by clicking the folder icon next to Folder: and selecting the folder you wish to use. For example, you could create a folder called bill receipts by clicking the New Subfolder... and typing `bill receipts` in the dialog. You may choose a folder location anywhere, ⪚.. a folder in your Local Folders or on your &imap; server.

  You have several choices on how the emails will be archived:

  Unique folder

- Uses the selected folder sorted by date.

Folder by months

- Creates new folders inside the selected folder by months.

Folder by years

- Creates new folders inside the selected folder by years.

Now when you receive a bill receipt, &RMB; the email and select Archive from the menu. The email will be archived into your configured archive folder for easy viewing later on.

### Exporting

Tools Export &kmail; Data...

- This feature exports settings and local mail to a compressed file. Please see pimsettingexporter for details.

## Restore and Import in &kmail;

This section describes restoring backups and importing in &kmail;

### Restoring backed up email and settings

Tools Export &kmail; Data...

- If you used PIM Setting Exporter to backup local email and or settings, please use it again to import back into &kmail;. See PIM Setting Exporter for details.

### Importing options in &kmail;

&kmail; has an import wizard to make the transition from another email application extremely easy.

Tools Import Wizard...

- This starts the import wizard and try to automatically detect data from another email application. In case the mail data you want to import is not found, use the manual import below.

File Import Messages...

- Start the import wizard and let you select your mail data manually for importing.

Please read the Import Wizard documentation for details.

## Using Multiple Accounts

Multiple accounts are used to check for messages from more than one email address and/or mail server. Select Settings Configure &kmail;... and click on the Accounts page to add or change your account settings. See the Getting started section for more information on the settings in the Accounts page.

To check for messages from a particular account, use the File Check Mail In submenu to select the account to check for mail. You can also press the mouse button on the Check Mail icon for some time to get a list of accounts.

## Signing and Encrypting Messages with GnuPG

This is a short introduction on how to setup &kmail;'s GnuPG (&GNU; Privacy Guard) support; it gives some hints on the use of GnuPG too. It is written for people who are beginners in this area; if you are familiar with the use of GnuPG, you can skip most of the steps.

Please also check out the &FAQ; item about GnuPG.

Attachments will not be signed/encrypted if you are using inline OpenPGP: to sign/encrypt attachments, you have to install GnuPG and some necessary libraries; then, you can decide for each attachment whether it should be signed/encrypted or not.

&kmail; has to rely on GnuPG's output; this output is often different between different versions of GnuPG, so it is important that you test if encryption really works with your setup before you start using it seriously. &kmail; might not warn you if something fails -- enable Show signed/encrypted text after composing.

To setup and use GnuPG support in &kmail; it is necessary to have GnuPG installed and set up properly; of course, we cannot give you a full introduction of GnuPG here. We will only mention the steps you have to do to get GnuPG going. For details you should have a look at the The &GNU; Privacy Handbook.

It is certainly a good idea to study this documentation as well as an introduction into public key cryptography: there you can learn a lot about the basic concepts, which will help you to understand what is going on; also, many security related issues you should know about are discussed there.

Now, let us start.

### Preconditions

&kmail; expects that your GnuPG binary is called `gpg`. If this is not the case for you, just make a symlink.

If you have not done so, you have to generate a key pair (secret and public key) for your identity. Either do that using &kgpg; or &kleopatra; or do this at the command line: ``gpg` `--gen-key``: &kmail; has no internal support for gpg's key generation at this time. The identity (normally your name followed by your email address within brackets, such as `John Doe <john@example.com>`) and your passphrase are important for the co-operation between &kmail; and GnuPG.

### GnuPG-Related Settings in &kmail;

Select the Composing tab on the Security settings page; there you will find the following options:

When encrypting emails, always also encrypt to the certificate of my own identity

- If this option is off and you want to send an encrypted message to somebody, then you cannot read this message any longer after you have composed and encrypted it. Turn this option on to keep sent encrypted messages readable for you too.

Store sent messages encrypted

- When this box is checked, sent messages are stored encrypted like they were sent. This is not recommended, as you will not be able to read the messages any longer if a necessary certificate expires.

Always show the encryption keys for approval

- This will always open a dialog that lets you choose the keys used for each recipient when you are sending an encrypted message; if this option is off, &kmail; will show this dialog only when it cannot find a key for a recipient or when there are conflicting or unset encryption preferences.

Automatically encrypt messages whenever possible

- If this option is on, &kmail; will automatically encrypt messages with the built-in OpenPGP support or the PGP/&MIME;-Plugin provided that, for every recipient, a trusted PGP key is found in your keyring and you did not tell &kmail; not to encrypt messages sent to certain recipients. If in doubt, &kmail; will ask whether the message should be encrypted or not.

Now that you have setup the encryption tool you have to tell &kmail; which OpenPGP key you want to use for signing and for encrypting messages; to do this go to the Identities configuration and set the key that should be used on the Cryptography tab of the identity configuration.

Now you are able to sign outgoing messages; to let people send you encrypted messages and to let them verify your signature you must send them your public key or upload your public key to a public GnuPG key server so that they can fetch your key from there. To send encrypted messages to other people or to verify their signed messages you will need their public keys; you can store your public key(s) on a public GnuPG key server.

### Sign your Messages

You can compose your message as usual in the composer window of &kmail;. Before you send the message, check the Sign icon on the toolbar of the composer window; then, you can send the message. The identity you are using to write the current message needs to be connected to an OpenPGP Key in the Identity section of the Configure dialog. To sign the message, &kmail; needs to know your GnuPG passphrase: if you did not select Keep passphrase in memory in the Security section, &kmail; will ask you for it; otherwise, if you have already given the phrase to &kmail;, it will sign the message without any further prompt.

### Encrypt your Messages

To send an encrypted message to somebody whose public key you have, you simply create the message in the composer window. Before you send the message, check the Encrypt button in the toolbar of the composer window; note that you might not have to check the button if Automatically encrypt messages whenever possible is selected in &kmail;'s configuration (see above). Then send the message.

If you checked the Encrypt button and &kmail; cannot find a matching key for a recipient, it will display a list containing all available keys in the Encryption Key Selection dialog; if &kmail; finds more than one trusted key for a recipient, it will display a list containing all matching keys for this recipient. In both cases you can select the key(s) which should be used for encrypting this message for the recipient in question. Using the Remember choice checkbox you can save your selection for future messages.

If you are using a key for the first time, there are conflicting Encryption Preferences, or if Always show the encryption keys for approval is selected in the Security section of &kmail;'s configuration dialog, the Encryption Key Approval dialog will appear; here, you can select different keys for the recipients and can set the Encryption Preference for each recipient. The default option, Encrypt whenever encryption is possible, will automatically encrypt your message if there is a trusted key for each recipient.

As mentioned above, you will not be able to read your own encrypted sent messages if you do not check When encrypting emails, always also encrypt to the certificate of my own identity in the settings' Security page.

### Send your Public Key

Prepare a message to the person to whom you want to send your public key; then, choose, in the composer window's menu, Attach Attach My Public Key: this will attach the public key you defined for the current identity to the message. Now you can send the message.

Remember that it is not safe at all if you sign the message to make sure that the receiver will get the correct key: there can be a man-in-the-middle attack, as somebody can change the key and sign the message with that other key. That is why the recipient should verify the attached key by checking the key's fingerprint against the one he received in a secure way from you; have a look at the GnuPG documentation for further details.

### You received an encrypted Message

All you have to do is to select the message in &kmail;. You will be prompted for your passphrase; then, &kmail; will try to decrypt the message and show you the plain text if the message had been encrypted with your public key: if not, then you will not be able to read it. &kmail; stores the messages encrypted, so nobody can read these messages without knowing your passphrase.

### Receiving a Public Key

You can receive a public key as an attachment or via http, ftp or a floppy. Before you can use this key to encrypt a message to the owner of the key, you should verify the key (check its fingerprint or look for trusted signatures); then, you can add this key to your public keyring by typing ``gpg` `--import` `filename`` at the command line. If the key is not certified with a trusted signature you cannot use it to encrypt messages unless you have signed the key with your key.

## The Anti-Spam Wizard

### Basics

&kmail; does not have a built-in spam detection solution: the developers believe using external, but specialized, tools is the better approach. &kmail; uses these tools through its flexible filter architecture. The Anti-Spam Wizard helps you with the initial filter setup.

What can the wizard do to help you?

- It will give you some choices about how you want the spam filtering to be set up. Afterwards it will automatically create the appropriate filter rules.

What are the limitations of the wizard?

- It can only initially set up the filters for you; and it will provide a standard setup. Manual modifications in existing filters are not considered. Instead, these filters are overwritten by the wizard.

You can activate the wizard via Tools Anti-Spam Wizard....

The wizard scans for known anti-spam tools on your computer. It is also possible to use the results of spam checks made by your service provider by evaluating header information which has been added to the messages. You can let the wizard prepare &kmail; to use one or more of these in parallel. However, note that anti-spam tool operations are usually time consuming. &kmail; can appear to be frozen during the scan of messages for spam; you may encounter problems with the responsiveness of &kmail;. Please consider deleting the filter rules created by the wizard if the filtering becomes too slow for you. Here are some recommendations regarding the supported tools:

Bogofilter

- Bogofilter is a bayesian filter, that means its spam detection relies on an initial training phase. On the other hand, it's a pretty fast tool. That's why it is recommended to be used by people who primarily want to have fast spam detection, and who won't worry about the initial training before the detection rate increases significantly.

SpamAssassin

- SpamAssassin is a pretty complex tool to use against spam. Although its behavior depends heavily on its configuration, it can detect spam quite well without any training. However, scanning a message takes a little longer compared to pure bayesian filters. Let's say it's not the tool of choice for people without some background information about SpamAssassin's capabilities.

Annoyance-Filter

- Perhaps not so often used until distributions pick it up. It's clearly a tool for specialists.

GMX Spam Filter

- If you get your mail via the GMX freemail provider, your messages are already scanned for spam. The result of that process is documented in a special header field of each message. It's possible to use the content of this header field to sort out spam. There is no slowdown in the filtering if only this tool is used, as the messages have already been processed.

### Advanced

Here are the details of how the wizard works: &kmail; can use several external tools to detect spam messages; it will try to automatically find out which tools are installed on your system and will show you these in a list. The list is ordered by the average speed of the filtering process of the tools. You can mark the tools which you want to be used by &kmail; to detect spam. Of course, you can close the wizard, install a new tool, and restart the wizard again.

If you have marked at least one tool, &kmail; is able to provide filters which allow the classification of the messages as spam or not spam. It will also provide actions to let you manually classify messages. These actions will be available via the menu and toolbar icons. If any of the tools you selected support Bayesian filtering (&ie; a method to detect spam based on statistical analysis of the messages) then these messages are not only marked but additionally transferred to the tools to enable them to learn thereby improving their detection rate.

On the second page, you will be able to select some additional actions to be performed in &kmail; with regard to spam messages: if you want messages detected as spam to be moved into a certain folder, select the appropriate folder and mark the Move known spam to: option; if messages detected as spam should additionally be marked as read, then mark the Mark detected spam messages as read option.

Selecting at least one of the available tools will allow the wizard to finish the filter setup. The wizard will not take any modifications in existing filters, formerly created by it, into consideration but will either append new filters or replace existing filters. In any case you may want to inspect the result of this process in the Filter Dialog. The wizard will also create toolbar buttons for marking messages as spam or as ham; keep in mind that classifying messages as spam will also move those messages to the folder you had specified for spam messages, if you have selected the appropriate option.

### Some More Details for Experts

The wizard uses information stored in a special configuration file named `kmail.antispamrc` (stored in the global or local &kde; config directory). It will first check the global config file and then the local config file: if the local config file contains entries with higher (newer) version numbers per-tool the configuration data from the local file for that tool is used; that way, both administrators and users can update the wizard configuration.

The local detection of spam messages is achieved by creating pipe through actions per-tool within a special filter. Another filter contains rules to check for detected spam messages and actions to mark them and (optionally, depending on the choice in the wizard) to move them into a folder. Both filters are configured to be applied on incoming messages and on manual filtering.

Two filters are needed for the classification of ham and spam. They contain actions to mark the messages appropriately. As mentioned above, the filter for classification as spam can have another supplementary action to move the messages into a predefined folder. If the selected tools support Bayesian filtering, the wizard will create additional filter actions to pass the messages to the tools (via execute command actions) in the appropriate learning mode.

If you want to fine-tune the filtering process, you might be interested in the chapter about Filter Optimization.

## The Anti-Virus Wizard

### Basics

&kmail; does not have a built-in virus detection solution: the developers believe using external, but specialized, tools is the better approach. &kmail; uses these tools through its flexible filter architecture. The Anti-Virus Wizard helps you with the initial filter setup.

What can the wizard do to help you?

- It will give you some choices about how you want virus filtering to be set up. Afterwards it will automatically create the appropriate filter rules.

What are the limitations of the wizard?

- It can only initially set up the filters for you; and it will provide a standard setup. Modifying existing filters is not yet possible.

You can activate the wizard via Tools Anti-Virus Wizard....

### Advanced

The Anti-Virus Wizard basically works exactly as the Anti-Spam Wizard does. Here are the details of how the wizard works: &kmail; can use several external tools to detect messages containing viruses; it will try to automatically find out which of these tools are installed on your system and will show you the result of the search. You can mark the tools which you want to be used by &kmail; to detect viruses. Of course, you can close the wizard, install a new tool, and restart the wizard again.

If you have chosen at least one tool you will be able to select actions to be done in &kmail; to messages containing viruses: to let &kmail; detect messages containing viruses you definitely should mark the Check messages using the anti-virus tools option; if you want messages detected as virus-infected to be moved into a certain folder, select the appropriate folder and mark the Move detected viral messages to the selected folder option; if messages detected as virus-infected should additionally be marked as read, then mark the Additionally, mark detected viral messages as read option.

Selecting at least one of these options will allow the wizard to finish the filter setup. The wizard will not take any existing filter rules into consideration but will append new rules. In any case you may want to inspect the result of this process in the Filter Dialog.

### Details

The wizard uses information stored in a special configuration file named `kmail.antivirusrc` (stored in the global or local &kde; config directory). It will first check the global config file and then the local config file: if the local config file contains entries with higher (newer) version numbers per-tool the configuration data from the local file for that tool is used; that way, both administrators and users can update the wizard configuration.

The detection of messages containing viruses is achieved by creating pipe through actions per-tool within a special filter. Another filter contains rules to check for detected viral messages and actions to mark them and (optionally, depending on the choice in the wizard) to move them into a folder. Both filters are configured to be applied on incoming messages and on manual filtering.