Options without a user interface representation

Apart from the options presented in the configuration dialog, some options can only be set directly in the KMail configuration file or through KIOSK (e.g. Input into Konsole). These so called hidden configuration options cannot be changed via the normal KMail Settings dialog; they must be made by modifying the configuration file using a text editor or the kwriteconfig program. The configuration file is to be written in the format of [Section Name] and the following lines are the variables and their settings. If you are manually editing the configuration file you will need to add the [Section Name] before adding variables. The kwriteconfig will add the section for you as long as you use the --group switch.

The KMail configuration file is called kmail2rc and can be found in your home directory. The location may vary according to your operating system or distribution, but can always be found by running the command kf5-config --path config --locate kmail2rc. For the remainder of this section, assume that the configuration file is located in /path/to/kmail2rc.


Whenever changing these options, make sure to quit KMail first before editing the configuration file. Only restart KMail after you have made and saved the changes to the configuration file.


Send Message Disposition Notifications with an empty sender string. Some servers might be configured to reject such messages, so if you are experiencing problems sending MDNs, make sure this option is set to false. To enable this feature, add to the [MDN] section:

  • Configuration file:

  • kwriteconfig

    % kwriteconfig --file /path/to/kmail2rc --group MDN --key SendMDNsWithEmptySender true


The default setting of false strictly speaking violates Internet standards, but is set that way for practical reasons, to avoid servers rejecting MDNs that KMail generates because they think they are SPAM.


This option allows you to configure the application to close fully, even if there is a system tray icon configured, which would normally keep the application running. To enable the feature, add to the [General] section:

  • Configuration file:

  • kwriteconfig

    % kwriteconfig --file /path/to/kmail2rc --group General --key CloseDespiteSystemTray true


In versions prior to 1.9, KMail saved all attachments to disk with permissions set to 600 — only readable or writable by the owner of the file. In response to user feedback, this was made configurable in KMail version 1.9, with the defaults changed to honor the umask set on the user account while saving files to disk. To enable this feature, add to the [General] section:

  • Configuration file:

  • kwriteconfig

    % kwriteconfig --file /path/to/kmail2rc --group General --key disregardUmask true


With this option enabled, KMail will check on every startup if there is an active out-of-office reply configured, and show a warning if this is the case. To disable the feature, add to the [OutOfOffice] section:

  • Configuration file:

  • kwriteconfig

    % kwriteconfig --file /path/to/kmail2rc --group OutOfOffice --key CheckOutOfOfficeOnStartup false


In case you don't want users to be able to upload their own out-of-office scripts to the server you may add to the [OutOfOffice] section:

  • Configuration file:

  • kwriteconfig

    % kwriteconfig --file /path/to/kmail2rc --group OutOfOffice --key AllowOutOfOfficeSettings false


If you want to allow your users to upload their own out-of-office scripts but you do not want them to be able to change the domain to react to and the react-to-spam setting, you may add to the [OutOfOffice] section:

  • Configuration file:

  • kwriteconfig

    % kwriteconfig --file /path/to/kmail2rc --group OutOfOffice --key AllowOutOfOfficeUploadButNoSettings true


When editing vacation (out-of-office) scripts, the user may specify a domain to limit the sending of such replies to. Applying defaults to the out-of-office configuration dialog via the corresponding button will restore this domain, in case the user has changed it. To pre-load this setting with a default value, add to the [OutOfOffice] section:

  • Configuration file:

  • kwriteconfig

    % kwriteconfig --file /path/to/kmail2rc --group OutOfOffice --key OutOfOfficeDomain myMailDomain.test


By default, out-of-office replies are not sent to messages marked as SPAM. To override this behavior, add to the [OutOfOffice] section:

  • Configuration file:

  • kwriteconfig

    % kwriteconfig --file /path/to/kmail2rc --group OutOfOffice --key OutOfOfficeReactToSpam true