KMail/FAQ Aides et Conseils

From KDE UserBase Wiki
Revision as of 13:29, 24 November 2010 by Loquehumaine (talk | contribs) (Created page with "''Symptôme :'' Vous utilisez ''KMail''sous KDE 4.2 ou une version ultérieure sur un netbook, et constatez que les ''info-bulles'' sur les dossiers cachent trop de noms de doss...")

Est-ce que mon problème est déjà connu ?

Symptôme : Vous avez un problème avec KDE-PIM et voulez savoir si d'autres ont signalé et résolu le problème. Vous vous demandez comment lire les archives de la liste de diffusion KDE-PIM.

Solution : C'est une bonne habitude à cultiver. Essayez les archives MARC à http://lists.kde.org/?l=kdepim-users&r=1&w=2


Configuration

Stocker les courriers envoyés dans un dossier spécial

Symptôme : Vous souhaitez stocker des courriers dans un dossier spécial. Peut-être que vous utilisez un serveur IMAP et vous souhaitez stocker vos courriers sur le serveur, pas dans le client.

Solution : Dans Kmail, choisissez Configuration -> Configurer KMail - Identités -> (Choisissez une identité) -> Modifier -> Avancées -> Dossier des messages envoyés


Stocker les messages supprimés dans un dossier spécial

Symptôme : Vous souhaitez stocker des courriers dans un dossier spécial. Peut-être que vous utilisez un serveur IMAP et vous souhaitez stocker vos courriers supprimés sur le serveur, pas dans le client.

Solution: Dans Kmail, choisissez Configuration -> Configurer KMail -> Comptes -> onglet Réception -> (Choisissez un compte) -> Modifier -> Avancé -> Dossier de la corbeille

Dans certaines versions, vous aurez besoin de faire Configuration -> Configurer KMail -> Comptes -> onglet Réception -> (Choisissez un compte) -> Modifier -> Paramètres de l'onglet IMAP -> Corbeille (Ou dossier poubelle, selon votre distribution)


Mails cryptés stockés en clair

Symptôme : Vous échangez des courriers cryptés avec un ami, mais voulez les stocker en clair, une fois que vous avez ouvert le message.

Solution : Pour stocker des courriers qui ont été déchiffrées une fois en clair, ajouter ceci à votre fichier de configuration kmailrc, dans la section [Reader] :

store-displayed-messages-unencrypted=true

Ceci peut ne marcher qu'avec SMIME mais la mise en œuvre pour OpenPgP est en cours d'élaboration.


Filtrage anti-spam sur un serveur IMAP

Symptôme : Vous avez l'intention de passer à la lecture de votre courrier depuis un serveur IMAP, et vous demandez comment le filtrage et la gestion du spam se produit ?

Solution : La machine qui a déjà votre courrier peut devenir votre serveur imap. Vous aurez besoin de configurer une application serveur. Dovecot en est une, et les directives sur les pages web du projet le rendent facile à mettre en place. Il vous reste encore le problème du filtrage, car il est logique de le faire sur le serveur (lorsque vous pointez kmail sur le serveur, vous verrez les dossiers que vous avez créés sur le serveur). Encore une fois il y a des options, mais l'une des plus connues est procmail. Là encore, il y a beaucoup d'informations sur Internet sur la façon de le mettre en place. Vous lui donnez un ensemble de "recettes" - voici un exemple :

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

Si vous avez des dossiers maildir, chaque recette doit se terminer par un « / ». Si vos dossiers sont au format mbox, il suffit d'omettre le « / »

Si vous avez utilisé bogofilter avec kmail vous avez déjà une liste de mots. Ceci peut être utilisé au niveau du serveur aussi, de sorte que vous n'aurez pas à commencer la formation à partir de zéro. L'astuce est de le mettre en place avant les recettes procmail :

: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 }

Notez qu'il va utiliser un mailbox pour le spam et un pour les courriers incertains (unsure) - j'ai ajouté un 'a-' aux noms pour qu'ils soient facilement visibles, en haut de la liste.

Enfin, pour améliorer les performances, exécutez la commande suivante à l'occasion sur les spam sauvés et incertains :

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

