1 (edited by RedMailStarter 2021-03-31 17:56:58)

Topic: Delete all emails from mail account

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer? Installer
- Linux/BSD distribution name and version:  Ubuntu 20.04.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): APACHE
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi there, i love the iRedMail product and tried now to automate some stuff via scripts! I found these scripts on Github (https://github.com/jeekkd/iRedMail-scripts), but there are no scripts or commands for cleaning all email in an user account, or to delete and recreate a user from scratch.

I also found this here but was not able to get it running, looks like it not supported anymore --> https://github.com/drlogout/iredmail-cli

Does someone has a tip for me? How can i delete all email from an account?

Thanks for any help!!

2

Re: Delete all emails from mail account

- Use "doveadm" command with its sub-command "expunge" to delete messages:
  https://wiki.dovecot.org/Tools/Doveadm/Expunge

- With iRedAdmin-Pro and its RESTful API, you can use tool like `curl` to delete / create accounts.
  https://docs.iredmail.org/iredadmin-pro … l.api.html

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee

3

Re: Delete all emails from mail account

ZhangHuangbin wrote:

- Use "doveadm" command with its sub-command "expunge" to delete messages:
  https://wiki.dovecot.org/Tools/Doveadm/Expunge

- With iRedAdmin-Pro and its RESTful API, you can use tool like `curl` to delete / create accounts.
  https://docs.iredmail.org/iredadmin-pro … l.api.html

Thanks for this quick and perfect answer - you deserved your coffee ;-)

4

Re: Delete all emails from mail account

Thanks for the coffee. smile

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee