KMail/FAQs Hints and Tips: Difference between revisions

From KDE UserBase Wiki
m (Promoted level of 'Watch Threads')
(correct links)
 
(126 intermediate revisions by 21 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|KMail/FAQs_Hints_and_Tips}}
<languages />
<translate>


Back to [[KMail]]
=== Is my problem already known?  === <!--T:1-->


=== Is my problem already known?  ===
<!--T:2-->
'''Symptom''': You have a problem with [[Kde-pim]] and would like to know whether others have reported and solved the problem. You wonder how to read the archives of the kde-pim mailing list.  
''Symptom:'' You have a problem with [[Special:myLanguage/Kde-pim|KDE-PIM]] and would like to know whether others have reported and solved the problem. You wonder how to read the archives of the '''kdepim-users''' mailing list.  


'''Solution:''' This is a good habit to cultivate. Try the MARC archives at http://lists.kde.org/?l=kdepim-users&amp;r=1&amp;w=2  
<!--T:267-->
''Solution:'' This is a good habit to cultivate. Try the MARC archives at https://lists.kde.org/?l=kdepim-users&amp;r=1&amp;w=2  
----
----
== Configuration  ==
=== Store sent mails in a special folder  ===
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 kontact, choose "Settings -&gt; Configure KMail -&gt; Identities -&gt; (Choose an identity) -&gt; Modify -&gt; Advanced -&gt; Sent-mail-folder"
== Configuration  == <!--T:3-->
 
=== Store sent mails in a special folder  === <!--T:4-->
 
<!--T:5-->
''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 <menuchoice>Settings -> Configure KMail -> Identities -> (Choose an identity) -> Modify -> Advanced -> Sent-mail-folder</menuchoice>
----
----
=== Store trash mails in a special folder  ===
=== Store trash mails in a special folder  === <!--T:6-->
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.  
 
<!--T:7-->
''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 kontact, choose "Settings -&gt; Configure KMail -&gt; Accounts -&gt; Receiving -&gt; (Choose an account) -&gt; Modify -&gt; Advanced -&gt; Trash folder"
<!--T:142-->
''Solution:'' In '''Kmail''', choose <menuchoice>Settings -> Configure KMail -> Accounts -> Receiving tab -> (Choose an account) -> Modify -> Advanced -> Trash folder</menuchoice>
 
<!--T:143-->
In some versions you will need <menuchoice>Settings -> Configure KMail -> Accounts -> Receiving tab -> (Choose an account) -> Modify -> IMAP settings tab -> Trash folder</menuchoice> (or Wastebin folder, depending on your distro)
----
----
=== 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 encrypted mails as unencrypted === <!--T:8-->


store-displayed-messages-unencrypted=true
<!--T:9-->
''Symptom:'' You exchange encrypted mail with a friend, but would like to store it unencrypted, once you have opened the message.


This may only work with SMIME but implementation for OpenPgP is being worked on.  
<!--T:10-->
''Solution:'' To store emails that have been decrypted once in unencrypted format henceforth, add this to your ''kmail2rc'' configuration file, in the [Reader] section:
 
<!--T:11-->
{{Input|1=store-displayed-messages-unencrypted=true}}
 
<!--T:266-->
This may only work with ''SMIME'' but implementation for ''OpenPgP'' is being worked on.  
----
----
=== Spam filtering 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). 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:  
=== Spam filtering on an IMAP server === <!--T:12-->


