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.

deleting email older than 30 days

Discussion in 'E-mail Discussions' started by david510, Mar 12, 2005.

  1. david510

    david510 Well-Known Member

    Joined:
    Aug 22, 2004
    Messages:
    473
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    How can we set up cron in cpanel that will delete mail from the inbox that is older than 30 days? Or can we setup this option in any of the webmail or outlook any ideas?? Or can we write any php script for this to delete mail from a specific inbox and set this script as a cron to run once in every month like that ?? any ideas of this??

    Regards,
    David
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    There's always the Aging option that cPanel have added available within cPanel > Mail > Manager Accounts > Aging:
    Other than that cludge, I'm not aware of a solution to do this nicely. Unfortunately, too many people leave mail on the server in POP3 accounts, when the protocol was never designed with that in mind. It's meant to be a temporary store that the user retrieves in its entirety and then deletes once received. So, it really is the users responsibility to delete their email after they have received it. That said, I'm not aware of any scripts that do what you're looking for, but they may be out there.
     
  3. david510

    david510 Well-Known Member

    Joined:
    Aug 22, 2004
    Messages:
    473
    Likes Received:
    0
    Trophy Points:
    16
    THANKS THANKS THANKS THANKS

    It works..
     
  4. maverick23

    maverick23 Well-Known Member

    Joined:
    Feb 23, 2005
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    DataCenter Provider

    does it even works when we check the mail through webmail?
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    No idea, but I doubt it.
     
  6. tloffman

    tloffman Registered

    Joined:
    Feb 27, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Aging not working

    Aging not working for me either. I have several email accounts set up and mail is being forwarded from the various addresses to my primary address. When I log in I am able to get all of my forwarded mail OK and then my email client (Eudora) deletes from server. However, mail is NOT deleted from the accounts that forwarded the mail to my primary account. So, I set aging to 1 day. However, it NEVER works. When I go back into my accounts the old email is always on the server. After reading the various posts here and working with aging myself my conclusion is that it just isn't working - so it's a bug in the software. My hosting company can't figure it out either. In the .pdf doc file for cPanel aging isn't even mentioned.
    Tom Loffman
     
  7. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    I don't know how do do this for all inboxes but for just one inbox, you could set up a cron to run every x days with the command something like:
    Code:
    cd /home/username/mail | echo -n > inbox
    This would delete the contents of the inbox file without deleting the actual inbox !!!
     
  8. truehustercom

    truehustercom Member

    Joined:
    Aug 27, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    seems that would be a bad idea. what if there is mail unread and the cron is ran and your important data is deleted.
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Indeed, that would be a terrible idea - you would almost definitely lose email. The best solution is really to educate users in how email works. That they should use POP3 if they want to retrieve email immediately and to not use their email clients option to leave email on the server. OR to use IMAP if they want to leave email on the server. Email and account quotas are there to prevent users doing stupid things like leaving email on the server that they should be retrieving locally.
     
Loading...

Share This Page