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.

SSH command to detect if domain is using mdbox or maildir

Discussion in 'E-mail Discussions' started by codepoet, Jun 28, 2017.

Tags:
  1. codepoet

    codepoet Member

    Joined:
    Jun 28, 2017
    Messages:
    7
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Hello, I was wondering if there was an official way to detect using ssh if a domain is using mdbox or maildir. The reason why is because I am building a little script that would run on cron and empty the spam assassin spam folder. But since the mdbox and maildir storage directories are different I need a way to find out

    Thanks in advance
     
  2. codepoet

    codepoet Member

    Joined:
    Jun 28, 2017
    Messages:
    7
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Actually to add to this. If a domain is using mdbox, wouldn't it be impossible to empty a specific amount of message in the spam folder since mdbox stores one or more messages per file ?
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Good question! The mdbox format does in-fact stores multiple messages in a single file. To manually delete messages, you'd use the expunge feature with doveadm:

    Tools/Doveadm/Expunge - Dovecot Wiki

    Here's an example of a command you can use to delete all messages from an email account's INBOX folder:

    Code:
    doveadm expunge -u test1@domain.tld mailbox INBOX all
    Thank you.
     
  4. codepoet

    codepoet Member

    Joined:
    Jun 28, 2017
    Messages:
    7
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page