Chapter 6. Frequently Asked Questions (FAQ)

Daniel Naber

David Rugge

Revision KDE 4.8 (2012-07-19)
6.1. How to set Firefox as your default browser?
6.2. How to control your Roaming profile's connection?
6.3. How to store sent mails in a special folder?
6.4. How to store trash mails in a special folder?
6.5. How to store encrypted mails as unencrypted?
6.6. How to filter spam on an IMAP server?
6.7. How to get more screen space in KMail?
6.8. How to unconfigure KMail folder tool tips?
6.9. How to unconfigure KMail message list tool tips?
6.10. How to remove alternate line colourings?
6.11. How to transfer mail and settings to another computer (or another user account on the same machine)?
6.12. Why am I not able to copy mails to a USB stick?
6.13. Why are my filters not applied to incoming messages of IMAP accounts?
6.14. Using PGP or GnuPG is very slow or it blocks KMail.
6.15. What should I know if I want to use PGP/GnuPG with KMail?
6.16. Where does KMail save my settings and my mail?
6.17. Why did KMail regenerate the index of a folder?
6.18. Why does KMail not start up?
6.19. Can I use KMail together with a different email client, e.g. mutt?
6.20. How can I convert my mailboxes from mbox to maildir?
6.21. How can I remove attachments from messages without removing the message itself?
6.22. How can I make KMail check for new messages at startup?
6.23. Where can I get a list of changes between the versions of KMail?
6.24. Can I configure the location of my mail folder?
6.25. How can I use mail folders that are not in the normal KMail message folder location?
6.26. I'm one of those people whose mails consist of 100 quoted lines and one line written by myself. For some reason this annoys other people. Can KMail help me and make everyone's life better?
6.27. For some messages the value in the Date field is unknown or it is not correct.
6.28. My signature has two dashes above it. What's up?
6.29. KMail fetches the same messages over and over again.
6.30. Are there any known bugs in KMail?
6.31. KMail does not display HTML mail properly.
6.32. Can I use two different versions of KMail at the same time? Can I go back from a current version of KMail to an older one?
6.33. Does KMail support uuencoded files?
6.34. KMail crashed while I was writing a mail; is that mail lost now?
6.35. When I try to set a folder to be mailing list-aware, it does not do anything when receiving an email from the list.
6.36. My SMTP server requires authentication; Does KMail support this?
6.37. Can I use KMail and procmail?
6.38. Spellchecking does not recognize non-English characters.
6.39. How do I use my Eudora/Netscape®/Outlook/... mail folders in KMail?
6.40. Can I use encryption with my normal (non-SSL) POP3 account?
6.41. Does KMail lock the folders it uses?
6.42. How do I leave messages on the POP3 server?
6.43. How do I automatically insert a text footer within my messages?
6.44. How do I set up sendmail® to work with KMail if I have a dial-up connection?
6.45. I've seen demonstrations of remote control behavior with KMail. Is there any documentation on the available interfaces?
6.46. When I reply to a message, only a part of the message is quoted. How come?
6.47. I am only using IMAP, can I get rid of those Local Folders in the folder list or at least keep them collapsed all the time?
6.48. How to watch the threads?
6.49. How to watch your own threads?
6.50. How to use E-Mail Translation?

6.1.

How to set Firefox as your default browser?

You want to click on a link in KMail and have it opened in Firefox. At the moment, another browser is used. You want to change this.

This solution will affect all of KDE, not just KMail. Start System SettingsDefault ApplicationsWeb BrowserOpen http and https URLs in the following browserfirefox.

If you are an administrator and want to set this setting automatically for your users, it is

  • for SUSE Linux:

    in your user directory in .kde4/share/config/kdeglobals add the line BrowserApplication[$e]=!firefox under category [General]

  • for all other Linux distributions:

    in your user directory in .kde/share/config/kdeglobals add the line BrowserApplication[$e]=!firefox under category [General]. If General category does not exist you should add it.

You can also use the script in Tutorials/Modify_KDE_Software_Defaults

6.2.

How to control your Roaming profile's connection?

You set up a Roaming profile to access your home server while you are on the road, but it keeps trying to connect even when you are at home. Auto-connection is disabled in the setup screens.

SettingsConfigure KMailAccountsReceiving (tab)(select the account to exclude)Retrieval Options, uncheck Include in Manual Mail Check. This will exclude the profile when you hit the download icon, but the profile will still be available from the drop-down list, making it easy to get your mail while away from home.

