The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to auto-delete spambox emails older than x days?

Discussion in 'E-mail Discussions' started by electric, Jul 26, 2017.

  1. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    705
    Likes Received:
    1
    Trophy Points:
    318
    Hello,

    Many of our customers have enabled the "Spam Box" feature in the SpamAssassin.

    As a result.. we are finding about 150gb of disk space is used by the many .spam folders that are created. Most customers never click the "Clear Spam Box" button, so their spam emails are sitting there for years, and it adds up when there are a lot of customers and spam.

    Is there a setting in cpanel somewhere so admin can automatically delete all emails in all Spam Box folders on the server that are older than x days? (For example 60 or 90 days..)

    Thanks!
     
    #1 electric, Jul 26, 2017
    Last edited: Jul 26, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    We introduced the Email Disk Usage option in cPanel 64:

    There's no corresponding option to use this for all accounts from WHM, but the following WHM API 1 functions are available to make the task a little easier:

    WHM API 1 Functions - expunge_mailbox_messages - Software Development Kit - cPanel Documentation
    WHM API 1 Functions - expunge_messages_for_mailbox_guid - Software Development Kit - cPanel Documentation

    Thank you.
     
  3. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    705
    Likes Received:
    1
    Trophy Points:
    318
    Thanks. Unfortunately, the new "Email Disk Usage" is not very helpful for us because, like most hosting providers, we allocate lots of disk space to the customer, so there is no *need* for the customer to use this feature until it is necessary for them.

    In other words, this new feature is really only helpful for customers who are receiving disk usage notifications. Until that happens, most customers won't know or care about their email account disk space usage. And that is usually not very often, since it is very unusual to *not* oversell disk space.

    For example, let's say we give a 5gb disk space limit to all our customer. (Not oversold too much.) But we have 200 customers, and each of them has 1gb of spambox junk mail. Now that's a LOT of disk space that is used, but the customers don't even know about it so they will never use the "Email Disk Usage" feature.. and our server's disk space is being used for nothing.

    What is needed is a WHM "Tweak Server" setting where admin can specify the desired maximum time limit for any messages in the Spam Box. For example:

    -----------
    Delete all emails in Spam Box after [ x ] days. (Default to 90 days.)
    -----------

    Then if you wanted to get fancy, you could add a configurable option in the customer's cpanel spam assassin page under the "Spam Box" section. (So they can overwrite the server default, if desired.) (And add another option in WHM tweak settings, which says, "Allow cpanel account users to overwrite this setting above. [ ] Yes [x] No"

    I'm willing to pay for this, since it would result in a lot of reclaimed disk space.

    Thanks.

    PS - It needs to work for both maildir and mbox formats, of course. ;)
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I recommend opening a feature request if you'd like to see that type of feature added to the product:

    Submit A Feature Request

    In the meantime, you may find the following thread helpful if you are seeking to implement a custom workaround:

    Auto-deletion of emails

    Thank you.
     
Loading...

Share This Page