To permanently delete an email message, the IMAP client must perform an Expunge action on the required emails. The Expunge operation can be performed via the related IMAP command. Each email client has an option to set the behavior for the Expunge operations (example: Purge action for MS Outlook, Compact or Expunge action for Mozilla Thunderbird). This is generally performed during the email client exit.
A complete tutorial on how to purge deleted items for Outlook is available at:
For Mozilla Thunderbird right-click on the account go to Properties, Server Settings and from the drop-down box related to "When I delete a message" you can select several options: "Move it to the Trash folder", "Mark it as deleted" and "Remove it immediately".
Also under the Server Settings tab you can find related options like: "Clean up (Expunge) Inbox on Exit" and "Empty Trash on exit". From this section choose the behavior that best meets your requirements.
You can also perform an Expunge operation, in Thunderbird, on a single folder by right-clicking the respective folder and selecting the "Compact" action.
Note: In order to just hide the messages marked (flagged) as Deleted, in the Webmail interface, you can use the "Hide deleted" action available in the Webmail folder content view.