:0
<!--T:13-->
* (^To|^CC|^List-ID): .*kde-linux
''Symptom:'' You intend moving on to reading your mail from an IMAP server, and wonder how filtering and spam handling will occur?
${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 '/'  
<!--T:14-->
''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:


If you have been using bogofilter with kmail you will already have a wordlist. This can be used at server level, too, so you won't have to start training from scratch. The trick is to set this before the procmail recipes:
<!--T:15-->
{{Input|1= :0
* <nowiki>(^To|^CC|^List-ID)</nowiki>: .*kde-linux
${MAILDIR}.INBOX.KDE-Lists.kde-users/}}


:0fw
<!--T:16-->
| bogofilter -e -p
If you have ''maildir'' folders, each recipe must end with a "/". If your folders are ''mbox'', just omit the "/"


:0e
<!--T:17-->
{ EXITCODE=75 HOST }
If you have been using '''bogofilter''' with '''kmail''' you will already have a ''wordlist''. This can be used at server level, too, so you won't have to start training from scratch. The trick is to set this before the '''procmail''' recipes:


  :0:
<!--T:18-->
{{Input|1= :0fw
  <nowiki>|</nowiki> bogofilter -e -p<br />
:0e
{ EXITCODE=75 HOST }<br />
:0:
  * ^X-Bogosity: Spam, tests=bogofilter
  * ^X-Bogosity: Spam, tests=bogofilter
  ${MAILDIR}.INBOX.a-Spam/
  ${MAILDIR}.INBOX.a-Spam/<br />
 
:0e
:0e
  { EXITCODE=75 HOST }<br />
  { EXITCODE=75 HOST }
:0:
 
:0:
  * ^X-Bogosity: Unsure, tests=bogofilter
  * ^X-Bogosity: Unsure, tests=bogofilter
  ${MAILDIR}.INBOX.a-Unsure/
  ${MAILDIR}.INBOX.a-Unsure/<br />
 
:0e
:0e
  { EXITCODE=75 HOST }
  { 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.  
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.  


<!--T:24-->
Finally, to improve performance, run the following command occasionally on saved spam and Unsures:  
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/
<!--T:25-->
{{Input|1= /usr/share/bogofilter/contrib/trainbogo.sh -c -H /home/user/Maildir /.INBOX.bogotrain_ham/cur/ -S /home/user/Maildir/.INBOX.bogotrain_spam/cur/}}


<!--T:26-->
(don't forget to check the path.)  
(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.  
<!--T:27-->
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'''.  
----
----
=== Get more screen space in KMail ===
</translate><span id="Get more screen space in KMail"></span><translate>
'''Symptom:''' You are using KMail under KDE 4.2 or later on a netbook, and find that the new Aggregation display leaves you little screen space


'''Solution:''' You now have a new set of icons next to the quick search bar. You can use these to choose a different theme and a different aggregation. If you want to change the look so that a mail uses a single row instead of two rows, go to [[Image:Preferences-desktop-theme.png|16px]] - the tooltip says "Select View Appearance (Theme)" - and change the theme to '''Classic'''. If you want to disable grouping by date, change the aggregation [[Image:View-process-tree.png|16px]] to '''Standard Mailing List'''. Now your KMail will look exactly like it did in earlier versions.
=== Get more screen space in KMail  === <!--T:28-->


<!--T:29-->
''Symptom:'' You are using '''KMail''' under KDE 4.2 or later on a netbook, and find that the new ''Aggregation'' display leaves you little screen space
<!--T:30-->
''Solution:'' In 4.2 you have a new set of icons next to the quick search bar. You can use these to choose a different theme and a different aggregation. If you want to change the look so that a mail uses a single row instead of two rows, go to [[Image:Preferences-desktop-theme.png|16px]] - the tooltip says <menuchoice>Select View Appearance (Theme)</menuchoice> - and change the theme to <menuchoice>Classic</menuchoice>. If you want to disable grouping by date, change the aggregation [[Image:View-process-tree.png|16px]] to <menuchoice>Standard Mailing List</menuchoice>. Now your '''KMail''' will look exactly like it did in earlier versions.
<!--T:31-->
In 4.4 and 4.5 these settings were moved to the main menu, <menuchoice>View -> Message List -> Theme</menuchoice> and <menuchoice>View -> Message List -> Aggregation</menuchoice>
In 4.4 and 4.5 these settings were moved to the main menu, <menuchoice>View -> Message List -> Theme</menuchoice> and <menuchoice>View -> Message List -> Aggregation</menuchoice>
----
----


=== Get more screen space in KMail - reduce font size  ===
=== Get more screen space in KMail - reduce font size  === <!--T:32-->
'''Symptom:''' You still lack screen space, and would prefer more visible lines at the expense of font size, but your attempts only partially work.  
 
<!--T:33-->
''Symptom:'' You still lack screen space, and would prefer more visible lines at the expense of font size, but your attempts only partially work.
 
<!--T:34-->
''Solution:'' In <menuchoice>Settings -> Configure KMail -> Appearance -> Fonts</menuchoice> you can select <menuchoice>Custom Font</menuchoice> 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.  


'''Solution:''' In Settings &gt; Configure KMail &gt; Appearance &gt; Fonts you can select Custom Font 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.  
<!--T:35-->
Now you have to look at that set of new icons at the top right, close to the search box, for [[Image:Preferences-desktop-theme.png|16px]] - the tooltip says <menuchoice>Select View Appearance (Theme)</menuchoice>. Choose <menuchoice>Configure</menuchoice>, then <menuchoice>Appearance</menuchoice> tab. There is a list of <menuchoice>Content Items</menuchoice>, and below that a mockup of column headers. 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.  


Now you have to look at that set of new icons at the top right, close to the search box, for [[Image:Preferences-desktop-theme.png|16px]] - the tooltip says "Select View Appearance (Theme)". Choose Configure, then Appearance tab. There is a list of "Content Items", and below that a mockup of column headers. 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.  
<!--T:36-->
In later versions that don't have those icons you can make the changes by right-clicking on the Message List headers, and selecting <menuchoice>Theme -> Configure -> Appearance Tab</menuchoice>  Again, you need to work with the header of each column.
----
----
=== Un-configure KMail folder tool tips ===
</translate><span id="Un-configure KMail folder tool tips"><translate>
'''Symptom:''' You are using KMail under KDE 4.2 or later 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 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 folder tool tips  === <!--T:37-->
 
<!--T:38-->
''Symptom:'' You are using '''KMail''' under KDE 4.2 or later on a netbook, and find that the ''tooltips'' over folders hide too many folder names
 
''Solution:'' Right-clicking on the header of the <menuchoice>Folder List</menuchoice> now brings up several more configuration options. One section is headed <menuchoice>Display Tooltips</menuchoice>, and the choices are <menuchoice>Always</menuchoice>, <menuchoice>When Text Obscured</menuchoice>, <menuchoice>Never</menuchoice>. <menuchoice>When Text Obscured</menuchoice> 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  ===
=== Un-configure KMail message list tool tips  === <!--T:39-->
In KMail, --&gt; Settings --&gt; Configure KMail --&gt; Appearance --&gt;Message List - uncheck General --&gt; "Display tooltips for messages and group headers"
 
In '''KMail''', <menuchoice>Settings -> Configure KMail -> Appearance -> Message List</menuchoice> uncheck <menuchoice>General -> Display tooltips for messages and group headers</menuchoice>
----
----
=== Remove Alternate Line colourings  ===
=== Remove Alternate Line colourings  === <!--T:40-->
In System Settings-&gt;Appearance-&gt;Colors-&gt;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 don't uset the name SystemSettings.  As in KControl, the KDE 3 control centre, they name it "Configure your Desktop" to distinguish it from "Configure your Computer", aka the Mandriva Control Center (MCC).  Other than this name change, the method is as described above.
<!--T:41-->
In <menuchoice>System Settings -> Appearance -> Colors -> Colors</menuchoice>, for each color set except <menuchoice>Common Colors</menuchoice> (which doesn't have it), change the <menuchoice>Alternate Background</menuchoice> to be the same as the <menuchoice>Normal Background</menuchoice>.
 
<!--T:42-->
''Mandriva'' and ''Mageia'' don'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 (or Mageia) Control Center (MCC).  Other than this name change, the method is as described above.
----
----


== Migration  ==
===Store messages from separate email accounts in separate inbox folders=== <!--T:162-->
=== 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.  
<!--T:163-->
For POP create folders in <tt>~/.kde/share/apps/kmail/mail/</tt> (copy and rename the default folder). These then appear in the drop down list in <menuchoice>Settings -> Configure KMail -> Accounts -> Modify -> POP Settings -> Destination Folder</menuchoice>.


<!--T:164-->
Create other folders in the same location for sent mail. These can be set in <menuchoice>Identities -> Advanced</menuchoice>.
<!--T:165-->
This recipe may not be applicable to KMail 2 due to move to '''Akonadi'''-based mail storage.
---
===Configure GMail without OAuth=== <!--T:262-->
<!--T:263-->
''Solution:'' In '''KMail''', change option <menuchoice>Settings -> Configure KMail -> Accounts -> Receiving tab -> (Choose an account) -> Modify -> Advanced -> Authentication</menuchoice> from <tt>Gmail</tt> to <tt>PLAIN</tt>.
<!--T:264-->
For some personal reasons Google does not consider usual IMAP authentication methods as "secure", so you will need explicitly allow it.
<!--T:265-->
Go to the [https://myaccount.google.com/lesssecureapps Less secure apps] section of your Google Account and turn on <tt>Allow less secure apps.</tt> Details: https://support.google.com/accounts/answer/6010255
== Migration  == <!--T:43-->
=== Transfer mail and settings to another computer (or another user account on the same machine)  === <!--T:44-->
<!--T:45-->
''Solution:'' The messages are typically in <tt>~/.kde/share/apps/kmail/</tt>. For very old installations of '''KMail''', the messages can also be in <tt>~/Mail</tt>. Note that KMail uses hidden sub-directories inside that directory, so you need to make sure to copy hidden directories as well.
<!--T:46-->
For settings you will need to copy the following files:  
For settings you will need to copy the following files:  


*~/.kde/share/config/kmailrc,  
<!--T:47-->
*~/.kde/share/config/mailtransports, (since KDE 4.0)  
* <tt>~/.kde/share/config/kmailrc</tt>,  
*~/.kde/share/config/emaildefaults and  
* <tt>~/.kde/share/config/mailtransports</tt>, (since KDE 4.0)  
*~/.kde/share/config/emailidentities .
* <tt>~/.kde/share/config/emaildefaults</tt> and  
* <tt>~/.kde/share/config/emailidentities</tt> .
 
<!--T:48-->
Your address book is usually stored in <tt>~/.kde/share/apps/kabc/</tt>. Calendar data is in <tt>~/.kde/share/apps/korganizer</tt>


Your address book is usually stored in ~/.kde/share/apps/kabc/. Calendar data is in ~/.kde/share/apps/korganizer
<!--T:49-->
Be aware that some distributions use <tt>~/.kde4</tt> instead of <tt>~/.kde/</tt> for their KDE configuration data. Look at the output of the command <code>kde4-config --localprefix</code> if in doubt.


Be aware that some distributions use ''~/.kde4'' instead of ''~/.kde/'' for their KDE configuration data.  
<!--T:50-->
From version 4.4 you may have some '''Akonadi'''-controlled entries that also need to be kept.  Add to the above list -
* Everything under <tt>~/.local/share/</tt>
* Everything under <tt>~/.config/akonadi/</tt>.
* <tt>~/.kde/share/config/nepomukserverrc</tt>
* Everything under <tt>~/.kde/share/apps/nepomuk/</tt>  ('''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.  
<!--T:161-->
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 [http://wiki.linuxquestions.org/wiki/VFAT (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.  
=== Problem: Cannot copy mail to a USB stick  === <!--T:51-->
 
<!--T:52-->
''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,
{{Output|1=Unable to copy ............Invalid argument}}
 
<!--T:53-->
''Solution:'' Your usb stick is [https://wiki.linuxquestions.org/wiki/VFAT (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.  
----
----
<br>  
<br />


== Troubleshooting  ==
== Troubleshooting  == <!--T:54-->
=== Problem: You are losing mail  ===
'''Symptom (1):''' 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 to (1):''' This happens where there is corruption in your index files. First thing then, do '''not''' click on any more messages.
=== Problem: You are losing mail  === <!--T:55-->


*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).  
<!--T:56-->
*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.
''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.
 
<!--T:57-->
''Solution:'' This happens where there is corruption in your index files. First thing then, do ''not''click on any more messages.
 
*With the '''KMail''' 1.10 shipped with KDE 4.1 or newer, right click on the folder and select <menuchoice>Rebuild Index</menuchoice> (you can do the same from the <menuchoice>Folder</menuchoice> menu).  
*With earlier '''KMail''' versions the process is slightly more complicated. Close '''KMail'''. In '''Dolphin''', navigate to where your mail is stored (typically in <tt>~/.kde/share/apps/kmail/</tt>) and look for index files associated with the affected mailbox. There will be two or three, and be easy to spot. <menuchoice>Delete</menuchoice> 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)  ===
=== You have empty 'ghost-mails' in your inbox (or other folder)  === <!--T:58-->
'''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.  
 
<!--T:59-->
''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 ist most likely due to corrupted index files, see issue 'You are loosing mail' above. So just follow the advice given there.  
<!--T:237-->
''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  ===
</translate><span id="You get the error Unable to fetch item from backend when entering IMAP folder"></span><translate>
'''Problem:''' You sent an email to to a friend and mis-typed his address. Now that address keeps popping up as a suggestion, everytime you try to send to the correct address. You can't find it in your addressbook.
 
=== You get the error "Unable to fetch item from backend" when entering IMAP folder === <!--T:238-->


'''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 &gt; Configure KMail &gt; Composer and you will see a button "Edit Recent Addresses"
<!--T:239-->
There are a number of possible reasons for this and it's something the '''KMail''' team hopes to tackle in time. Meanwhile, there are some work-arounds:
 
==== Work-around 1 ==== <!--T:240-->
 
<!--T:241-->
* edit <tt>~/.local/share/akonadi/mysql.conf</tt>
* Under the '''[mysql]''' section, add:
* <code>binlog_format=row</code>
 
<!--T:242-->
If this doesn't work, try work-around 2 (below).
 
==== Work-around 2 ==== <!--T:243-->
 
<!--T:244-->
This one is mostly a matter of restarting so '''KMail''' can fetch those pesky items... Some possible steps:
Use <keycap>Alt + F2</keycap> or [[Special:myLanguage/Konsole|Konsole]] to type: <code>kquitapp kmail</code>, then wait a minute, then <code>akonadictl stop</code>, wait a minute, type <code>akonadictl start</code>, wait a minute, type <code>kmail</code>. This stops '''KMail''' (closing ''all'' windows), stops the '''KMail''' backend, starts the '''KMail''' backend, starts '''KMail'''. Having a working internet connection increases the chances of success. Sometimes, you can also just do <code>kquitapp kmail</code>, wait a minute, and start '''KMail''' again. Often, a few restarts seem to be needed. It is unclear what is the reason for this, but on bad network connections it is more likely to happen.
 
<!--T:245-->
See also the [[Special:myLanguage/KMail/FAQs Hints and Tips#Your mails are not being sent, without error messages|below item]] for how akonadiconsole can be helpful.
 
</translate><span id="Your mails are not being sent, without error messages"></span><translate>
 
=== Your mails are not being sent, without error messages === <!--T:246-->
 
<!--T:247-->
If '''KMail''' does not send mail without saying anything, the 'agent' responsible for 'dispatching' the mails can be stuck. Of course, you need to ensure you have proper network connectivity for mail to be send!
 
<!--T:248-->
To remedy this, it might help to abort the current action and re-start it. First, quit '''KMail''' by using [[Special:myLanguage/KRunner|KRunner]] (<keycap>Alt + F2</keycap>) or [[Special:myLanguage/Konsole|Konsole]] and typing: <code>kquitapp kmail</code>. Note that a normal <keycap>Alt + F4</keycap> or <menuchoice>File -> Quit</menuchoice> does ''not'' do the trick! Wait a minute, then start '''KMail''' again. Now start '''akonadiconsole''' using [[Special:myLanguage/KRunner|KRunner]] (<keycap>Alt + F2</keycap>) or [[Special:myLanguage/Konsole|Konsole]]. Go to the <menuchoice>Mail Dispatcher Agent</menuchoice>, do a right-click and abort the current action. You will most likely get some error messages popping up. Go back to '''KMail''' and choose <menuchoice>File -> Send Queued Messages</menuchoice>. Now it might work. If not, instead of aborting the current action, try toggling the offline/offline status of the '''Mail Dispatcher Agent''' or restarting things like mentioned in the workaround 2 of the [[Special:myLanguage/KMail/FAQs Hints and Tips#You get the error Unable to fetch item from backend when entering IMAP folder|problem above]] this one.
 
<!--T:249-->
{{Note|akonadiconsole can be quite helpful for a number of situations as it shows all the 'agents', the separate components of the '''KMail''' backend. You can stop and start them, put them in offline mode, abort ongoing actions etc. It can be very helpful when things get stuck.}}
 
=== Problem: Wrong address autocompletion  === <!--T:60-->
 
<!--T:61-->
''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.
 
<!--T:152-->
''Solution:'' ''Recent addresses'' are actually stored in <tt>~/.kde/share/config/kmailrc</tt>, but rather than risk making a mistake in a manual edit, go to '''KMail''''s <menuchoice>Settings -> Configure KMail -> Composer</menuchoice> and you will see a button <menuchoice>Edit Recent Addresses</menuchoice>
----
----
=== Problem: Cannot follow a link in a mail  ===
'''Symptom:''' You have [[#set_Firefox_as_your_default_browser|set Firefox as your default browser]], but when you click a URL in KMail it loads a local tmp version of the page with broken relative links.


'''Solution:''' You should add&nbsp;%u or&nbsp;%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: Cannot follow a link in a mail  === <!--T:62-->
 
<!--T:144-->
''Symptom:'' You have [[#set_Firefox_as_your_default_browser|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  ===
=== Problem: You get an authentication error message  === <!--T:63-->
:''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
<!--T:145-->
{{Output|1=''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.''}}


yast -i cyrus-sasl-devel
<!--T:64-->
''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


<!--T:65-->
{{Input|1= yast -i cyrus-sasl-devel}}
<!--T:66-->
When running cmake to compile kdepimlibs, you will see:  
When running cmake to compile kdepimlibs, you will see:  


-- The following external packages were located on your system.
<!--T:67-->
{{Output|1= -- The following external packages were located on your system.
  -- This installation will have the extra features provided by these packages.
  -- This installation will have the extra features provided by these packages.
  [...]
  [...]
  + cyrus-sasl
  + cyrus-sasl}}
 
This usually only affects self-build distros.
----
----
=== Problem: You can't find your Distribution Lists  ===
=== Problem: You can't find your Distribution Lists  === <!--T:68-->
'''Solution:''' See '''[[KAddressBook]]'''
 
<!--T:187-->
''Solution:'' See [[Special:myLanguage/KAddressBook|KAddressbook]]
----
----
=== Your corresondents 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.
=== Your correspondents complain about your bottom-posting=== <!--T:146-->
 
<!--T:69-->
''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.
 
<!--T:70-->
''Solution:'' Highlight the portion of your received message to which you want to reply, before hitting the <menuchoice>Reply</menuchoice> 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.
----
----
<br>


=== Error: Could Not Determine Resource Status  ===
=== KMail spellchecking doesn't work with the Deutsch dictionary === <!--T:178-->
'''Symptom:''' When fetching mail, you get an error message reading like:  
 
<!--T:179-->
''Symptom:'' Your default dictionary is set to "Deutsch", but when typing in German, the spell-checker doesn't alert you to mis-spelled words.
 
<!--T:180-->
''Solution:'' Change your default dictionary to "Deutsch (Deutschland)".  It's worth remembering, too, that you can associate different dictionaries to each Identity, and also by using the <menuchoice>View</menuchoice> menu on a Compose screen, you can choose to have the dictionary used displayed while composing a message, and change dictionaries, using that, when desired.
 
=== Error: Could Not Determine Resource Status  === <!--T:71-->
 
<!--T:72-->
''Symptom:'' When fetching mail, you get an error message reading like:  


Error while getting folder information.
<!--T:73-->
{{Output|1= Error while getting folder information.
  Could Not Determine Resource Status
  Could Not Determine Resource Status
  An attempt to determine information about the status of the resource  
  An attempt to determine information about the status of the resource  
Line 182: Line 347:
  '''The server replied: Mailbox does not exist, or must be subscribed to.''',
  '''The server replied: Mailbox does not exist, or must be subscribed to.''',
  such as the resource name, type, size, etc., was unsuccessful.
  such as the resource name, type, size, etc., was unsuccessful.
  Technical reason: Could Not Stat Resource
  Technical reason: Could Not Stat Resource}}


'''Reason:''' You are using Courier IMAP as your mail server.  
<!--T:74-->
''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. [http://wiki.linuxquestions.org/wiki/Cyrus Here is a description how to do it].  
''Solution:'' If you are your own mail server administrator, set up a different mail service, for example cyrus. [https://wiki.linuxquestions.org/wiki/Cyrus Here is a description how to do it].  
----
----
=== Problem: Kmail is slow  ===
=== Problem: Kmail is slow  === <!--T:75-->
'''Symptom&nbsp;:''' Kmail is really slow to get your mails.  
 
<!--T:147-->
''Symptom:'' '''Kmail''' is really slow to get your mails.  
 
<!--T:76-->
''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): [[Special:myLanguage/KMail/Tools#Anti-Spam_Tools|KMail Anti-Spam Tools]]
 
<!--T:77-->
''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.
 
<!--T:78-->
''Solution:'' Work through all your saved message folders and <menuchoice>Mark all messages as read</menuchoice>, from either the <menuchoice>Folder</menuchoice> menu or right-click on the folder in the tree view side panel.
 
<!--T:79-->
''Symptom:'' You experience very long delays when sending messages, and '''KMail''' is frozen while you wait.
 
<!--T:156-->
''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.
 
<!--T:157-->
''Symptom:'' When you type in the composer window, characters appear very slowly.
 
<!--T:158-->
''Possible Solutions:'' This is a known bug.  Some have reported that disabling then re-enabling desktop effects may help.  Others have reported that switching to a desktop theme, other then Oxygen, works.
 
=== Problem: Cannot save SMTP password - kwallet is unavailable === <!--T:166-->
 
<!--T:167-->
''Symptom:'' When saving your SMTP password in the '''KMail''' SMTP configuration dialog you get a "kwallet is unavailable" message.
 
<!--T:168-->
''Solution:'' You need to reset the '''KWallet''' configuration for '''KMail'''.
 
<!--T:169-->
* Stop '''KMail'''
 
<!--T:170-->
* Start '''KDE Wallet Manager'''
 
<!--T:171-->
* Open <menuchoice>Settings -> Configure Wallet</menuchoice>
 
<!--T:172-->
* Delete the '''Kontact''' and '''KMail''' entries (Kontact or KMail entry may not be there)


'''Solution&nbsp;:''' 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 2d. You'll then need to train the spam tool you just added (bogofilter): http://userbase.kde.org/KMail/Tools#Anti-Spam_Tools
<!--T:173-->
* Save and close '''KDE Wallet Manager'''


'''Symptom&nbsp;:''' 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.
<!--T:174-->
* Start '''KMail'''


'''Solution&nbsp;:''' Work through all your saved message folders and 'Mark all messages as read', from either the 'Folder' menu or right-click on the folder int he tree view side panel.
<!--T:175-->
* Enter the SMTP password in the '''Configure Account''' dialog


'''Symptom:''' You experience very long delays when sending messages, and KMail is frozen while you wait.
<!--T:176-->
* Save - answer '''yes''' to the '''KWallet''' dialog


'''Solution:''' There was a but 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.
<!--T:177-->
----
----
== KMail with other desktops or applications  ==
=== Problem: KMail does not start up.  ===
'''Symptom:''' You want to start kmail from a minimal desktop environment like [http://en.wikipedia.org/wiki/Fvwm2 fvwm2]. It does not start.


'''Reason:''' You are missing the dbus functionality.
== KMail with other desktops or applications  == <!--T:80-->


'''Solution:''' Start kmail using dbus-launch like this:  
=== Problem: KMail does not start up.  === <!--T:148-->


dbus-launch kmail
<!--T:149-->
''Symptom:'' You want to start '''KMail''' from a minimal desktop environment like [https://en.wikipedia.org/wiki/Fvwm2 fvwm2]. It does not start.
 
<!--T:81-->
''Reason:'' You are missing the ''dbus'' functionality.
 
<!--T:82-->
''Solution:'' Start '''KMail''' using dbus-launch like this:
 
<!--T:83-->
{{Input|1= dbus-launch kmail}}
----
----
=== Tell Firefox to use KMail for mailto: addresses ===
</translate><span id="Tell Firefox to use KMail for mailto: addresses"></span><translate>
'''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
=== Tell Firefox to use KMail for mailto: addresses === <!--T:84-->


and then  
<!--T:140-->
Firefox 3 - In the '''Firefox''' menu, select <menuchoice>Preferences -> General</menuchoice>, choose the <menuchoice>Applications</menuchoice> tab, then type {{Input|1=mailto}}in the search box. Choose <menuchoice>KMail</menuchoice>
----


kmailservice
</translate><span id="Set Firefox as your default browser"></span><translate>


Close firefox
=== Set Firefox as your default browser  === <!--T:90-->


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
<!--T:150-->
----
''Symptom:'' You want to click on a link in [[Special:myLanguage/KMail|KMail]] and have it opened in '''Firefox'''. At the moment, another browser is used. You want to change this.  
=== 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 -&gt; Default Applications -&gt; Web Browser -&gt; Open http and https URLs in the following browser -&gt; firefox.  
<!--T:91-->
''Solution:'' This solution will affect all of KDE, not just '''KMail'''. Start <menuchoice>systemsettings -> Default Applications -> Web Browser -> Open http and https URLs in the following browser -> firefox</menuchoice>.  


<!--T:92-->
If you are an administrator and want to set this setting automatically for your users, it is  
If you are an administrator and want to set this setting automatically for your users, it is  


<!--T:93-->
*for SUSE Linux
*for SUSE Linux


<!--T:94-->
in your user directory in .kde4/share/config/kdeglobals add the line  
in your user directory in .kde4/share/config/kdeglobals add the line  


BrowserApplication[$e]=!firefox
<!--T:95-->
{{Input|1= BrowserApplication[$e]=!firefox}}


under category <br>  
<!--T:96-->
<pre>[General]
under category <menuchoice>[General]</menuchoice>  
</pre>  
*for all other Linux


<!--T:97-->
*for all other Linux distributions:
<!--T:98-->
in your user directory in .kde/share/config/kdeglobals add the line  
in your user directory in .kde/share/config/kdeglobals add the line  


BrowserApplication[$e]=!firefox
<!--T:99-->
{{Input|1= BrowserApplication[$e]=!firefox}}


under category<br>  
<!--T:100-->
<pre>[General]</pre>  
under category <menuchoice>[General]</menuchoice> If ''General'' category doesn't exist you should add it.
If ''General'' category does't exist you should add it. <br>


You can also use the script in [http://userbase.kde.org/Tutorials/Modify_KDE_defaults userbase.kde.org/Tutorials/Modify_KDE_defaults]  
You can also use the script in [[Special:myLanguage/Tutorials/Modify_KDE_Software_Defaults|Tutorials/Modify_KDE_Software_Defaults]]  
----
----
=== Control your Roaming profile's connection  ===
=== Control your Roaming profile's connection  === <!--T:101-->
'''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.  
 
<!--T:102-->
''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.
 
<!--T:103-->
''Solution:'' <menuchoice>Settings -> Configure KMail -> Accounts -> Receiving (tab) -> (select the account to exclude) -> Modify ->General (tab)</menuchoice>, uncheck <menuchoice>Include in manual mail check</menuchoice>. 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.
 
==KMail2 Issues== <!--T:153-->
 
===KMail2 doesn't send mail=== <!--T:233-->
 
<!--T:234-->
Some users find that mail does not go out, and it appears that smtp is missing, even though the Settings page looks correct.  It has been reported that this is cured by opening akonadiconsole and adding Mail Dispatcher Agent.
 
<!--T:181-->
If the computer was suddenly turned off in suspend mode (e.g. by a power cut) sometimes e-mails simply stay in the outbox without being sent, but no error message is generated either. This may be due to the fact that the Mail Dispatcher Agent is set to "offline" in the configuration file during suspend and is not changed back due to the "crash". Edit the following file:
 
<!--T:182-->
<tt>~/.config/akonadi/agent_config_akonadi_maildispatcher_agent</tt>
 
<!--T:183-->
and change
 
<!--T:184-->
{{Input|1=
[Agent]
Online=false}}
 
<!--T:185-->
to
 
<!--T:186-->
{{Input|1=
[Agent]
Online=true}}
 
===Clean start after a failed migration=== <!--T:188-->
 
<!--T:189-->
In case migration from '''KMail''' 1 to '''KMail''' 2 fails or you have weird problems after it, you can try to do a clean import of your data, instead of migrating the existing settings. Be warned, that needs more manual setup, so do only if you are confident with setting up again your '''KMail''' accounts, and it can generate a large amount of network traffic for IMAP resources.
 
<!--T:190-->
'''1. Stop Akonadi and related applications''' - quit '''KMail'''/'''Kontact'''/'''KOrganzier''', and issue this command:
 
<!--T:191-->
{{input|1=akonadictl stop}}
 
<!--T:192-->
Make sure no '''Akonadi''' or '''MySQL''' process is running:
 
<!--T:193-->
{{input|1=<nowiki>ps ux | grep mysql</nowiki>}}
{{input|1=<nowiki>ps ux | grep akonadi</nowiki>}}
 
<!--T:194-->
They should not show anything else but the ''grep'' process itself.
 
 
<!--T:195-->
'''2. Remove old Akonadi database and config''' - delete the following folders
 
<!--T:196-->
{{input|1=~/.local/share/akonadi}}
{{input|1=~/.config/akonadi}}
 
<!--T:197-->
You might want to also delete also the files starting with ''akonadi'' from
 
<!--T:198-->
{{input|1=~/.config}}
 
<!--T:268-->
but it's actually quite convenient not to do that: then recreating the resources
(in the same order as before) will auto-fill all your settings automatically again.
 
<!--T:199-->
'''3. Restart Akonadi server'''
 
<!--T:200-->
{{input|1=akonadictl start}}
 
 
<!--T:201-->
'''4. Add back the accounts'''
 
<!--T:202-->
Now it is time to add back your account. You can use '''KMail''' ('''Kontact''') for it, or you can use the akonadiconsole tool.
 
<!--T:203-->
In '''KMail''': <menuchoice>Settings -> Configure KMail -> Accounts</menuchoice> and use <menuchoice>Add</menuchoice>.
 
<!--T:204-->
If you use IMAP, add a new <menuchoice>IMAP E-Mail server</menuchoice> . If you want disconnected mode (so you can read the mails offline), enable it on the <menuchoice>Advanced</menuchoice> tab. Be sure to check that you are subscribed to all your important folders.
 
<!--T:205-->
You might already see a <menuchoice>Local folder</menuchoice> resource. This points to a local maildir folder. You can either modify this to point to your existing maildir folders or you can add a new resource for local mails.
 
<!--T:206-->
When adding a maildir resource you can choose between <menuchoice>KMail Mail Folder</menuchoice> or <menuchoice>Maildir</menuchoice>. Unless you have a mixed folder containing '''both''' maildir folders and mbox files, you should choose <menuchoice>Maildir</menuchoice>. For independent mbox files, like the one in the <tt>/var/spool/mail</tt>, you can set up a new ''MBox''  folder.
 
<!--T:207-->
Add the POP3 accounts as well. In case you have multiple Local Folders set up, choose on the <menuchoice>Advanced</menuchoice> tab the destination folder where the newly downloaded mails are put.
 
<!--T:208-->
For all accounts, configure the mail check interval. For Local folders disable interval checking and also disable <menuchoice>Include in manual mail check</menuchoice> in the <menuchoice>Retrieval options</menuchoice>.
 
<!--T:209-->
Add the sending (SMTP) accounts.
 
<!--T:210-->
'''5. Fix your filters, identities and favourite folders'''
 
<!--T:211-->
If you have client side filtering (common with POP3 mails), go to <menuchoice>Settings -> Configure Filters</menuchoice> and fix the destination folder for the filters, they most probably are wrong. Otherwise mails will end up in folders you don't expect.
 
<!--T:219-->
Spam filter (at least in version 4.7.3 and earlier) does not work as expected in that the rule that the wizard creates does not send spam to the folder you have defined.
 
<!--T:220-->
The workaround for this is to change the "spam" and "spam unsure" (if the spam filter you use support that) from looking at Status-fields in the header X-Spam-Status to look "Anywhere in headers" for X-"yourspamfilter"-Classification: SPAM or unsure. Look at the filters the wizard creates and copy the "contains" part. Example for Spambayes: X-Spambayes-Classification: spam and X-Spambayes-Classification: unsure
 
 
<!--T:221-->
You also need to verify the identity settings and set the sent-mail, drafts and templates folders to point to the right folders. To do that go to <menuchoice>Settings -> Configure KMail -> Identities</menuchoice>, modify the identity, go to the  <menuchoice>Advanced</menuchoice> tab and modify the above mentioned folder settings.
 
<!--T:222-->
Check also that your Favourite Folders are the ones you have chosen before.
 
<!--T:212-->
'''6. Initiate a mail check'''
 
<!--T:213-->
Start a mail check for your accounts. I suggest doing it per account
 
<!--T:214-->
First do for IMAP, if you have.
 
<!--T:215-->
Next is to check (import) your local mails. One solution is to do a full check in one go <menuchoice>File -> Check Mail In</menuchoice> and select the local account, the other is to click one by one on the folders, that should initiate the check for that folder (alternatively right click on the folder name and select <menuchoice>Update Folder</menuchoice>).
 
<!--T:216-->
The initial import might be slow and could use a lot of memory, especially in case you have folders with a large amount of mail. In that case per-folder check is preferred. In case the check (complete or for one folder) is finished and the memory usage is still high, you could restart the Akonadi server - as seen above - or just the maildir agent, if you use <code>akonadiconsole</code>. Don't worry, this high memory usage is ''only'' for initial import.
 
<!--T:217-->
Initiate a check mail for POP3 resources.
 
<!--T:218-->
Hopefully after these steps, you will have a much nicer '''KMail''' experience.
 
===Local Folders is added over and over=== <!--T:235-->
 
<!--T:236-->
In some cases you might end up with a maildir account pointing to a certain place (like <tt>$HOME/Mail</tt>), but you still see a Local Folders  folder in the folder list with Inbox/Outbox/Trash/Drafts/etc. subfolders and KMail keeps putting mails there, especially sent mails.
The problem is that certain folders are marked as special folders (system folders) and if you don't have them, KMail cannot operate correctly. That is the reason why it keeps re-creating that folder.
A this time there is no easy way to change this in the UI for all types of special folders. Here are what you can do:
 
<!--T:223-->
# The ''Sent-Mail, Drafts and Templates'' folder is configurable for each identity. Go to  <menuchoice>Settings->Configure KMail->Identities</menuchoice>, select your identity, click on <menuchoice>Modify</menuchoice>, go to the <menuchoice>Advanced</menuchoice> tab and set the folders to point to the right place.</translate>
<translate>
<!--T:224-->
# The default ''Inbox'' is configurable for each POP3 account. Go to  <menuchoice>Settings->Configure KMail->Account</menuchoice>, select your POP3 account, click on <menuchoice>Modify</menuchoice> go to the <menuchoice>Advanced</menuchoice> tab and set the <menuchoice>Destination folder</menuchoice>.</translate>
<translate>
<!--T:225-->
# For IMAP accounts you can configure the ''Trash'' folder. Do like above. The setting name is ''Trash folder''.</translate>
<translate>
<!--T:226-->
# The most problematic part is the ''Outbox''. First, locate ''specialmailcollectionsrc'' in your KDE configuration directory (<tt>$HOME/.kde4/share/config</tt> or similar). It contains something like this:
 
<!--T:227-->
{{Input|1=
[SpecialCollections]
DefaultResourceId=akonadi_maildir_resource_0}}
 
<!--T:228-->
Now start <code>akonadiconsole</code>, on the <menuchoice>Agents</menuchoice> tab, locate your local account in which you want to have your ''Outbox'' folder, click on it and note the identifier that appears in the lower part ( ''akonadi_maildir_resource_XXX'' or similar). Put this identifier in the above shown ''specialmailcollectionsrc'', by replacing the existing one.
 
<!--T:229-->
After that restart akonadi (you can do from the akonadiconsole, <menuchoice>Server->Restart Server</menuchoice> or from command line with
 
<!--T:230-->
{{input|1=akonadictl restart}}
 
<!--T:231-->
Now remove the Local Folder that you don't want to use anymore.
 
<!--T:232-->
If it keeps reappearing and the '''Mail Dispatcher Agent''' still crashes, you need to do one more thing in ''akonadiconsole''. Go to the <menuchoice>Browser</menuchoice> tab, find the outbox you '''want''' to use, right click on it, <menuchoice>Folder Properties</menuchoice>, <menuchoice>Attributes</menuchoice> tab, enter '''SpecialCollectionAttribute''' then <menuchoice>Add</menuchoice>, double click on the <menuchoice>Value</menuchoice> near the '''SpecialCollectionAttribute''' and enter '''outbox'''. Add also another attribute, the attribute name has to be '''ENTITYDISPLAY''' and the value '''("outbox" "mail-folder-outbox" "" ())''' (just copy paste from here). Restart akonadi and now you should be able to remove completely the unneeded local folder account.


'''Solution:''' Settings -&gt; Configure KMail -&gt; Accounts -&gt; Receiving (tab)-&gt; "select the account to exclude"-&gt; Modify-&gt;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.
<!--T:250-->
If you "lost" your '''Trash''' folder and want to set a new folder to act as '''Trash''', you can use the same approach described above, but for the '''SpecialCollectionAttribute''' value enter '''trash''' .


==Hints and Tips==
==Hints and Tips== <!--T:104-->
===Add a Tag to aid searching===
 
===Add a Tag to aid searching=== <!--T:105-->
 
<!--T:106-->
You must first define your tags, which is done in <menuchoice>Settings->Configure KMail->Appearance->Message Tags</menuchoice>.  Now you will find that the (right-click) ''context menu'', under <menuchoice>Mark Message</menuchoice>, offers you the choice of your defined tags.
You must first define your tags, which is done in <menuchoice>Settings->Configure KMail->Appearance->Message Tags</menuchoice>.  Now you will find that the (right-click) ''context menu'', under <menuchoice>Mark Message</menuchoice>, offers you the choice of your defined tags.


===Watch threads===
===Watch threads=== <!--T:107-->
If you want to follow a thread, right click and choose '''"Mark Thread"->"Watch Thread"'''.


<!--T:108-->
If you want to follow a thread, right click and choose <menuchoice>Mark Thread -> Watch Thread</menuchoice>.
<!--T:109-->
From this point on all messages on the thread that starts in this message will be marked as Watched.
From this point on all messages on the thread that starts in this message will be marked as Watched.


====Watch your own threads:====
====Watch your own threads:==== <!--T:110-->


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.
<!--T:111-->
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":'''
=====Create a filter to mark all your incoming messages to a mailing list as "Watched"===== <!--T:112-->


<!--T:113-->
To create a filter go to:
To create a filter go to:
'''"Settings"->"Configure Filters"'''
<menuchoice>Settings -> Configure Filters</menuchoice>


*select "Match all of the following"
<!--T:114-->
*select <menuchoice>Match all of the following</menuchoice>
*Add the conditions:
*Add the conditions:
**From ; Contains ; yourmail@maildomain''[1]''
**<menuchoice>From -> Contains -></menuchoice> '''''yourmail@maildomain''''' [1]
**List-Id ; Contains ; listID''[2]''
**<menuchoice>List-Id -> Contains</menuchoice> '''''listID''''' [2]


''[1]replace yourmail@maildomain with your outgoing mail address''
<!--T:115-->
[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).''
<!--T:116-->
[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"'''.
<!--T:117-->
*Under <menuchoice>Filter Actions</menuchoice> choose <menuchoice>Mark As -> Watched</menuchoice>.


In the "Advanced" tab  
<!--T:118-->
*Uncheck "if this filter matches, stop processing here".
In the <menuchoice>Advanced</menuchoice> tab  
*Uncheck <menuchoice>if this filter matches, stop processing here</menuchoice>.


<!--T:119-->
so that other filters such as sorting the incoming messages from the mailing list to sub-folders would execute.
so that other filters such as sorting the incoming messages from the mailing list to sub-folders would execute.


<!--T:120-->
*Place that filter before other filters that may stop the filtering process,  
*Place that filter before other filters that may stop the filtering process,  
or simply put it first.
or simply put it first.
(changing the filters order is done using the two arrows up and down, under the available filters list)
(changing the filters order is done using the two arrows up and down, under the <menuchoice>available filters list</menuchoice>)


'''create a search on mailing list messages:'''
=====Create a search on mailing list messages===== <!--T:121-->


<!--T:122-->
Go to the folder where your mailing list messages are stored e.g (Local Folders/KDE-PIM-USERS)
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"'''.
and hit <keycap>S</keycap> key or in the menu <menuchoice>Edit -> Find Messages</menuchoice>.


*Select "Match all of the following"''[3]''
<!--T:123-->
*Add the condition: "Message Status" "is" "Watched"
*Select <menuchoice>Match all of the following</menuchoice>[3]
*Give the search an informative name (Search folder name) like "KDE-PIM-USERS-Watched"
*Add the condition: <menuchoice>Message Status -> is -> Watched</menuchoice>
*Make the search, after it is done you can close the search window.
*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.


<!--T:124-->
Now whenever you start a thread or participate in one, it is Watched.
Now whenever you start a thread or participate in one, it is Watched.


''[3]pay attention to the "Include sub-folders".''
<!--T:125-->
''[3] Pay attention to the <menuchoice>Include sub-folders</menuchoice>.''
 
===E-Mail Translation=== <!--T:126-->
''Symptom'': you receive mail messages in different languages and want to translate them without doing lots of copy and paste.
 
<!--T:127-->
''Solution'': using an external program to translate your E-Mail and display it.
 
====Step by step implementation==== <!--T:128-->
 
<!--T:129-->
{{Warning|1=The provided solution was tested limited number of times and should be used with caution.}}
 
<!--T:130-->
* Prerequisites, make sure you have those before starting
** libtranslate
** perl
** perl module Email::MIME
** kmail
* Setting up a pipe filter
** In '''Kmail''' go to <menuchoice>Settings -> Configure filters</menuchoice>
*** create a new filter and name it '''Translate'''
*** add a Filter Criteria that would be always true (e.g <menuchoice>Subject -> Does not equal -> "321546543"</menuchoice>)
*** add a Filter Action <menuchoice>Pipe Through</menuchoice> {{Input|1=~/bin/mail_translate.pl}}
*** open the '''Advanced''' tab and un-check everything except for <menuchoice>Add this filter to the Apply Filter menu</menuchoice>, 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.
</translate>
{{Input|<syntaxhighlight lang="perl">
#!/usr/bin/perl
 
use Email::MIME;
 
my $from_language = 'en';
my $to_language = '<translate><!--T:141-->
he</translate>';
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;
</syntaxhighlight>}}
<translate>
<!--T:136-->
* Make the script executable using {{Input|1=$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 [https://www.loc.gov/standards/iso639-2/php/code_list.php the ISO 639-2] list.
 
<!--T:137-->
** 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 <menuchoice>Apply Filter -> Filter Translate</menuchoice> 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 {{Input|1=$~/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.
 
<!--T:138-->
{{Note|1=this script will only translate the Plain Text parts of an E-Mail message and not the HTML parts.}}
 
===Edit and save messages without changing message parameters=== <!--T:159-->
 
<!--T:160-->
Get rid of that long mail trail in top-poster replies. You can edit a message and remove unwanted parts by saving it to disk (<menuchoice>Save As</menuchoice>), editing it separately in a text editor, and then import it again. Just delete the original. This method also works to detach encapsulated messages and keep them as separate messages.
 
=== Easily archive all e-mails === <!--T:251-->
 
<!--T:252-->
Create a filter that matches all messages and copies them to a folder, and then create a shortcut to manually apply this filter. It can be done following these steps:


<!--T:253-->
# In '''KMail''' go to <menuchoice>Settings -> Configure Filters</menuchoice></translate>
<translate>
<!--T:254-->
# Click the {{Icon|document-new}} button on the left and give your filter a name (this will appear on the shortcut also, I simply used "Archive")</translate>
<translate>
<!--T:255-->
# Under '''Filter Criteria''', choose <menuchoice>Match all messages</menuchoice></translate>
<translate>
<!--T:256-->
# Under '''Filter Actions''', choose <menuchoice>Move into Folder</menuchoice> and select the folder you want to archive to.</translate>
<translate>
<!--T:257-->
# In the <menuchoice>Advanced</menuchoice> tab, uncheck <menuchoice>Apply this filter to incoming messages</menuchoice></translate>
<translate>
<!--T:258-->
# Then check <menuchoice>Apply this filter on manual filtering</menuchoice>, <menuchoice>Add this filter to the Apply Filter menu</menuchoice> and <menuchoice>Additionally add this filter to the toolbar</menuchoice>.</translate>
<translate>
<!--T:259-->
# Click the button with the {{Icon|configure}} icon to select a shortcut (I used <keycap>q</keycap> because it didn't conflict with anything else)</translate>
<translate>
<!--T:260-->
# Choose an Icon for the shortcut menu</translate>
<translate>
<!--T:261-->
# Click <menuchoice>Apply</menuchoice> or <menuchoice>OK</menuchoice> and you are Done!


<!--T:139-->
[[Category:Office]]
[[Category:Office]]
[[Category:Internet]]
[[Category:Internet]]
[[Category:Configuration]]
[[Category:Configuration]]
</translate>

Latest revision as of 13:33, 7 October 2022

Is my problem already known?

Symptom: You have a problem with KDE-PIM and would like to know whether others have reported and solved the problem. You wonder how to read the archives of the kdepim-users mailing list.

Solution: This is a good habit to cultivate. Try the MARC archives at https://lists.kde.org/?l=kdepim-users&r=1&w=2


Configuration

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 Settings -> Configure KMail -> Identities -> (Choose an identity) -> Modify -> Advanced -> Sent-mail-folder


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 Settings -> Configure KMail -> Accounts -> Receiving tab -> (Choose an account) -> Modify -> Advanced -> Trash folder

In some versions you will need Settings -> Configure KMail -> Accounts -> Receiving tab -> (Choose an account) -> Modify -> IMAP settings tab -> Trash folder (or Wastebin folder, depending on your distro)


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


Spam filtering 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 won't 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.


Get more screen space in KMail

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

Solution: In 4.2 you have a new set of icons next to the quick search bar. You can use these to choose a different theme and a different aggregation. If you want to change the look so that a mail uses a single row instead of two rows, go to - the tooltip says Select View Appearance (Theme) - and change the theme to Classic. If you want to disable grouping by date, change the aggregation to Standard Mailing List. Now your KMail will look exactly like it did in earlier versions.

In 4.4 and 4.5 these settings were moved to the main menu, View -> Message List -> Theme and View -> Message List -> Aggregation


Get more screen space in KMail - reduce font size

Symptom: You still lack screen space, and would prefer more visible lines at the expense of font size, but your attempts only partially work.

Solution: In Settings -> Configure KMail -> Appearance -> Fonts you can select Custom Font 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.

Now you have to look at that set of new icons at the top right, close to the search box, for - the tooltip says Select View Appearance (Theme). Choose Configure, then Appearance tab. There is a list of Content Items, and below that a mockup of column headers. 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.

In later versions that don't have those icons you can make the changes by right-clicking on the Message List headers, and selecting Theme -> Configure -> Appearance Tab Again, you need to work with the header of each column.


Un-configure KMail folder tool tips

Symptom: You are using KMail under KDE 4.2 or later 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 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 and Mageia don'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 (or Mageia) Control Center (MCC). Other than this name change, the method is as described above.


Store messages from separate email accounts in separate inbox folders

For POP create folders in ~/.kde/share/apps/kmail/mail/ (copy and rename the default folder). These then appear in the drop down list in Settings -> Configure KMail -> Accounts -> Modify -> POP Settings -> Destination Folder.

Create other folders in the same location for sent mail. These can be set in Identities -> Advanced.

This recipe may not be applicable to KMail 2 due to move to Akonadi-based mail storage. ---

Configure GMail without OAuth

Solution: In KMail, change option Settings -> Configure KMail -> Accounts -> Receiving tab -> (Choose an account) -> Modify -> Advanced -> Authentication from Gmail to PLAIN.

For some personal reasons Google does not consider usual IMAP authentication methods as "secure", so you will need explicitly allow it.

Go to the Less secure apps section of your Google Account and turn on Allow less secure apps. Details: https://support.google.com/accounts/answer/6010255

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


You get the error "Unable to fetch item from backend" when entering IMAP folder

There are a number of possible reasons for this and it's something the KMail team hopes to tackle in time. Meanwhile, there are some work-arounds:

Work-around 1

  • edit ~/.local/share/akonadi/mysql.conf
  • Under the [mysql] section, add:
  • binlog_format=row

If this doesn't work, try work-around 2 (below).

Work-around 2

This one is mostly a matter of restarting so KMail can fetch those pesky items... Some possible steps: Use Alt + F2 or Konsole to type: kquitapp kmail, then wait a minute, then akonadictl stop, wait a minute, type akonadictl start, wait a minute, type kmail. This stops KMail (closing all windows), stops the KMail backend, starts the KMail backend, starts KMail. Having a working internet connection increases the chances of success. Sometimes, you can also just do kquitapp kmail, wait a minute, and start KMail again. Often, a few restarts seem to be needed. It is unclear what is the reason for this, but on bad network connections it is more likely to happen.

See also the below item for how akonadiconsole can be helpful.

Your mails are not being sent, without error messages

If KMail does not send mail without saying anything, the 'agent' responsible for 'dispatching' the mails can be stuck. Of course, you need to ensure you have proper network connectivity for mail to be send!

To remedy this, it might help to abort the current action and re-start it. First, quit KMail by using KRunner (Alt + F2) or Konsole and typing: kquitapp kmail. Note that a normal Alt + F4 or File -> Quit does not do the trick! Wait a minute, then start KMail again. Now start akonadiconsole using KRunner (Alt + F2) or Konsole. Go to the Mail Dispatcher Agent, do a right-click and abort the current action. You will most likely get some error messages popping up. Go back to KMail and choose File -> Send Queued Messages. Now it might work. If not, instead of aborting the current action, try toggling the offline/offline status of the Mail Dispatcher Agent or restarting things like mentioned in the workaround 2 of the problem above this one.

Note

akonadiconsole can be quite helpful for a number of situations as it shows all the 'agents', the separate components of the KMail backend. You can stop and start them, put them in offline mode, abort ongoing actions etc. It can be very helpful when things get stuck.


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


KMail spellchecking doesn't work with the Deutsch dictionary

Symptom: Your default dictionary is set to "Deutsch", but when typing in German, the spell-checker doesn't alert you to mis-spelled words.

Solution: Change your default dictionary to "Deutsch (Deutschland)". It's worth remembering, too, that you can associate different dictionaries to each Identity, and also by using the View menu on a Compose screen, you can choose to have the dictionary used displayed while composing a message, and change dictionaries, using that, when desired.

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.

Symptom: When you type in the composer window, characters appear very slowly.

Possible Solutions: This is a known bug. Some have reported that disabling then re-enabling desktop effects may help. Others have reported that switching to a desktop theme, other then Oxygen, works.

Problem: Cannot save SMTP password - kwallet is unavailable

Symptom: When saving your SMTP password in the KMail SMTP configuration dialog you get a "kwallet is unavailable" message.

Solution: You need to reset the KWallet configuration for KMail.

  • Stop KMail
  • Start KDE Wallet Manager
  • Open Settings -> Configure Wallet
  • Delete the Kontact and KMail entries (Kontact or KMail entry may not be there)
  • Save and close KDE Wallet Manager
  • Start KMail
  • Enter the SMTP password in the Configure Account dialog
  • Save - answer yes to the KWallet dialog

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

Firefox 3 - In the Firefox menu, select Preferences -> General, choose the Applications tab, then type
mailto
in the search box. Choose KMail

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

You can also use the script in Tutorials/Modify_KDE_Software_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.

KMail2 Issues

KMail2 doesn't send mail

Some users find that mail does not go out, and it appears that smtp is missing, even though the Settings page looks correct. It has been reported that this is cured by opening akonadiconsole and adding Mail Dispatcher Agent.

If the computer was suddenly turned off in suspend mode (e.g. by a power cut) sometimes e-mails simply stay in the outbox without being sent, but no error message is generated either. This may be due to the fact that the Mail Dispatcher Agent is set to "offline" in the configuration file during suspend and is not changed back due to the "crash". Edit the following file:

~/.config/akonadi/agent_config_akonadi_maildispatcher_agent

and change

[Agent]
Online=false

to

[Agent]
Online=true

Clean start after a failed migration

In case migration from KMail 1 to KMail 2 fails or you have weird problems after it, you can try to do a clean import of your data, instead of migrating the existing settings. Be warned, that needs more manual setup, so do only if you are confident with setting up again your KMail accounts, and it can generate a large amount of network traffic for IMAP resources.

1. Stop Akonadi and related applications - quit KMail/Kontact/KOrganzier, and issue this command:

akonadictl stop

Make sure no Akonadi or MySQL process is running:

ps ux | grep mysql
ps ux | grep akonadi

They should not show anything else but the grep process itself.


2. Remove old Akonadi database and config - delete the following folders

~/.local/share/akonadi
~/.config/akonadi

You might want to also delete also the files starting with akonadi from

~/.config

but it's actually quite convenient not to do that: then recreating the resources (in the same order as before) will auto-fill all your settings automatically again.

3. Restart Akonadi server

akonadictl start


4. Add back the accounts

Now it is time to add back your account. You can use KMail (Kontact) for it, or you can use the akonadiconsole tool.

In KMail: Settings -> Configure KMail -> Accounts and use Add.

If you use IMAP, add a new IMAP E-Mail server . If you want disconnected mode (so you can read the mails offline), enable it on the Advanced tab. Be sure to check that you are subscribed to all your important folders.

You might already see a Local folder resource. This points to a local maildir folder. You can either modify this to point to your existing maildir folders or you can add a new resource for local mails.

When adding a maildir resource you can choose between KMail Mail Folder or Maildir. Unless you have a mixed folder containing both maildir folders and mbox files, you should choose Maildir. For independent mbox files, like the one in the /var/spool/mail, you can set up a new MBox folder.

Add the POP3 accounts as well. In case you have multiple Local Folders set up, choose on the Advanced tab the destination folder where the newly downloaded mails are put.

For all accounts, configure the mail check interval. For Local folders disable interval checking and also disable Include in manual mail check in the Retrieval options.

Add the sending (SMTP) accounts.

5. Fix your filters, identities and favourite folders

If you have client side filtering (common with POP3 mails), go to Settings -> Configure Filters and fix the destination folder for the filters, they most probably are wrong. Otherwise mails will end up in folders you don't expect.

Spam filter (at least in version 4.7.3 and earlier) does not work as expected in that the rule that the wizard creates does not send spam to the folder you have defined.

The workaround for this is to change the "spam" and "spam unsure" (if the spam filter you use support that) from looking at Status-fields in the header X-Spam-Status to look "Anywhere in headers" for X-"yourspamfilter"-Classification: SPAM or unsure. Look at the filters the wizard creates and copy the "contains" part. Example for Spambayes: X-Spambayes-Classification: spam and X-Spambayes-Classification: unsure


You also need to verify the identity settings and set the sent-mail, drafts and templates folders to point to the right folders. To do that go to Settings -> Configure KMail -> Identities, modify the identity, go to the Advanced tab and modify the above mentioned folder settings.

Check also that your Favourite Folders are the ones you have chosen before.

6. Initiate a mail check

Start a mail check for your accounts. I suggest doing it per account

First do for IMAP, if you have.

Next is to check (import) your local mails. One solution is to do a full check in one go File -> Check Mail In and select the local account, the other is to click one by one on the folders, that should initiate the check for that folder (alternatively right click on the folder name and select Update Folder).

The initial import might be slow and could use a lot of memory, especially in case you have folders with a large amount of mail. In that case per-folder check is preferred. In case the check (complete or for one folder) is finished and the memory usage is still high, you could restart the Akonadi server - as seen above - or just the maildir agent, if you use akonadiconsole. Don't worry, this high memory usage is only for initial import.

Initiate a check mail for POP3 resources.

Hopefully after these steps, you will have a much nicer KMail experience.

Local Folders is added over and over

In some cases you might end up with a maildir account pointing to a certain place (like $HOME/Mail), but you still see a Local Folders folder in the folder list with Inbox/Outbox/Trash/Drafts/etc. subfolders and KMail keeps putting mails there, especially sent mails. The problem is that certain folders are marked as special folders (system folders) and if you don't have them, KMail cannot operate correctly. That is the reason why it keeps re-creating that folder. A this time there is no easy way to change this in the UI for all types of special folders. Here are what you can do:

  1. The Sent-Mail, Drafts and Templates folder is configurable for each identity. Go to Settings->Configure KMail->Identities, select your identity, click on Modify, go to the Advanced tab and set the folders to point to the right place.
  2. The default Inbox is configurable for each POP3 account. Go to Settings->Configure KMail->Account, select your POP3 account, click on Modify go to the Advanced tab and set the Destination folder.
  3. For IMAP accounts you can configure the Trash folder. Do like above. The setting name is Trash folder.
  4. The most problematic part is the Outbox. First, locate specialmailcollectionsrc in your KDE configuration directory ($HOME/.kde4/share/config or similar). It contains something like this:
[SpecialCollections]
DefaultResourceId=akonadi_maildir_resource_0

Now start akonadiconsole, on the Agents tab, locate your local account in which you want to have your Outbox folder, click on it and note the identifier that appears in the lower part ( akonadi_maildir_resource_XXX or similar). Put this identifier in the above shown specialmailcollectionsrc, by replacing the existing one.

After that restart akonadi (you can do from the akonadiconsole, Server->Restart Server or from command line with

akonadictl restart

Now remove the Local Folder that you don't want to use anymore.

If it keeps reappearing and the Mail Dispatcher Agent still crashes, you need to do one more thing in akonadiconsole. Go to the Browser tab, find the outbox you want to use, right click on it, Folder Properties, Attributes tab, enter SpecialCollectionAttribute then Add, double click on the Value near the SpecialCollectionAttribute and enter outbox. Add also another attribute, the attribute name has to be ENTITYDISPLAY and the value ("outbox" "mail-folder-outbox" "" ()) (just copy paste from here). Restart akonadi and now you should be able to remove completely the unneeded local folder account.

If you "lost" your Trash folder and want to set a new folder to act as Trash, you can use the same approach described above, but for the SpecialCollectionAttribute value enter trash .

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


Edit and save messages without changing message parameters

Get rid of that long mail trail in top-poster replies. You can edit a message and remove unwanted parts by saving it to disk (Save As), editing it separately in a text editor, and then import it again. Just delete the original. This method also works to detach encapsulated messages and keep them as separate messages.

Easily archive all e-mails

Create a filter that matches all messages and copies them to a folder, and then create a shortcut to manually apply this filter. It can be done following these steps:

  1. In KMail go to Settings -> Configure Filters
  2. Click the button on the left and give your filter a name (this will appear on the shortcut also, I simply used "Archive")
  3. Under Filter Criteria, choose Match all messages
  4. Under Filter Actions, choose Move into Folder and select the folder you want to archive to.
  5. In the Advanced tab, uncheck Apply this filter to incoming messages
  6. Then check Apply this filter on manual filtering, Add this filter to the Apply Filter menu and Additionally add this filter to the toolbar.
  7. Click the button with the icon to select a shortcut (I used q because it didn't conflict with anything else)
  8. Choose an Icon for the shortcut menu
  9. Click Apply or OK and you are Done!