6.3.

How to store sent mails in a special folder?

Symptom: You want to store mails in a special folder. Maybe you are using an IMAP server and want to store your mails on the server, not in the client.

Solution: In KMail, choose SettingsConfigure KMailIdentities(Choose an identity)ModifyAdvancedSent-mail folder

6.4.

How to store trash mails in a special folder?

Symptom: You want to store mails in a special folder. Maybe you are using an IMAP server and want Trashed mails to be stored on the server, not in the client.

Solution: In KMail, choose SettingsConfigure KMailAccountsReceiving tab(Choose an account)ModifyAdvancedTrash folder

In some versions you will need SettingsConfigure KMailAccountsReceiving tab(Choose an account)ModifyIMAP settings tabTrash folder (or Wastebin folder, depending on your distro)

6.5.

How to store encrypted mails as unencrypted?

Symptom: You exchange encrypted mail with a friend, but would like to store it unencrypted, once you have opened the message.

Solution: To store emails that have been decrypted once in unencrypted format henceforth, add this to your kmailrc configuration file, in the [Reader] section:

store-displayed-messages-unencrypted=true

This may only work with SMIME but implementation for OpenPGP is being worked on.

6.6.

How to filter spam on an IMAP server?

Symptom: You intend moving on to reading your mail from an IMAP server, and wonder how filtering and spam handling will occur?

Solution: The machine that already has your mail can become your IMAP server. You will need to configure a server application. Dovecot is one such, and the guidance on the project web pages make it easy to set up. That still leaves you with the problem of filtering, as it makes sense to do it on the server (when you point KMail at the server you will see the folders that you have created on the server). Again there are options, but one of the best known is procmail. Again there is plenty of information on the Internet on how to set this up. You give it a set of recipes - here's an example:

    :0
    * (^To|^CC|^List-ID): .*kde-linux
    ${MAILDIR}.INBOX.KDE-Lists.kde-users/
  

If you have maildir folders, each recipe must end with a /. If your folders are mbox, just omit the /

If you have been using bogofilter with KMail you will already have a wordlist. This can be used at server level, too, so you will not have to start training from scratch. The trick is to set this before the procmail recipes:

:0fw
 | bogofilter -e -p

0e
 { EXITCODE=75 HOST }

0:
 * ^X-Bogosity: Spam, tests=bogofilter
 ${MAILDIR}.INBOX.a-Spam/

0e
 { EXITCODE=75 HOST }

0:
 * ^X-Bogosity: Unsure, tests=bogofilter
 ${MAILDIR}.INBOX.a-Unsure/

0e
 { EXITCODE=75 HOST }
 

Note that it is going to use a mailbox for spam and one for unsure - I add a 'a-' to the name to ensure that they are easily seen, at the top of the list.

Finally, to improve performance, run the following command occasionally on saved spam and unsures:

/usr/share/bogofilter/contrib/trainbogo.sh -c -H /home/user/Maildir /.INBOX.bogotrain_ham/cur/ -S /home/user/Maildir/.INBOX.bogotrain_spam/cur/

