&Daniel.Naber; &Daniel.Naber.mail;
&Scarlett.Clark; &Scarlett.Clark.mail;
&David.Bryant; &David.Bryant.mail;
2020-09-12
5.14.2 (Applications 20.04.2)

# 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

  The Folder List

  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 message header information contained in the folder will then appear in the Message List 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 (and can show more folders). You can toggle between these two views by using the Appearance/Layout tab in the Settings Configure &kmail;... dialog. The top section of the folder pane provides quick links to your favorite folders. Drag and drop folders here, or add them via the &RMB; context menu item Add Favorite Folder. Please see the Folders Section for more details about folders.

Message List (on the upper right by default)
  The Message List
  The Message List

  The Message List (Smart Theme)

  This pane lists header information (Subject, Sender, and Date) for the messages in the currently selected folder. Clicking on an item in the Message List will select that message and display it in the Preview pane; you can also select more than one message by holding down the &Ctrl; key (or the &Shift; key) when clicking on messages.

  Change the appearance 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 list with status icons, and no sort columns.

  - Smart with Clickable Status A smart multi-line, multi-item list with clickable status icons.

  - Configure... Allows you to customize your own Message List Theme (&eg; add or remove columns from the clickable sort bar.)

  If you have chosen the Classic theme, you may sort the messages by clicking on the column that you wish to sort; if you click on the same column again, the sort order will toggle between ascending/descending. 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 of Message List for details.

Preview Pane (in the lower right by default)
  The Message Preview Pane
  The Message Preview Pane

  The Preview Pane

  This pane displays the currently selected message. Here are some ways to adjust the Preview pane.

  The top of the Preview pane displays the message headers. Several display options are available. Go to View Headers and try them out until you find one you like!

  - Fancy Headers Colorful header with a spam status / attachments notification.

  - Brief Headers Title, and in parentheses: From, CCs (if any), and the date.

  - &kmail; 5.2 An avatar (if available) with Title, From, To, CCs (if any), and spam status / attachments on separate lines.

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

  Click on the bar located on the left hand side of the pane to toggle between plain text and &HTML; (if and only if the message is coded both ways). The text on the bar will inform you which view you are in. The Settings Configure &kmail;...Security dialog allows you to select HTML as the default message display option, if you prefer &HTML; to plain text.

  If you would like to change the way your attachments appear in your messages, go to View Attachments. These are your options.

  - 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 messages you compose by selecting Suggest automatic display in the composer window via the attachment's properties dialog.

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

  - Hide will not show attachments.

  - In Header Only will suppress inline displays, but list the attachments along with the message headers.

  The interactions among the header themes, the attachment views, and the plain text versus &HTML; preferences is rather complex. For example, if you attach an HTML file to a plain text message, &kmail; will probably interpret your message as being coded in two different formats, even though this is not really the case. Similarly, &HTML; messages may display embedded images even when you have selected the "Hide" option for attachments.

  The structure of each message can be displayed by pressing &Ctrl;&Alt;D. This will open a message structure viewer below the preview pane. Turn the message structure viewer off by pressing the same three keys.

  You can scroll through the message page-by-page using the &PgUp; and &PgDn; keys, or line-by-line using the &Up; and &Down; 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 by default in the main window. Notice that many "universal" shortcuts (&eg; &Ctrl;C to copy selected text to the clipboard, or &Ctrl;F to open a "Find" dialog) are recognized by &kmail;, but are not documented here.

