How to move deleted messages in Trash automatically instead of marking them as deleted in Horde?

Created:

2016-11-16 13:23:27 UTC

Modified:

2017-08-08 13:09:29 UTC

1

Was this article helpful?


Have more questions?

Submit a request

How to move deleted messages in Trash automatically instead of marking them as deleted in Horde?

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

Mails cannot be deleted in Horde, they are only marked as deleted in Inbox.

Cause

Option Move deleted messages to your Trash mailbox instead of marking them as deleted in the current mailbox? disabled in Horde.

Resolution

Via Horde interface:

  1. Go to Gear icon > Preferences > Mail > Deleting and Moving Messages:
    delete_mail.png

  2. Enable option Move deleted messages to your Trash mailbox instead of marking them as deleted in the current mailbox?

Via command line interface:

Add "Trash" options in /etc/psa-webmail/horde/imp/prefs.local.php as it is shown below:

# cat /etc/psa-webmail/horde/imp/prefs.local.php
<?php
$_prefs['subscribe']['value'] = 0;
//Move deleted messages to a trash instead of marking them as deleted
$_prefs['use_trash']['value'] = 1;
//display the 'Empty Trash' link
$_prefs['empty_trash_menu']['value'] = 1;

Additional steps

Creating Trash folder on the creation of every new mailbox.

Create a bash script with the following contents:

#!/bin/bash
MAILBOX=`echo "${NEW_MAILNAME}" | cut -f 1 -d '@'`
DOMAIN=`echo "${NEW_MAILNAME}" | cut -f 2 -d '@'`
mkdir "/var/qmail/mailnames/$DOMAIN/$MAILBOX/Maildir/.Trash"
chmod 700 "/var/qmail/mailnames/$DOMAIN/$MAILBOX/Maildir/.Trash"
chown popuser:popuser "/var/qmail/mailnames/$DOMAIN/$MAILBOX/Maildir/.Trash"

In Plesk, go to Tools & Settings > Event Manager > Add Event Handler and set the following values (you can check the second attached screenshot for example values I set on the test server):

  • Event: Mail account created.
  • Priority: you can set any priority as this is the only handler with the Mail account created event.
  • User: root.
  • Command: path to bash script created previously.

Then click OK to create event handle.

Have more questions? Submit a request
Please sign in to leave a comment.