How to prevent IMAP email delete

I want to disable possibility of deleting incoming emails (button Delete from IMAP on email detail view).
Any help?

Hi maciej.geciow, are you referring to
image
?
If yes, to customize listview action buttons the best way is following this guide:
Adding a button to the listview

Set Thunderbird to auto expunge deleted emails off server here: "Tools → Account Settings → Server Settings for the IMAP mail account Select: Clean up (“Expunge”) Inbox on Exit it will compact the Inbox folder when you exit Thunderbird.

Hi

I have already removed the button from bulk action (it was easy)
I need to remove it from the detail view.

Have you already tried to copy modules/Emails/metadata/detailviewdefs.php to custom/modules/Emails/metadata/detailviewdefs.php
and editing this last file?

I’d substitute

'DELETE', [ 'customCode' => '<input type=button onclick="window.location.href=\'index.php?module=Emails&action=DeleteFromImap&folder=INBOX.TestInbox&folder=inbound&inbound_email_record={$bean->inbound_email_record}&uid={$bean->uid}&msgno={$bean->msgNo}&record={$bean->id}\';" value="{$MOD.LBL_BUTTON_DELETE_IMAP}">' ], 'FIND_DUPLICATES',

with

           `'DELETE',
            'FIND_DUPLICATES',`

Not working. Button still here.

Found solution :slight_smile:

nonimporteddetailviewdefs instead of detailviewdefs.php

1 Like