Keyboard Shortcut | Action
--- | ---
&Space; | Scroll down in the current message.
→ or N | Go to the next message in the current folder and display the message preview.
← or P | Go to the previous message in the current folder and display the message preview.
&Ctrl;&Home; | Go to the very first message in the current folder and display the message preview.
&Ctrl;&End; | Go to the very last message in the current folder and display the message preview.
+ | Go to the next unread message in the current folder.
- | Go to the previous unread message in the current folder.
C | Copy this message to another folder.
M | Move this message to another folder.
A | Reply to all recipients of this message (with quote).
R | Reply to sender with quote.
&Shift;R | Reply to sender without quoting anything.
S | Launch the message search dialog.
T | Open this message in the composition window.
&Enter; | View selected message in the full-screen message viewer.
V | View the raw message, headers and all, as a text file.
&Ctrl;L | Check for new messages on the server(s).
&Ctrl;N | Open the composition window to write a new message.
&Ctrl;+ | Zoom in on the current message, in increments of 20%.
&Ctrl;- | Zoom out of the current message, in increments of 20%.
&Ctrl;0 | Reset message Zoom factor to 100% (full size).
&Ctrl;&Alt;D | Toggle message structure display (below the message preview pane).
&Ctrl;&Shift;O | Create the tabbing toolbar (appears above the message list).
&Ctrl;&Shift;W | Remove the currently active tab from the tabbing toolbar.
&Alt;↑ | Go to the previous folder in the folder list (if the folder list has focus).
&Alt;↓ | Go to the next folder in the folder list (if the folder list has focus).
&Ctrl;&Home; | Focus on the very first folder. Use &Ctrl;&Space; to actually enter the folder.
&Ctrl;&End; | Focus on the very last 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;&Home; or &Ctrl;&End;.
&Shift;H | Toggle between plain text and &HTML; (unless &HTML; has been preferred via the Settings dialog).
&Shift;← & &Shift;→ | Select messages sequentially in the message list, starting with the current message.

For more keyboard shortcuts, take a look at the Settings Configure Shortcuts... dialog. If you're not happy with the defaults, you can change them!

Two mouse actions deserve mention here. First, you can select multiple noncontiguous messages to be processed all at once (&eg; copied, deleted, or moved) by pressing &Ctrl; and selecting them with the &LMB;. Second, you can open a message in an external window by double-clicking an item in the message list. If the message is in the outbox, drafts, or templates folder, it will be opened in a composition window. Otherwise, it will be opened with the external message viewer, an abbreviated version of &kmail;'s main window without the folder and message lists, and with shorter menus.

## The Composer Window

Composer Window
Composer Window

The Composer Window in &HTML; composition mode.

The composer window is used to write new messages, to compose replies, and to forward messages. It can be opened in several ways. Here are the various options for composing messages.

### Composing a Message

New Message...

  The New Message composer window can be invoked in four different ways:

  - File New New Message...

  - Message New Message...

  - Via the New icon on the main toolbar.

  - Via the keyboard shortcut &Ctrl;N.

  To write your message, fill in the appropriate fields in the composer window. Use the View menu to select which header fields are displayed. Any selection you make will remain as the default when you open a new composer window. These items are available.

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

  - The Dictionary drop down box lets you choose a dictionary for spell checking.

  - Sent-Mail Folder lets you specify where a local copy of this message will be saved when you send it.

  - Mail Transport lets you select an outgoing mail server.

  - The traditional From:, To:, and Subject: fields. (The Reply To: field will appear only if you have specified an alternative Reply To address on the Advanced tab in the Settings Configure &kmail;... Accounts Identities dialog.)

  - Use Fixed Font toggles fixed width fonts on and off.

  - Snippets displays the snippets window, where you may save frequently used bits of verbiage.

  There are a variety of shortcuts to help you select recipients. The Select... button next to the To:, CC:, and BCC: fields opens a list from &kaddressbook; so you can select one or more people who should receive this message.

  Alternatively, when you start typing an address in one of the To:/CC:/BCC: fields, a popup will appear that suggests similar recently used addresses and closely matching addresses from &kaddressbook;; if you do not like this automatic popup, you can disable it by clicking the &RMB; in the field where you're typing, then choosing a different Text Completion > mode. You can also use this context menu to fine-tune the order in which suggested completions appear (via Configure Completion...).

  Whenever you want to add more than one recipient in one of the fields, use a comma to separate one address from the next one. You may have 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, click the Send icon 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 it for later editing. If you want to print your message, select Message Print Preview to preview the message, and Message Print to print it.

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

