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.

Expunge Specific IMAP Folder?

Discussion in 'E-mail Discussions' started by MACscr, Oct 15, 2013.

  1. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    I need to expunge emails that have been sitting in users Junk mail folders every X number of days. I see where I can setup a main.local for dovecot and use:

    Code:
      expire5 = Junk
      expire6 = INBOX.Junk
    
    But I am not sure how to actually set the numbers of days. The other option is typically to do:

    Code:
    /usr/bin/doveadm expunge -A mailbox Trash savedbefore 27d
    
    but its returning:

    Code:
    doveadm(root): Error: User listing returned failure
    I am open to ideas. Note, I am not using SA on my cpanel servers.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you let us know which version of cPanel is installed on your system? cPanel version 11.40 includes Dovecot 2.2 and native support to automatically expunge the Trash directory. It's configured in:

    "WHM Home » Service Configuration » Mailserver Configuration"

    Note that cPanel version 11.40 is currently only available in the "Current" and "Edge" build tiers.

    Thank you.
     
  3. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Michael,

    yes, I am running 11.40, but if you read my question, I am trying to do another expunge a folder OTHER than Trash. The code example was just an example.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can edit the following file for local modifications to the Dovecot configuration:

    Code:
    /var/cpanel/templates/dovecot2.2/main.local
    Note: You can copy this file from /var/cpanel/templates/dovecot2.2/main.default if it does not exist. The relevant section here is:

    Code:
    [% IF expire_trash %]
      expire_dict = proxy::expire
      expire = Trash
      expire2 = "Deleted Messages"
      expire3 = "INBOX.Deleted Messages"
      expire4 = INBOX.Trash
    You can add additional mailbox names to this section (e.g. Junk). After making the custom modifications, you must run:

    Code:
    /scripts/builddovecotconf
    Thank you.
     
  5. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    yeah, i was thinking of that method as well, but wasnt sure how I could control how often the Junk folder would be expired. needs to be a bit more often than the Trash.
     
Loading...

Share This Page