(don't forget to check the path.)

This is not a complete guide to setting up a server, but notes on how to set up the server to work as you expect in KMail.

6.7.

How to get more screen space in KMail?

Symptom: You are using KMail on a netbook, and find that the new Aggregation display leaves you little screen space

Solution:If you want to change the look so that a mail uses a single row instead of two rows, go to ViewMessage ListTheme and change the theme to Classic. If you want to disable grouping by date, change the aggregation using ViewMessage ListAggregation to Standard Mailing List. Now your KMail will look exactly like it did in earlier versions.

In SettingsConfigure KMailAppearanceFonts you can select Use custom fonts and change the setting for each component in the list. This is when you discover that your folder list and the message bodies do use the fonts you want, but the message list still has too large a font.

You can make the font changes by right-clicking on the Message List headers, and selecting ThemeConfigureAppearance Tab. Each one of those column headers needs to be clicked on, and your new custom font set. At the end of this, the message list will display in the same font as the rest of your layout.

6.8.

How to unconfigure KMail folder tool tips?

Symptom: You are using KMail on a netbook, and find that the tooltips over folders hide too many folder names

Solution: Right-clicking on the header of the Folder List and unselect Display Tooltips. In the settings dialog you can also select When Text Obscured. When Text Obscured is handy for folders that have long names, so that only a part of the name is displayed. Folders where you can see the full name will not pop up the tooltip.

6.9.

How to unconfigure KMail message list tool tips?

In KMail, SettingsConfigure KMailAppearanceMessage List uncheck GeneralDisplay tooltips for messages and group headers

6.10.

How to remove alternate line colourings?

In System SettingsApplication AppearanceColorsColors, for each color set except Common Colors (which doesn't have it), change the Alternate Background to be the same as the Normal Background.

Mandriva and Mageia doesn't use the name System Settings. As in KControl, the KDE 3 control centre, they name it Configure your Desktop to distinguish it from Configure your Computer, a.k.a. the Mandriva/Mageia Control Center (MCC). Other than this name change, the method is as described above.

6.11.

How to transfer mail and settings to another computer (or another user account on the same machine)?

The messages are typically in ~/.kde/share/apps/kmail/. For very old installations of KMail, the messages can also be in ~/Mail. Note that KMail uses hidden sub-directories inside that directory, so you need to make sure to copy hidden directories as well.

For settings you will need to copy the following files:

  • ~/.kde/share/config/kmailrc,

  • ~/.kde/share/config/mailtransports, (since KDE 4.0)

  • ~/.kde/share/config/emaildefaults and

  • ~/.kde/share/config/emailidentities .

Your address book is usually stored in ~/.kde/share/apps/kabc/. Calendar data is in ~/.kde/share/apps/korganizer

Note

Be aware that some distributions use ~/.kde4 instead of ~/.kde/ for their KDE configuration data. Look at the output of the command kde4-config --localprefix if in doubt.

From version 4.4 you may have some Akonadi-controlled entries that also need to be kept. Add to the above list -

  • Everything under ~/.local/share/

  • Everything under ~/.config/akonadi/.

  • ~/.kde/share/config/nepomukserverrc

  • Everything under ~/.kde/share/apps/nepomuk/ (KAddressBook stores contact groups in Nepomuk.)

If you plan to use an USB stick as transport medium for your data, be sure to read the next section.

6.12.

Why am I not able to copy mails to a USB stick?

Symptom: You are setting up a new computer and want to transfer all your mail. You decide to copy everything to a USB stick. The job starts, then you start to get failure message,

Unable to copy ............Invalid argument

Solution: Your usb stick is (V)FAT formatted, and thus can't handle maildir folder names (nor can it handle permissions, which can cause many other problems). You have two choices. Either format your USB stick as ext2 (in which case you should be aware it can't be read on Windows® OSes without installing additional software there) or create a tar file of all your mail, copy that to the stick and extract it to your new host.

6.13.

Why are my filters not applied to incoming messages of IMAP accounts?

Normal IMAP mode does not support filtering, but the new disconnected IMAP account type does. You could try to use server-side filtering (ask your admin for how to install filters on the server and in which format), since IMAP is all about managing your email on the server. Unfortunately, although there exists a mail filter language (Sieve, defined in RFC3028), there is no standardized access protocol for installing or editing server-side Sieve scripts. If such a protocol becomes available in the future, KMail will most probably include support for it.

6.14.

Using PGP or GnuPG is very slow or it blocks KMail.

KMail accesses PGP/GnuPG synchronously, i.e. it blocks while PGP/GnuPG works. This means that you might want to disable automatic retrieval of unknown keys from a keyserver to make KMail look more responsive. If you are using GnuPG 1.0.7 (or better) or upgraded from an earlier version, then make sure to run gpg --rebuild-keydb-caches once and gpg --check-trustdb after every import or refresh. Both will speed up GnuPG immensely.

6.15.

What should I know if I want to use PGP/GnuPG with KMail?

KMail provides a simple and easy-to-use interface for the basic functions of these programs; still you should understand how these programs work and what might make their use insecure. Some important issues:

  • You really should test if encryption works before you use it. KMail partly relies on PGP/GnuPG's error strings, which often change between different versions.

  • KMail will not encrypt messages with an untrusted (unsigned) public key: if you want to encrypt to such a key you should check the identity of the key owner and only then sign the key with your secret key; if you do not want to or cannot check the identity of the key owner but nevertheless want to encrypt the message then please sign the key locally with gpg --lsign keyID.

  • Trusting a foreign public key without checking it is not a good idea.

  • KMail cannot encrypt and sign attachments if you are using the built-in OpenPGP support. For encrypted and signed attachments you need to have crypto plugins installed and configured.

  • Starting with GnuPG 1.0.7 you have to set your own key to ultimate ownertrust: it is no longer implicitly done for you.

6.16.

Where does KMail save my settings and my mail?

Most KMail settings are stored in $KDEHOME/share/config/kmailrc, where $KDEHOME is typically ~/.kde. From version 4.4 Akonadi-controlled entries are stored in the following folders and files:

  • ~/.local/share/

  • ~/.config/akonadi/.

  • ~/.kde/share/config/nepomukserverrc

  • ~/.kde/share/apps/nepomuk/ (KAddressBook stores contact groups in Nepomuk.)

Note that some of the files are hidden: remember to also copy those if you want to backup or archive your mails.

6.17.

Why did KMail regenerate the index of a folder?

KMail regenerates the index of a folder whenever the index appears to be out of date, i.e. whenever the contents of a folder are newer than the index. KMail regenerates the index in this case in order to prevent the loss or corruption of messages. Unfortunately, currently-deleted messages might reappear and message flags (like important, etc.) might be lost when the index is regenerated.

An outdated index can have several causes; the two most important causes are:

  • Some other program modified the contents of the folder: if you want to use KMail together with procmail then please read this FAQ. If you want to use KMail together with another email client then please read this FAQ.

  • If your mail folder (usually $KDEHOME/share/apps/kmail/ or ~/Mail) is on a volume which is mounted via NFS and if the clock of the NFS server is ahead of the clock of your computer then the NFS server sometimes reports a wrong file date for the index file. In this case KMail assumes that the index is outdated although in reality it is not. To fix this problem you (or your system administrator) have to make sure that the clock of the NFS server and the clock of your computer are always in sync. One way to achieve this is the use of the ntp daemon.

6.18.

Why does KMail not start up?

Symptom: You want to start KMail from a minimal desktop environment like fvwm2. It does not start.

Reason: You are missing the dbus functionality.

Solution: Start KMail using dbus-launch like this:

dbus-launch kmail

6.19.

Can I use KMail together with a different email client, e.g. mutt?

If you're using the mbox format for your folders it is not possible to use a different email client while KMail is running. With mutt there may also be problems even if both programs are not running at the same time. We recommend to use the maildir format in this case, this should solve all problems.

6.20.

How can I convert my mailboxes from mbox to maildir?

There is no automatic way to do that. You will have to create a new folder in maildir format and copy the messages from the mbox folder into this new folder. Remember to adapt any filter rules connected with the old folder before you delete it.

6.21.

How can I remove attachments from messages without removing the message itself?

This is currently not supported. As a workaround, move the message to the drafts folder, double click on it in order to open it in the composer, remove the attachments, save the message again to the drafts folder, move it back to its folder. The disadvantage of this workaround is that the date will be changed to the current date. Some other headers might also be changed.

6.22.

How can I make KMail check for new messages at startup?

If KMail should always check for new messages at startup then enable Check mail on startup on the Accounts configuration page. Otherwise start KMail with kmail --check.

6.23.

Where can I get a list of changes between the versions of KMail?

The welcome screen lists all important changes for your version. It is displayed when you select HelpKMail Introduction.

6.24.

Can I configure the location of my mail folder?

Exit KMail, make a backup of ~/.kde/share/config/kmailrc, then open it with an editor and add e.g. folders=/home/username/.mail to the [General] section. Then move all your existing folders (including the hidden index files) to the new location. The next time you start KMail will use /home/username/.mail instead of /home/username/.kde/share/apps/kmail. Note that KMail will lose its filters if you change the mail folder's location but forget to move your existing folders.

6.25.

How can I use mail folders that are not in the normal KMail message folder location?

To add a whole mbox mail folder use ln -s /somewhere/Mail/.remotedir.directory /home/username/share/apps/kmail/.mymailboxfile.directory. Note that it is not possible to use links to files, only links that point to folders will work.

6.26.

I'm one of those people whose mails consist of 100 quoted lines and one line written by myself. For some reason this annoys other people. Can KMail help me and make everyone's life better?

Sure. Just select a short relevant part of the original mail with the mouse before you reply. Only this part will then be quoted in your reply.

6.27.

For some messages the value in the Date field is unknown or it is not correct.

Probably the Date: header of these messages is broken and KMail cannot interpret it. That is not a bug in KMail but in the software that sent the mail.

6.28.

My signature has two dashes above it. What's up?

Separating the signature from the message body with two dashes and a space on a single line is common usage. These symbols permit mail clients who recognize them to trim the signatures from a reply. If your signature does not already have this separator, KMail will automatically add it.

6.29.

KMail fetches the same messages over and over again.

This happens if you have enabled Leave fetched messages on the server and your POP3 server does not support the UIDL command. There is currently no workaround besides disabling Leave fetched messages on the server. A more detailed explanation can be found in this mailing list post.

6.30.

Are there any known bugs in KMail?

A list of submitted bugs can be obtained by the query from the Bugzilla page. Note that not all these bugs are valid. All in all we think that KMail is a very robust piece of software.

Warning

However, you should not run KMail while another email client is already accessing the files in the mail directory; if you try to do so, you might lose messages. Note that you should make backups of your messages anyway.

6.31.

KMail does not display HTML mail properly.

References to external content like images, are disabled by default, as they can be used to track whether and when you read a message. Loading external references can be activated in the Security tab in KMail's configuration dialog; also Plugins (like Adobe® Flash), Java™ and JavaScript will not be displayed in KMail for security reasons and there is no way to activate them.

6.32.

Can I use two different versions of KMail at the same time? Can I go back from a current version of KMail to an older one?

You can only run one instance of KMail at a time. We also recommend to stick to a certain version and not switch back and forth between different versions. Downgrading to an older version will probably cause problems, e.g. because the index file formats might have changed. Upgrading should never be a problem.

6.33.

Does KMail support uuencoded files?

Uuencoded attachments are supported, but inline uuencoded files are not.

6.34.

KMail crashed while I was writing a mail; is that mail lost now?

KMail tries to save your mail to ~/.kde4/share/apps/kmail/autosave in case of a crash. The next time you start KMail the mail composer should appear with your mail again; If it does not, try to open the files in ~/.kde4/share/apps/kmail/autosave with an editor. If there are no files in this folder then the crash was so bad that KMail could not save your mail.

6.35.

When I try to set a folder to be mailing list-aware, it does not do anything when receiving an email from the list.

Associating a folder with a mailing list has nothing to do with filtering the mailing list messages — you have to add a new filter rule manually; however, once you associated a folder with a mailing list you can use MessageReply to Mailing-List... or MessageNew Message to Mailing-List... and the mailing list address will be set in the To: field.

6.36.

My SMTP server requires authentication; Does KMail support this?

There are two common techniques used for SMTP authentication: SMTP after POP3 and SMTP Auth. SMTP Auth can be set in the General tab of the SMTP configuration dialog. To use SMTP after POP3 you have to collect all your messages in the outbox and send them just after you have fetched new mail. You can make KMail send the queued messages automatically with the Send messages in outbox folder option on the Accounts configuration page.

6.37.

Can I use KMail and procmail?

Yes, but it is important to do it the right way or you might lose mail. In order to use procmail and KMail you need to set up KMail so that it will fetch new mail from the spoolfiles in which procmail drops your mail. Do not set up procmail to deliver mail in a KMail folder, this cannot work.

For each procmail spoolfile you then need to create an account from which KMail will fetch new mail; you also need to make sure you specify the right lockfile name for this account. When setting up an account, KMail will do some minimal parsing on your .procmail file, and will try to list every spoolfile it has found, and also the lockfiles next to the procmail lockfile item. procmail lets the user specify lockfiles in three different ways, so there is no way to establish a correspondence between the spoolfiles and lockfiles; so it's really up to you to make sure you specify the right lockfile for each spoolfile.

6.38.

Spellchecking does not recognize non-English characters.

Before you can use spellchecking the first time, you have to configure it. You can do so in the composer window's menu under SettingsSpellchecker.... You can set the dictionary and the encoding there.

6.39.

How do I use my Eudora/Netscape®/Outlook/... mail folders in KMail?

See the section Using other Mailbox files with KMail.

6.40.

Can I use encryption with my normal (non-SSL) POP3 account?

If your POP3 server runs an ssh daemon, you can use ssh to tunnel your POP3 connection using the following command:

ssh -L 11000:127.0.0.1:110 user@host

Modify your KMail configuration to fetch the mail via POP3 from localhost and ssh will tunnel the connection for you.

Note

If non-encrypted messages have already been sent via Internet, the only advantage of using ssh is that your password will be sent encrypted to the POP3 server.

6.41.

Does KMail lock the folders it uses?

KMail does not lock the files in ~/Mail.

To avoid the risk of losing mail if using a local account it is necessary to ensure that KMail uses the same type of locking as your mail delivery agent.

There are five different locking options you can use:

  • Procmail lockfile

  • Mutt dotlock

  • Mutt dotlock privileged

  • FCNTL (default)

  • none (use with care)

Procmail lockfile will use a small utility that comes with procmail called lockfile. You can use this if your mail folder is in a folder where you have write permission. This will not work on your /var/spool/mail/user file in most cases. It will create .lock files on your account when KMail is checking for new mail. Please note that this will only work if procmail is installed on your system.

Mutt dotlock and Mutt dotlock privileged will both use a small utility that comes with mutt called mutt_dotlock. Mutt dotlock can be used in the same way as the Procmail lockfile option, with the same limitation with regards to the /var/spool/mail/ folders. However, the Mutt dotlock privileged option can create lock files in the /var/spool/mail folder. mutt_dotlock is a setgid program and this option will run it in setgid mode. Please note that these options will only work if mutt is installed on your system.

FCNTL will use the fcntl() system call.

Warning

Usage of FCNTL locking might cause system lockups when the mail spool file is on an NFS mounted device.

If you do not want to use any locking, the none option is what you want. However, there are risks of losing mail when no locking is used.

6.42.

How do I leave messages on the POP3 server?

If you want to leave all messages on the server: open up the SettingsConfigure KMail... window. Click on the Accounts page. Select your account from the account list and click the Modify... button. This dialog contains the Leave fetched messages on the server setting which you must enable.

6.43.

How do I automatically insert a text footer within my messages?

The text footer is also called a signature (not to be confused with a cryptographic signature). Select SettingsConfigure KMail.... Look in the Identity page for the Signature tab and add your signature there. Then go to the General tab on the Composer page and enable Automatically insert signature

6.44.

How do I set up sendmail® to work with KMail if I have a dial-up connection?

First you should check if your distribution can do this for you. It probably has already been set up during installation.

If that is not the case, you may want to have a look at the Mail Queue HOWTO.

6.45.

I've seen demonstrations of remote control behavior with KMail. Is there any documentation on the available interfaces?

You can get a list of functions by using this command in a shell: qdbus org.kde.kmail /KMail. Then you can control KMail like this: qdbus org.kde.kmail /KMail org.kde.kmail.kmail.folderList. You can use qdbusviewer to browse available methods in a graphical interface.

6.46.

When I reply to a message, only a part of the message is quoted. How come?

This can happen when the message contains two dashes and a space on a single line. This is seen as the start of the signature. The remaining part of the message will not be quoted, because when you reply to a message KMail strips the signature.

6.47.

I am only using IMAP, can I get rid of those Local Folders in the folder list or at least keep them collapsed all the time?

No, you cannot get rid of them. The local folders function as a fallback when the IMAP server is unreachable. Although you only use IMAP, KMail uses the outbox for sending the messages. If we hide all local folders you will not be able to fix messages in the outbox which cannot be send for some reason. But it is possible to keep the local folders collapsed. What you have to do is go to Settings Configure KMail... and go to the section Misc, there you can setup the folder on startup. If you change that to a folder on the IMAP account, the Local Folders will stay collapsed when KMail starts.

6.48.

How to watch the threads?

If you want to follow a thread, right click and choose Mark ThreadWatch Thread.

From this point on all messages on the thread that starts in this message will be marked as Watched.

6.49.

How to watch your own threads?

This is useful in case you are registered to a mailing list such as kdepim-users@kde.org and want to filter out the threads you participate in.

  • Create a filter to mark all your incoming messages to a mailing list as Watched

    To create a filter go to:

    SettingsConfigure Filters

    • select Match all of the following

    • Add the conditions:

      • FromContains yourmail@maildomain[5]

      • List-IdContains listID[6]

    • Under Filter Actions choose Mark AsWatched.

  • In the Advanced tab

    • Uncheck if this filter matches, stop processing here, so that other filters such as sorting the incoming messages from the mailing list to sub-folders would execute.

    • Place that filter before other filters that may stop the filtering process, or simply put it first. (changing the filters order is done using the two arrows up and down, under the Available filters list)

  • Create a search on mailing list messages

    Go to the folder where your mailing list messages are stored (e.g. Local Folders/KDE-PIM-USERS) and hit S key or in the menu EditFind Messages.

    • Select Match all of the following[7]

    • Add the condition: Message StatusisWatched

    • Give the search an informative name (Search folder name) like KDE-PIM-USERS-Watched

    • Make the search. After it is done you can close the search window.

    Now whenever you start a thread or participate in one, it is Watched.

6.50.

How to use E-Mail Translation?

Symptom: you receive mail messages in different languages and want to translate them without doing lots of copy and paste.

Solution: using an external program to translate our E-Mail and display it.

Step by step implementation

Warning

The provided solution was tested limited number of times and should be used with caution.

  • Prerequisites, make sure you have these before starting

    • libtranslate

    • perl

    • perl module Email::MIME

    • kmail

  • Setting up a pipe filter

    • In KMail go to SettingsConfigure filters

    • create a new filter and name it Translate

    • add a Filter Criteria that would be always true (e.g. SubjectDoes not equal321546543)

    • add a Filter Action Pipe Through ~/bin/mail_translate.pl

    • open the Advanced tab and un-check everything except for Add this filter to the Apply Filter menu, you can also set a shortcut and an icon here.

  • Putting the script in place and configuring it

    • save the following script to a file named mail_translate.pl and put it in your ~/bin directory.

      #!/usr/bin/perl
      use Email::MIME;
      my $from_language = 'en';
      my $to_language = 'he';
      my $translation_command = "translate ";
      my $languages_pair = "-f $from_language -t $to_language";
      my $line;
      my $message='';
      while ($line=<>)
      {
          $message.=$line;
      }
      my $email = Email::MIME->new($message);
      my @parts = $email->parts;
      my $separator = `echo "translation" | $translation_command -f en -t "$to_language" -`;
      chop $separator;
      rec_parts ($email,@parts);
      sub rec_parts
      {
          my $parent = $_[0];
          my @parts = $_[1];
          for $part(@parts)
          {
      	my @sub_parts = $part->parts;
      	if (@sub_parts > 1)
      	{
      	    rec_parts ($part,@sub_parts);
      	}
      	my $type=$part->content_type;
      	if (( $part->content_type =~ m[text/plain]gi )||( $part->content_type eq ''))
      	{
      	    my $body = $part->body;
      	    $body=~s/['"`]*//g;
      	    my $translation_body=`echo "$body" | $translation_command $languages_pair -`;
      	    $translation_body=~s/['"`]*//g;
      	    my $msg=$body."\n\n---"."$separator"."---\n\n".$translation_body;
      	    `kdialog --title "$separator" --msgbox "$msg"`;
      	}
          }
      }
      print $email->as_string;
      

  • Make the script executable using $chmod a+x ~/bin/mail_translate.pl

  • Configuring the script to suit your needs.

    • Currently the script will translate from English (en) to Hebrew (he), you probably need another type of translation. To change that settings look inside the script for the phrase $from_language = 'en' and $to_language = 'he' and replace the 'en' and 'he' parts with the combination you need, if you are not sure, a full list of language codes is available from the ISO 639-2 list.

    • Testing

    • before changing innocent emails and translating them, first try that on something you don't mind to lose, look in your trash or spam folder. Right click on any translatable item, choose Apply FilterFilter Translate. A dialog box should popup with the original message followed by its translation.

    • Troubleshooting

    • If the script is not working you can test it outside of KMail to narrow down the responsible component. Save a mail message as 1.mbox file and run in the terminal $~/bin/mail_translate.pl <1.mbox >2.mbox

If the output file 2.mbox is not the same as 1.mbox then there is a problem in the script and it should not be used.

Note

this script will only translate the Plain Text parts of an email message and not the HTML parts.



[5] replace yourmail@maildomain with your outgoing mail address

[6] replace listID with a specific mailing list id e.g. (<kdepim-users.kde.org>) or just a . to include outgoing mail to all mailing lists with . in their id (basically all).

[7] Pay attention to the Include sub-folders.