File New Message From Template My Super Template

  Composing a new message from a template is useful when you have created a masterpiece that you would like to use as a template for future new messages. Select Message Save as Template; this will place your new template in the templates folder. You can revise the template at any time by selecting it from this folder. Double click on the template's name (or press the shortcut key, T) to open it in a composition window. You may also select the template via the File menu, as shown above.

### Signing and Encrypting Messages

If you want to send an encrypted or digitally signed message, select the Sign and / or Encrypt icon in the toolbar. Use the Options Cryptographic Message Format > dropdown list to select the format used to encrypt the message. (The Options menu also lets you sign / encrypt the message.) You may choose one of five formatting options.

Any

  &kmail; will use a format which is understood by all recipients of the message. The preferred format for each recipient can be specified via &kaddressbook;.

Inline OpenPGP (deprecated)

  This format is deprecated, but is supported for backward compatibility. 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 when necessary, &ie; if you send messages to people who use email clients that cannot handle the more advanced formats.

OpenPGP/&MIME;

  This format is the successor to 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 encryption.

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. It relies on an x.509 certificate, not a PGP / GPG key.

S/&MIME; opaque

  This format is a variant of the S/&MIME; format. Because it rolls the message, any attachments, and the digital signature into a single &MIME; object, it is cpu-intensive and should only be used if necessary.

### Creating &HTML; Messages

Note that &HTML; messages are often regarded as an annoyance; therefore, you should use &HTML; messages judiciously. In particular, you should never send &HTML; messages to mailing list recipients unless &HTML; messages are explicitly allowed.

To create &HTML; messages, you must first enable the markup tools. To do this, enable Rich Text Editing in the Options menu, or click on the Rich Text icon on the &kmail; toolbar. An additional toolbar with several formatting tools will appear. Via the &HTML; toolbar you can choose standard text or bulleted / numbered lists. (Use the None drop-down list at the left edge of the toolbar to control the style of bulleted / numbered lists.) You can also control the font family, the font size, the font style (bold, italic, underlined, or strike-through) and the text / background color. And you can specify the alignment of the text (left aligned, centered, right aligned, or justified) and insert anchor tags (aka links), horizontal lines, images, tables, and arbitrary &HTML; code (although support for some of the more advanced &HTML; tags is still incomplete).

### Adding Attachments

You can attach files to your message by using any of these methods.

- Use the Attach Attach > dropdown list and ensuing dialog to choose a file;

- Click the Attach 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 additional options in the Attach menu; or

- Select Message Insert Text File ... or 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 View, Open, Edit, Reload, Save As..., or Remove the attachment. (This context menu varies a little, depending on the file type of the attachment.) Several options (Compress / Encrypt / Sign / Suggest Automatic Display) may be toggled on or off for each file attached to a message.

Use the Properties item in the context menu to open the Attachment Properties dialog. The first field contains the attachment's &MIME; type. Just like the Name field, it is automatically filled with an appropriate value. Sometimes the &MIME; type 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 crypto keys to the message by choosing the appropriate options in the Attach menu. GnuPG keys and x.509 certificates are (usually) handled as file attachments.

### Checking the Spelling of your Message

&kmail; can automatically check the spelling of your message and underline unknown words in red. If there are too many unknown words, &kmail; will disable its checking. To select the language used when checking, select View Dictionary. You can disable automatic spell checking 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 spell checker's language with one mouse click.

To check the spelling of your message via a dialog, select Tools Spelling.... &kmail; uses &sonnet; to check spelling; &sonnet; is the &kde; frontend to the Aspell, Hspell, Enchant, and HUNSPELL spell checking programs. Note that you may need to configure the spell checker using Settings Spellchecker....

### Setting Up the Text Snippets Tool