(N'oubliez pas de vérifier le chemin.)

Ceci n'est pas un guide complet pour la mise en place d'un serveur, mais des notes sur comment configurer le serveur pour qu'il fonctionne comme prévu dans KMail.


Obtenir plus d'espace à l'écran dans KMail

Symptôme : Vous utilisez KMail sous KDE 4.2 ou une version ultérieure sur un netbook, et vous trouvez que le nouveau mode d' agrégat vous laisse peu de place à l'écran

Solution : Dans la version 4.2, vous avez un nouvel ensemble d'icônes à côté de la barre de recherche rapide. Vous pouvez les utiliser pour choisir un thème différent et un mode d'agrégat différent. Si vous voulez changer le look de sorte qu'un mail utilise une seule ligne au lieu de deux lignes, allez dans - l'info-bulle dit Sélectionnez l'apparence (Thème) - Et changer le thème pour Classic . Si vous souhaitez désactiver le regroupement par date, changer d'agrégation pour Liste de diffusion standard . Maintenant votre KMail ressemblera exactement à ce qu'il était dans les versions précédentes.

Dans les versions 4.4 and 4.5 ces paramètres ont été déplacés dans le menu principal,Affichage -> Liste des messages -> Thème et Affichage -> Liste des messages -> Mode d'agrégat


Obtenir plus d'espace à l'écran dans KMail - réduire la taille de police

Symptôme : Vous manquez encore de place à l'écran, et préfèrez les lignes plus visibles au détriment de la taille de la police, mais vos tentatives ne fonctionnent que partiellement.

Solution : Dans Configuration -> Configurer KMail -> Apparence -> Polices vous pouvez Utiliser des polices personnalisées et modifier les paramètres de chaque composant dans la liste. C'est ici que vous découvrez que votre liste de dossiers et le corps des messages utilisent les polices que vous voulez, mais que la liste des messages a encore une trop grande police.

Maintenant, vous devez chercher vers cet ensemble de nouvelles icônes en haut à droite, à proximité de la zone de recherche, pour - l'info-bulle dit Sélectionner l'apparence (Thème) . Choisissez Configurer , puis l'onglet Apparence . Il ya une liste de Éléments contenus , et au-dessous une maquette d'en-têtes de colonne. Chacune de ces en-têtes doit être cliquée pour régler votre nouvelle police. À la fin, la liste des message sera affiché dans la même police que le reste de votre mise en page.

Dans les versions ultérieures qui n'ont pas les icônes, vous pouvez apporter les modifications par un clic droit sur les en-têtes de la liste des messages, et en sélectionnant Thème -> Configurer -> Onglet apparence . Encore une fois, vous aurez besoin de travailler avec l'en-tête de chaque colonne.


Déconfigurer les infobulles des dossiers

Symptôme : Vous utilisez KMailsous KDE 4.2 ou une version ultérieure sur un netbook, et constatez que les info-bulles sur les dossiers cachent trop de noms de dossiers

Solution: Right-clicking on the header of the Folder List now brings up several more configuration options. One section is headed Display Tooltips, and the choices are Always, When Text Obscured, Never. When Text Obscured is handy for folders that have long names, so that only part of the name is displayed. Folders where you can see the full name won't pop up the tooltip.


Un-configure KMail message list tool tips

In KMail, Settings -> Configure KMail -> Appearance -> Message List uncheck General -> Display tooltips for messages and group headers


Remove Alternate Line colourings

In System Settings -> Appearance -> Colors -> Colors, 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 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 Control Center (MCC). Other than this name change, the method is as described above.


Migration

Transfer mail and settings to another computer (or another user account on the same machine)

Solution: 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

Be aware that some distributions use ~/.kde4 instead of ~/.kde/ for their KDE configuration data.

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

  • Everthing 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 section "Cannot copy mail to a USB stick" below.


Problem: Cannot copy mail 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.



Troubleshooting

Problem: You are losing mail

Symptom: You are losing mail. One message in your Inbox had an empty subject line and the date 1st January 1970. When you clicked on it, it was empty. When you clicked on the next message that changes to the same state.

Solution: This happens where there is corruption in your index files. First thing then, do notclick on any more messages.

  • With the KMail 1.10 shipped with KDE 4.1 or newer, right click on the folder and select Rebuild Index (you can do the same from the Folder menu).
  • With earlier KMail versions the process is slightly more complicated. Close KMail. In Dolphin, navigate to where your mail is stored (typically in ~/.kde/share/apps/kmail/) and look for index files associated with the affected mailbox. There will be two or three, and be easy to spot. Delete them. They will be recreated when you re-start KMail. You will have lost the mails that had disappeared, but the rest of the mail should be visible again.

You have empty 'ghost-mails' in your inbox (or other folder)

Symptom: For some reason, certain messages aren't accessible in KMail. They show up in the message list window but selecting them there results in a blank message window. I can't open them or reply to them, etc.

Solution: This problem is most likely due to corrupted index files, see issue "You are losing mail" above. So just follow the advice given there.


Problem: Wrong address autocompletion

Symptom: You sent an email to a friend and mis-typed his address. Now that address keeps popping up as a suggestion, every time you try to send to the correct address. You can't find it in your addressbook.

Solution: Recent addresses are actually stored in /.kde/share/config/kmailrc, but rather than risk making a mistake in a manual edit, go to KMail's Settings -> Configure KMail -> Composer and you will see a button Edit Recent Addresses


Problem: Cannot follow a link in a mail

Symptom: You have set Firefox as your default browser, but when you click a URL in KMail it loads a local temporary version of the page with broken relative links.

Solution: You should add "%u" or "%U" to the Firefox executable in the settings. If that is not present KDE assumes that the application is not capable of handling remote urls (http) and hence creates a local copy first.


Problem: You get an authentication error message

Authentication support is not compiled into kio_smtp. The message will stay in the 'outbox' folder until you either fix the problem (e.g. a broken address) or remove the message from the 'outbox' folder.

Solution: Install the sasl-devel-package and recompile kdepimlibs. E.g. for SUSE the package is named cyrus-sasl-devel and you install it with the command

yast -i cyrus-sasl-devel

When running cmake to compile kdepimlibs, you will see:

-- The following external packages were located on your system.
 -- This installation will have the extra features provided by these packages.
 [...]
 + cyrus-sasl

This usually only affects self-build distros.


Problem: You can't find your Distribution Lists

Solution: See Special:myLanguage/KAddressBook


Your correspondents complain about your bottom-posting

Symptom: Your correspondents use mail agents that routinely top-post, and they complain that they have to scroll down to read your replies. You, on the other hand, post to mailing lists, where it is a requirement that you bottom post to maintain the natural order of reading.

Solution: Highlight the portion of your received message to which you want to reply, before hitting the Reply icon or keyboard shortcut. The composer window that opens will quote only the section that you highlighted and your correspondents will be able to see your reply without unnecessary scrolling.


Error: Could Not Determine Resource Status

Symptom: When fetching mail, you get an error message reading like:

Error while getting folder information.
 Could Not Determine Resource Status
 An attempt to determine information about the status of the resource 
 Unable to get information about folder INBOX.customflags.
 The server replied: Mailbox does not exist, or must be subscribed to.,
 such as the resource name, type, size, etc., was unsuccessful.
 Technical reason: Could Not Stat Resource

Reason: You are using Courier IMAP as your mail server.

Solution: If you are your own mail server administrator, set up a different mail service, for example cyrus. Here is a description how to do it.


Problem: Kmail is slow

Symptom: Kmail is really slow to get your mails.

Solution: It might be that the spam tool you're using is slowing down Kmail. If you used Kmail tools menu to add a spam tool and added Spam Assassin (for example) then try another one. I noticed that bogofilter is much quicker. You'll need to remove the 1st one and add the 2nd. You'll then need to train the spam tool you just added (bogofilter): KMail Anti-Spam Tools

Symptom: You just copied your mail folders from an earlier version (see "Migration" above) and now Kmail is really slow to respond shortly after it starts up, for at least several seconds with Kontact burning 100% cpu.

Solution: Work through all your saved message folders and Mark all messages as read, from either the Folder menu or right-click on the folder in the tree view side panel.

Symptom: You experience very long delays when sending messages, and KMail is frozen while you wait.

Solution: There was a bug in the various Release Candidates for KDE SC 4.4 which caused KMail to do lengthy searches for matching addresses. Updating to the full 4.4 should cure the problem.


KMail with other desktops or applications

Problem: KMail does 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

Tell Firefox to use KMail for mailto: addresses

Solution:

Firefox 2 - In the Firefox address bar, type
about:config

Right-click anywhere in the window and select New -> String in the first dialogue field. Type

network.protocol-handler.app.mailto

and then

kmailservice

Close Firefox

Firefox 3 - In the Firefox menu, select Edit -> Preferences, choose the Applications tab, then type
mailto
in the search box. Choose Use Other... and find /usr/bin/kmailservice

Set Firefox as your default browser

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

Solution: This solution will affect all of KDE, not just KMail. Start systemsettings -> Default Applications -> Web Browser -> Open http and https URLs in the following browser -> firefox.

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't exist you should add it.

You can also use the script in Tutorials/Modify_KDE_defaults


Control your Roaming profile's connection

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

Solution: Settings -> Configure KMail -> Accounts -> Receiving (tab) -> (select the account to exclude) -> Modify ->General (tab), 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.

Hints and Tips

Add a Tag to aid searching

You must first define your tags, which is done in Settings->Configure KMail->Appearance->Message Tags. Now you will find that the (right-click) context menu, under Mark Message, offers you the choice of your defined tags.

Watch threads

If you want to follow a thread, right click and choose Mark Thread -> Watch Thread.

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

Watch your own threads:

This is useful in case you are registered to a mailing list such as [email protected] 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: Settings -> Configure Filters

  • select Match all of the following
  • Add the conditions:
    • From -> Contains -> yourmail@maildomain [1]
    • List-Id -> Contains listID [2]

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

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

  • Under Filter Actions choose Mark As -> Watched.

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 Edit -> Find Messages.

  • Select Match all of the following[3]
  • Add the condition: Message Status -> is -> Watched
  • 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.

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

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 those before starting
    • libtranslate
    • perl
    • perl module Email::MIME
    • kmail
  • Setting up a pipe filter
    • In Kmail go to Settings -> Configure filters
      • create a new filter and name it Translate
      • add a Filter Criteria that would be always true (e.g Subject -> Does not equal -> "321546543")
      • 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 charging innocent E-Mails 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 Apply Filter -> Filter Translate A dialog box should pop-up with the original message followed by it's 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 shouldn't be used.

Note

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