Delete email using Putty or Command Line – Linux server

To remove all email older than one year from this account’s Junk folder via the command line, use the following command:

whmapi1 expunge_mailbox_messages account=user@hpiservers.com mailbox=INBOX.Junk query=’savedbefore 52w’

To remove all email older than one year from this account’s INBOX via the command line, use the following command:

whmapi1 expunge_mailbox_messages account=user@hpiservers.com mailbox=INBOX query=’savedbefore 52w’

Leave a Reply

Your email address will not be published. Required fields are marked *