When editing in the composer window you can insert frequently used bits of text as snippets. To configure mail snippets, select View Snippets from the menubar. A new panel will appear on the right side of the composer window.

To add a new snippet to the Snippet Panel, right click on the panel, then click 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. A Shortcut can also be associated with the snippet. Snippets can be grouped together by creating groups and adding snippets to a particular group. Use the &RMB; context menu to add, edit, or remove snippets of text from the saved collection.

The Snippets tool enables insertion of variable text in predefined places any time you insert a snippet in a file. To do this, Snippets provides its own variables mechanism. You can insert variables in the snippet text itself by using separators ( $ ) to 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 ~./config/kmailsnippetrc.

    snippetDelimiter=$

### Using the Built-in Translator

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

To translate a section of text, first enter the text you would like translated in the box labeled Drag text that you want to translate.. Select the language in which it is written in the From: drop down box. Select the language you would like to translate to in the To: drop down box, then click the Translate button. After being translated by Google Translate, a free online service, 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

&kmail;'s default folders.

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. Each of these folders has a special function.

inbox:

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

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

outbox:

  Where messages are put while they are waiting to be delivered. You must not just drag and drop messages here to send them; use the Send icon in the composer window instead.

sent-mail:

  By default, a copy of every message you send is saved in this folder.

trash:

  By default, all messages that you have designated as trash are moved into this folder.

drafts:

  Contains messages you started to write but then saved to this folder with Message Save as Draft.

templates:

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

### Creating and Using Folders

