Mail

Kontact uses KMail as its email component. You can also start it separately with the command kmail. To configure it, open the mail component then select Settings+Configure KMail. KMail is a fully-featured email client that supports a number of protocols.

Figure 5.2. The Kontact Mail Component

The Kontact Mail Component

Configuring Identities

KMail can manage multiple email accounts (private or business). Creating separate identities for your different email accounts allows you to associate different sender addresses, cryptography settings and signatures with each of them. To create an identity, select Settings+Configure KMail and choose Identities+Add. Determine whether to create a new identity from scratch, use the control center settings , or whether to duplicate an existing identity.

To create a new identity from scratch, enter the name of the new identity and enter your name, organization and email address in the General tab. You can also configure one or several of the following options:

Cryptography

Set the keys to use for signing and encrypting messages. For the encryption to work, first create a key with KGpg, as described in Chapter 7, Encryption with KGpg.

Advanced

Enter a default reply-to and a default blind carbon-copy address (usually empty), choose a dictionary, select the folders for draft, sent messages, and templates, and define by which sending account the messages should be sent.

Templates

Define custom templates to use for new messages, for default replies to senders and lists, and for forwarded messages. To use templates, activate Use Custom Message Templates, first.

Signature

Click Enable Signature first to use it. Decide how your messages should be signed. Use the input field below to configure your signature or obtain it from a file or the output of a command.

Picture

Use this tab to include a picture in the X-Face format in your messages. X-Face can only hold black and white images with a dimension of 48 × 48 pixels. You can obtain the picture from the input field below or from an external source.

Creating Accounts

Before you can send or receive emails, create one or several accounts. KMail allows both remote accounts and local mailboxes. The settings under Accounts determine how Kontact receives and sends email. Many of these settings vary depending on the system and network in which your mail server is located. If you are not sure about the settings or items to select, consult your ISP or system administrator.

To configure a remote account, proceed as follows:

  1. Start Kontact and select Settings+Configure KMail+Accounts.

  2. Create an incoming account by clicking on the Receiving tab:

    1. Click Add and choose the account type. Usually it is POP3, IMAP, or disconnected IMAP.

    2. Enter your account name (can be freely choosen), the incoming mail server, login and password.

    3. Decide, if the following options are useful to your setup:

      General+Store POP password

      If you use KWallet, check Store POP password. This makes it a bit more convenient as you do not have to type in your passwords (it is taken once from KWallet, see Chapter Managing Passwords with KWallet Manager (↑KDE User Guide).)

      General+Enable interval mail checking

      If you need to be up-to-date with your mails, check this option and enter the interval.

      Advanced+Leave fetched messages on the server (POP3 only)

      KMail can leave the original message on the server and receive a copy. Especially for POP3 accounts, this could be useful, if you need the mail on a different computer.

      Advanced+Use default identity (IMAP/disconnected IMAP only)

      This option lets you choose your identity.

    4. Proceed with OK.

  3. Create an outgoing account by clicking on the Sending tab and click Add to choose either SMTP or Sendmail:

    • If you select SMTP (the default), enter an account name and the host name of the SMTP server. Should the server require login and password, also check Server requires authentication and enter the required credentials. Configure additional security settings using the Security tab.

    • If you select Sendmail, no further configuration is required.

  4. Apply your settings and leave the account configuration dialog with OK.

To configure a local mailbox, proceed as follows:

  1. Start Kontact and select Settings+Configure KMail+Accounts.

  2. Create an incoming account by clicking on the Receiving tab:

    1. Click Add and choose Local mailbox or Maildir mailbox.

    2. Enter your account name. Choose any name you like.

    3. Decide which locking method you want. Usually you can leave it on Procmail lockfile

    4. Proceed with Ok.

  3. Create an outgoing account as described in Step 3.

Composing Messages

To compose new messages, select Message+New Message or click the corresponding icon in the toolbar. To send messages from different email accounts, select one of the identities as described in Section 5.2.1, “Configuring Identities”. Select View+Identity to show a popup menu. In To, enter an email address or part of a name or address in your address book. If Kontact can match what you enter to something in the address book, a selection list opens. Click the desired contact or complete your input if none matches. To select directly from the address book, click the Select... button next to the Address field.

To attach files to your message, click the paper clip icon and select the file to attach. Conversely, drag a file from the desktop or another folder to the New Message window or select one of the options in the Attach menu. Normally, the format of a file is recognized correctly. If the format is not recognized, right-click the icon. From the menu that appears, select Properties. Set the format and filename in the next dialog and add a description. In addition, decide whether the attached file should be signed or encrypted.

When you are finished composing your message, send it immediately with Message+Send or move it to the outbox with Message+Send Later. If you send the email, the message is copied to sent-mail after having been sent successfully. Messages moved to the outbox can be edited or deleted.

Managing Folders

Message folders help organize your messages. By default, they are located in the ~/.kde4/share/apps/kmail/mail directory. When starting KMail for the first time, the program creates several folders. If you are using IMAP, the IMAP folders are listed below the local folders. Each incoming mail server has its folders in the Folder list.

