#!/bin/bash
# Specify the domain name used for the email address
DOMAIN="example.com"
# Specify the local part of the email address
MAILBOX="mailbox"
# Find only files in the new directory and delete them
find /var/qmail/mailnames/$DOMAIN/$MAILBOX/Maildir/new/ -type f -delete
#Enable this string to delete files in the cur directory too
find /var/qmail/mailnames/$DOMAIN/$MAILBOX/Maildir/cur/ -type f -delete
#Alternative way if the above isn't performing well, however as this is using "rm -rf" I think its a bit dangerous
#find /var/qmail/mailnames/$DOMAIN/$MAILBOX/Maildir/new/ -type f -exec rm -rf {} \;