Delete inbox via SSH?
I want to delete all emails received in my email address directly from ssh.
How to do that?
Thanks!
-
find /home//mail///new/ -type f -print -delete find /home//mail///cur/ -type f -print -delete Best to make a backup of the account just in case. 0 -
Hello @Web Sol, You can use the following WHM API 1 or UAPI functions to remove emails via the command line: WHM API 1 Functions - expunge_mailbox_messages - Developer Documentation - cPanel Documentation UAPI Functions - Mailboxes::expunge_mailbox_messages - Developer Documentation - cPanel Documentation For example, you'd use a WHM API 1 command like this to delete all emails older than 1 week within an email account's INBOX folder: whmapi1 expunge_mailbox_messages account=test1@example.tld mailbox=INBOX query="savedbefore%201w"
Thank you.0
Please sign in to leave a comment.
Comments
2 comments