How to delete all email from Cpanel once a week?

Discussion in 'Site & Server Administration' started by scubita, Jul 8, 2008.

  1. #1
    Hi all, thanks for taking a look.

    How can i create something that cleans all email from all accounts (Cpanel) once a week?

    Thanks
     
    scubita, Jul 8, 2008 IP
  2. zacharooni

    zacharooni Well-Known Member

    Messages:
    346
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    120
    #2
    You would need to traverse /home/<user>/mail/<domain>/<domain_user>/{new,cur,tmp,.spam}
    That's going to be quite nasty.
     
    zacharooni, Jul 9, 2008 IP
    scubita likes this.
  3. Enfinityhost

    Enfinityhost Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    How come the accounts are being popped and downloaded to end users?

    Second, are you allowing unrouteable mail to be delivered to teh default cPanel user? If so you are robbing your server of resources and accepting tons of spam.
     
    Enfinityhost, Jul 10, 2008 IP
  4. scubita

    scubita Peon

    Messages:
    5,550
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #4
    First question, dont know what to answer, sorry.

    Second one, yep, guess all emails from all accounts are being directed to the "main account", so i had 7.000 + emails in there :eek:
     
    scubita, Jul 10, 2008 IP
  5. Enfinityhost

    Enfinityhost Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    popped = pop3

    Outlook or something downloads email which removes it from the server.

    If the default account is accepting mail, I would prevent this from editing the /etc/valiases/$domain.com files and change the entry
    from
    *: cpaneluser
    to
    *: :fail:
     
    Enfinityhost, Jul 10, 2008 IP