If you want to organize your messages in additional folders, select from your list your parent folder and create new folders by selecting Folder+New Folder. This opens a window in which to specify the name and format of the new folder.

Right-click the folder for a context menu offering several folder operations. Click Expire to specify the expiration date for read and unread messages, what should happen with them after expiration, and whether expired messages should be deleted or moved to a folder. If you intend to use the folder to store messages from a mailing list, set the necessary options under Folder+Mailing List Management.

To move one or several messages from one folder to another, drag them from the upper window and drop them into the appropriate folder in the left window. Messages can also be moved by highlighting the messages then pressing M or selecting Message+Move to. In the list of folders that appears, select the folder to which to move your messages.

Additionally, you can add folders to the Favorite Folders pane. This enables you to go quickly to your frequently used mail folders, especially if your folders are deeply structured. Choose the relevant folder and select Add to Favorite Folders.

Signing and Encrypting emails

Email is an insecure medium, as anyone could theoretically read your emails or send some in your name. By signing your emails you enable the recipient of your emails to verify the sender of the messages as the key used to sign is only available to you. By encrypting the contents of your emails you ensure that they can only be read by the recipient. KMail supports both the signing and encryption of emails.

Prepare KMail for signing and encrypting emails:

  1. Generate a key pair as described in Section 7.2, “Generating a New Key Pair” and export your public key as described in Section 7.3, “Exporting the Public Key”.

  2. Configure the details of the encryption procedure in KMail:

    1. Start KMail and go to Settings+Configure KMail+Identities.

    2. Select the identity under which to send encrypted and signed messages. Click Modify... and proceed to Cryptography.

    3. Change the OpenPGP signing key by clicking on Change... and selecting your key from the dialog box.

    4. Change the OpenPGP encryption key by clicking on Change... and selecting your key from the dialog box.

  3. Change to Security+Composing and check When encrypting emails, always also encrypt to the certificate of my own identify. With this option you can decrypt the message or file at any time.

  4. Apply your settings and leave the configuration dialog with OK.

Sending Signed Mails

Sign your emails to allow the recipient to verify whether these have really been sent by you. KMail uses your private key to sign your messages and the recipient can verify the signature using your public key available on key servers. To sign an email, proceed as follows:

  1. Compose your email as usual.

  2. Select Options+Sign Message.

  3. If you know the recipient can download your public key from a key server, you can omit this step. For convenience reasons, select Attach+Attach My Public Key to create an attachment to your email containing your public key.

  4. Send your message as usual via Message+Send Mail and enter your key's passphrase when prompted. KMail signs your message using your private key and the recipient can verify the signature by the public key attached to your message.

Sending Encrypted Mails

Use encryption on your emails whenever you want to make sure that only the recipient can read the contents. To be able to exchange encrypted emails with another party, get the appropriate public key and use it to encrypt your message. At the other end, the private key is then used to decrypt the contents of your message. Of course, you can use both signatures and encryption on your messages.

To send an encrypted email, proceed as follows:

  1. Start KGpg with Alt+F2 and entering kgpg.

  2. Get the recipient's public key:

    • If you get it directly from the recipient, import the key with KGpg via Keys+Import Key.

    • Access a public key server and import it from there. Select in KGpg File+Key Server Dialog, and search for the key. Select the respective key and import it into your keyring.

  3. Compose a new message in KMail.

  4. Select Options+Encrypt Message. In the mail window a blue line Message will be encrypted is displayed.

  5. Send the mail. A dialog window opens and asks you for the correct key.

  6. Check whether all keys are correct.

  7. Enter your passphrase.

Importing Email from Other Mail Programs

To import email from other applications, select File+Import Messages from the mail view in Kontact. It currently features import filters for Outlook Express, the mbox format, email text format, Pegasus Mail, Opera, Evolution, and more. The import utility can also be started separately with the command kmailcvt.

Select the corresponding application and confirm with Continue. A file or a folder must be provided, depending on the selected type. KMail then completes the process.

Filters

Filters are a convenient method of automatically processing incoming mail. They use aspects of the mail such as sender or size, to move mail to certain folders, delete unwanted mails, bounce mails back to the sender, or perform a number of other actions.

Setting Up a Filter

To create a filter based on an existing message, right-click the desired message then select Create Filter and the desired filter criteria. To create a filter from scratch, select Settings+Configure Filters.

Select the match method for filter criteria (all or any). Then select criteria that applies only to the desired messages. In Filter Actions, set what the filter should do to the messages that meet the criteria. The Advanced tab provides control over whether the filter is applied for specific accounts only.

Applying Filters

Filters are applied in the order listed in the dialog accessed with Settings+Configure Filters. Change the order by selecting a filter and clicking the arrow buttons. Filters are only applied to new incoming messages or sent messages as specified in the filter's advanced options. To apply filters to existing messages, right-click the desired messages and choose Messages+Apply Filter and the desired filter.

If your filters do not act as expected, monitor them with Tools+Filter Log Viewer. When logging is enabled in this dialog, it shows how messages are processed by your filters and can help locate the problem.