Organize your emails (&eg; mailing lists, bills and 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 (&ie; views, replies, &etc;) by selecting the folder you wish to modify in the folders pane and then choosing Folder Properties from the &RMB; context menu. See Properties of Folders 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 Message To... >. A list of folders will appear; select the folder into which you wish to move the message from that list. Messages can also be moved by dragging them from the Message list to a folder in the Folder list, or by using a context menu invoked with the &RMB;.

If you have folders that are frequently accessed, you can add them to your favorite folders pane (above the list of folders). Add them with the &RMB; context menu option Add to Favorite Folders.

You can create a virtual folder with search parameters by going to Tools Find Messages..., or by using keyboard shortcut S. Enter your search parameters into the dialog. Name your search with the Search folder name: textbox, &eg; emails with the word Blog. Click the Search button. Now select the Open Search Folder button. A results folder will open, positioned at the bottom of the Folder pane. (By default, each new search is named "Last Search". You can save particular search parameters by assigning a special name as described above.)

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.

If you receive emails from a trusted source (&eg; a Blog you signed up for) that is formatted in &HTML; and you would like to enable &HTML; view for those emails only, you can create a new folder, set up a filter to place all email from the Blog in the new folder, select the folder, and then choose Folder Message Default Format > Prefer &HTML; to Plain Text.

Some common folder actions are

Folder Move All Messages to Trash

  Move all the 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

  Search the currently selected folder for duplicates and delete them.

### Folder Properties

Folder Properties Example
Folder Properties Example

The Folder Properties Dialog

The Properties of Folder dialog lets you specify its properties. Note that some properties are only available for the folders you create and not for default folders like inbox &etc; The six default folders cannot be renamed.

#### General tab

If you want 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 enables notifications about new mail that arrives in the folder. Uncheck this option on folders like SPAM and trash for which you do not desire notifications.

Check Keep replies in this folder if you want replies to these messages to be stored in this folder rather than in 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.

New folders use the default identity. If you wish to associate a folder with a different identity, uncheck Use default identity and select a different 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 a matching identity is found.

#### View tab

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

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

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

The Message Default Format section lets you choose between plain and &HTML; displays for messages in this folder.

#### Retrieval tab

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

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

#### Templates tab

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

#### Expiry tab

You can set up automatic cleanup or deletion of emails. Check the box if you would like to automatically expire read or unread messages respectively. Set the number of days in the spin box. If you do not want to delete the messages permanently, you can assign a folder to keep them in via the Move expired messages to: text box / folder selection dialog. Once you have reviewed the messages and want to delete them permanently, 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 button.

Messages that are deleted cannot be restored, so be careful with this setting.

#### Mailing List tab

If you are going to use the folder for a mailing list open the Mailing List 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 among five options.

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, enter the email address or the address of the web page and then click on Add. With Remove you can remove addresses.

When all the addresses have been added, you can execute an action, &eg; 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, 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.

You can also send a new message to the mailing list via Message New Message to Mailing-List... (instead of Invoke Handler).

#### Shortcut tab

You can define a keyboard shortcut to access the folder.

#### Maintenance tab

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.

#### Quota tab (&IMAP; only)

This tab will show you how much space has been allocated to your &IMAP; account by the server, and also how much of the allocated space you are currently using.

#### 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 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 (&eg; answered).

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

  In the example, you could assign write rights to a group of people acting as moderators, who 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.

summarizes the &IMAP; &acl; rights associated with each permission level.

##### &acl; Rights Summary

&acl; right |  |  |  |  |
--- | --- | --- | --- | --- | ---
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

## Message Filters

The Filter Dialog
The Filter Dialog

The Filter Creation Dialog

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 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.

Filters are considered one after the other, starting with the first filter in the list. The first one whose pattern matches the given message is applied; you can request that the remaining filters also be processed, 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 the filters (the ones that have been marked for manual filtering in the advanced 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 criterion from the submenu. This will open 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, but you can, of course, edit the filter as you like.

When creating a filter on mailing list messages, this method will try to find a criterion that uniquely identifies messages from the 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 tabs.

Available Filters

  This group contains the list of filters and some action buttons to modify the filters, namely: create new filters; move them up or down the list; copy one of them; delete them; or 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 before the filter is applied to them. You can select whether all of the defined rules must match, or whether a single match is enough. See Search Patterns below for a detailed description of each search rule type.

  You can click on &plus; to get an additional (initially empty) rule if you want to define more complex patterns, and on − to remove the selected rule. Clear clears the pattern, &ie;, it removes all but one rule from the screen and resets it.

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 &plus; to get a new, empty action (if you want to define more than one action), and on − to remove the selected action. Clear clears the list, &ie; it removes all but one action and resets that one.

Advanced Options

  In this group you can define a few advanced options that allow you to fine tune 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, or to particular incoming email accounts.

  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 processed when 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 single filter to a message or a set of messages. If you select this option, you may optionally select a keyboard shortcut and insert a special icon to invoke this filter from the toolbar.

  Another way of applying filters is to use the 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 specifies the If this filter matches, stop processing here option.

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 the valid filters are actually copied to the internal filter manager.

Similarly, empty rules and actions are removed from the pattern and action lists, 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 All Recipients, but there are other criteria a filter can search for (note that all patterns are interpreted case-insensitively).

Complete Message

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

Body of Message

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

Anywhere in Headers

  Searches all the headers in the message.

All Recipients

  Searches the To and CC header fields of the message.

Size in Bytes

  Sets upper or lower bounds on the message's size.

Age in Days

  Sets upper or lower bounds on the message's age.

Message Status

  Sets restrictions on the status of the message (Important / Read / Unread / &etc; see Message Mark Message >).

Message Tag

  Checks for tagged messages. See Message Mark Message >.

Encrypted

  Checks for encrypted messages.

Any other value (From, To, Date, &etc;)

  Searches the header field with 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.
starts with/does not start with | most textual search items | Matches if the searched item begins with (or does not begin with) the given text.
ends with/does not end with | most textual search items | Matches if the searched item ends with (or does not end with) 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 | Complete Message | Matches if the message has an attachment (or does not have an attachment).
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 | Message Status | Matches if the message has (or does not have) the specified status.
is after/is before or equal to | Date header | Matches if the message was sent after (not after) the specified date.
is before/is after or equal to | Date header | Matches if the message was sent before (not before) the specified date.

### Filter Action

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

Move Into Folder

  This will move the message into another folder, and remove it from its current folder.

Copy Into Folder

  This will copy the message to another folder, and leave the message in the current folder.

Set Identity To

  This will set the identity that will be used when 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;

Add Tag

  This will add a tag to the message. You may choose from a list of all the tags that have been defined.

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 (&eg; &SMTP;) that will be used when you reply to the message. You may choose from a list of all your outgoing email accounts.

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 address you do not wish to use.

Forward To

  This will forward the message inline (&ie; as if you selected Message Forward Inline...) to another email address. You may select a custom forwarding template if such a template has been defined. If &kaddressbook; is installed, you may choose the Forward To address from a pop-up window.

Redirect To

  This will redirect the message as-is to another email address. If &kaddressbook; is installed, you may choose the Redirect To address from a pop-up window.

Confirm Delivery

  Will return a message to the sender that verifies 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 do not recommend that you send them to everyone, since this makes tracking of spam messages very easy for the spammers.

Execute Command (for advanced users only)

  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 wait until the program returns. If you do not want &kmail; to wait, append '&' to the command. You can feed the segments of the message into the program one by one: &percnt;0, &percnt;1, &etc; stand for files representing the message segments. For common messages, &percnt;0 is the plain text message, &percnt;1 the first attachment and so on. Additionally, the whole message is fed into the program's stdin; and every occurrence of &percnt;{foo} is replaced by the content of the foo header. If you need to identify the message via its storage location in the Akonadi database, 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 &percnt;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 (&percnt;n, &percnt;{foo} as with Execute Command may be performed on the command line.

  Both the Anti-Spam Wizard and the Anti-Virus Wizard use the Pipe Through action to check for spam / malware. The commonly available anti-spam and anti-virus programs return the message, and insert an extra header record, if spam (or a virus) is detected.

  Be cautious with this action, as it can damage 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 (&eg; 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. A browse button lets you choose a pre-recorded sound (&eg; .wav) file.

Add to Address Book

  If &kaddressbook; is installed, this action will let you specify which header to scan (From, To, CC, or BCC), what tag to assign, if any, and which named address book to store the addresses in.

Delete Message

  Deletes the selected message(s). Use this option cautiously. Deleted messages cannot be recovered.

Unset Status

  This is the inverse of Mark As, above. Instead of marking the selected message as important, read, &etc;, this action will clear the specified flag.

Encrypt

  Will encrypt the selected message(s) with the specified public key. You may choose from any public / private key pairs saved on your key ring.

Decrypt

  Will decrypt the selected message(s). Use this action with caution. &kmail; will decrypt messages automatically when you open them for viewing, so you probably don't really need to use this action.

### Filter Examples

As of yet &kmail; does not highlight or mark mails that have an extra Priority: header. If you want to flag all urgent messages as being important, you 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 criterion 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 on the Advanced tab.

5. Click on OK, and you are done.

   Just remember to move the Priority: urgent filter entry to the top of the Available Filters list each time you add a new filter, so that your flow-through filter is always applied first.

If you are subscribed to the (general) &kde; List, you could create a folder for the list (let's call it KDE-General) and use a filter to automatically transfer new messages from your inbox to your KDE-General folder if they came from the &kde; List. Here is how to create this filter:

#### Filtering a mailing list

1. Check 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 you are presented with a filter that has List-Id contains <kde.kde.org> preset. Then 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 &kde; List messages is that they always contain kde@kde.org in the To: or CC: field. It is not quite perfect, because this fails for cross-posted messages.

2. Select Settings Configure Filters....

3. Press the 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 identifies all &kde; List messages that are from `fj@anywhere.com`.

### Filter Optimization

It is important to realize that the order of the filters has an impact on the speed of the filtering process. Here are some ideas which can help you to improve filter performance.

Stop filter processing as soon 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.

  Try to keep the filter rules as simple as possible.

Check the order of your filters:

  The various filter actions have different degrees of 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 allows 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 you can configure logging of the filter process. You can control the level of detail recorded, clear the log, limit the size of the log, and save the log as a file. The log can provide valuable information when you want to improve your filter rules.

## 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 button to the right of Archive File.

  Check the Delete folder and subfolders after completion button if you would like everything you archived deleted from the &kmail; database after the external archive has been saved. 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.

### Exporting

Tools Import/Export &kmail; Data...

  This feature exports settings and local mail to a compressed file. Please see pim data exporter for details.

## Restore and Import in &kmail;

This section describes restoring backups and importing data into &kmail;.

### Restoring backed up email and settings

Tools Export &kmail; Data...

  If you used PIM Data Exporter to backup local email and / or settings, please use it again to restore data into &kmail;. See PIM Data Exporter for details.

### Importing options in &kmail;

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

Tools Import from another Email Client...

  This starts the import wizard and tries to automatically detect data from another email application. In case the mail data you want to import is not found, use the Manual Selection option.

File Import Messages...

  Starts the import wizard and lets you select the desired data manually.

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 and hold the &LMB; on the Check Mail icon (on the toolbar) for a few seconds to get a list of accounts.

## Signing and Encrypting Messages with GnuPG

This is a short introduction on how to set up &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.

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

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

### 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 yet done so, you must generate a key pair (secret and public keys) for your identity. You may do this using &kgpg; or &kleopatra; or at the command line: ``gpg` `--gen-key``. Or you can ask &kmail; to create a new key pair when you create a new email account. 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 the encrypted messages you send readable for you, too.

Store sent messages encrypted

  When this box is checked, sent messages are stored encrypted, as they were sent. This is not recommended, as you will not be able to read the messages any longer if a necessary certificate expires. (Notice that GPG keys do not expire, as a general rule; this caution is primarily relevant for x.509 certificate users.)

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 the dialog only when it cannot find a key for a recipient or when there are conflicting or unset encryption preferences.

When saving as draft, always sign/encrypt as indicated

  If this option is on, &kmail; will automatically encrypt (and / or sign) messages that you save in the drafts folder (when you specify signing / encryption).

Show sign/encrypt indicator in editor

  If this option is on, &kmail; will display an indicator in the composition window to inform you that this message will be signed / encrypted whenever that is the case.

Now that you have set up the encryption tool, you must tell &kmail; which OpenPGP key you want to use for signing and encrypting messages. To do this go to the Identities configuration and set the key that should be used via the Cryptography tab in the identity configuration dialog.

Now you can 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 people can fetch your key from the server). To send encrypted messages to other people, or to verify their signed messages, you will need their public keys. You can search for public keys on a public GnuPG key server. Or you can ask your friends to send you one or more of their public keys.

### Sign your Messages

Compose your message as usual in the composer window. Before you send the message, check the Sign icon on the toolbar of the composer window, or select Options Sign Message. 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. You may be asked to supply it, or, if you have previously given the phrase to &kmail;, the message will be signed automatically.

### Encrypt your Messages

To send an encrypted message to somebody whose public key is on your gpg key ring, simply create the message in the composer window. Before you send the message, check the Encrypt button in the toolbar of the composer window (or select Options Encrypt Message). Then send the message.

If you checked the Encrypt button and &kmail; cannot find a matching key for a recipient, it will allow you to modify your key ring before trying again. If &kmail; finds more than one trusted key for a recipient, it will display a list containing all matching keys for this recipient. In either case you can select the key(s) which should be used for encrypting this message for the recipient in question.

If you are using a key for the first time, if 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. You can select different keys for the recipients and can set the Encryption Preference for each recipient. The option, Encrypt whenever encryption is possible (on the Cryptography tab of the Settings Configure &kmail;... dialog), 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 Public Key. This will attach your public key – the one you are currently using – to the message.

Remember that it is not perfectly safe to just sign the message to ensure that the receiver gets the correct key. There can (possibly) be a "man-in-the-middle" attack: somebody could intercept your message, change the attached key, and then sign the message with that other key. The recipient should verify the attached key by checking the key's fingerprint against the one he received in a secure way from you. Alternatively, just ask him to use the key he received to compose and send an encrypted message back to you. If your secret key decrypts that message, he has a copy of your public key. See the GnuPG documentation for further details.

### You received an encrypted Message

All you have to do is to select the message in &kmail;. You may be prompted for your passphrase. Then, &kmail; will decrypt the message and show you the plain text if the message was encrypted with your public key. If not, you will not be able to read it. By default, &kmail; stores messages encrypted, so nobody can read these messages without knowing your passphrase, or, at a minimum, your login password.

### Receiving a Public Key

You can receive a public key as an attachment, or via http, ftp, or a floppy. Before you 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 another signature that you have already trusted, you cannot use it to encrypt messages unless you sign (certify) the key with your own 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?

  All it can do is set up the filters for you; it will provide a standard setup. Manual modifications that have been applied to existing anti-spam filters are not recognized. Instead, such filters are overwritten by the wizard.

You can activate the wizard via Tools Anti-Spam Wizard.... If this choice is not available, click Settings Configure &kmail;...Plugins and check the box next to Antispam. You will be prompted to restart &kmail;; when you do, the wizard will appear on the Tools menu.

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 unusually time consuming. &kmail; can appear to be frozen during the scan of messages for spam, so 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. (This has been a problem with older hardware. It probably won't afflict more modern machines.)

Here are some observations about a few anti-spam tools.

Bogofilter

  Bogofilter is a Bayesian filter. Its spam detection ability relies on an initial training phase. On the other hand, it's a pretty fast tool. That's why it is recommended for people who want fast spam detection, and who aren't worried about putting some effort into the initial training, before the detection rate increases significantly.

SpamAssassin

  SpamAssassin is a fairly 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 more 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 have already been scanned for spam. The result of that process is documented in a special header field in each message. It's possible to use the content of this header field to filter out spam. There is very little slowdown in the filtering when this tool is used, as the messages have already been processed by the external email server.

### Advanced

&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 display all of 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 &kmail; to utilize to detect spam. If you want more choices, you can simply close the wizard, install a new tool, then restart the wizard.

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 in the Message Apply Filter > menu item, and also via a pair of icons on the toolbar. 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 piped through the tools to help them 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 have specified for spam messages, when you select the spam 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 an entry with a higher (newer) version number, the configuration data from the local file (for that tool) is used, so both administrators and users can update the wizard's 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 to incoming messages and for 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?

  All it can do is set up the filters for you; it will provide a standard setup. Manual modifications that have been applied to existing anti-virus filters are not recognized. Instead, such filters are overwritten by the wizard.

You can activate the wizard via Tools Anti-Virus Wizard.... If this choice is not available, click Settings Configure &kmail;...Plugins and check the box next to Antivirus. You will be prompted to restart &kmail;; when you do, the wizard will appear on the Tools menu.

### Advanced

The Anti-Virus Wizard basically works the same way as the Anti-Spam Wizard does. &kmail; can use several external tools to detect messages containing viruses. It will determine which of these tools are installed on your system, and will show you the results from the search. You can mark the tools which you want &kmail; to use for virus detection. If you want more choices, you can simply close the wizard, install a new tool, then restart the wizard.

If you have chosen at least one tool you will be able to select actions for &kmail; to perform on messages containing viruses. To let &kmail; detect messages containing viruses, you should mark the Check messages using the anti-virus tools option. If you want messages infected by a virus to be moved into a certain folder, select the appropriate folder and mark the Move detected viral messages to the selected folder option. If such messages should also be marked as read, select 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 account, 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). If the local config file contains an entry with a higher (newer) version number, the configuration data from the local file (for that tool) is used, so both administrators and users can update the wizard's 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 infected 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 to incoming messages and for manual filtering.