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.

Delete mail from server after Pop?

Discussion in 'E-mail Discussions' started by rjbsec, Oct 5, 2008.

  1. rjbsec

    rjbsec Member

    Joined:
    Apr 9, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    cPanel leaves mail on the server for all accounts, including those collected by Pop via email client. Accounts that collect email via Pop rarely if ever login to their Webmail account directly to delete old mail.

    Is there a way to:-

    1) Delete email after Pop download to the email client?
    2) Delete all email from the server which is over x days old?

    TIA


    {Edit}

    Just to clarify, I understand that the email client allows removal of user level email from the server and I know that individual account holders can login and delete their own stored email.

    My question does not ask concerning individual accounts and accout users, it relates to server admin at server not account level.

    I understand that most people will do things (or not do them) differently but I am looking for an answer related to deleting old delivered mail at Server Level.
     
    #1 rjbsec, Oct 5, 2008
    Last edited: Oct 7, 2008
  2. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    Those settings should be in your email software i.e. Outlook....
     
  3. rjbsec

    rjbsec Member

    Joined:
    Apr 9, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    That would only control my email account(s), it would not help me to control the issue server wide.
     
  4. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    You could always checkout ConfigServer Mail Queues from configserver.com
     
  5. rjbsec

    rjbsec Member

    Joined:
    Apr 9, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Doesn't that just deal with email as yet undelivered to mailboxes?

    I want to remove old delivered mail that has been read but not deleted, mostly by users reading via Pop download and not deleting it from the server. Some also make email accounts but then forward mail not remembering that it remains on the server.

    It's the delivered, read but undeleted, mail that I want to delete.
    I guess some way to delete all mail on the server 21 days or so after delivery.
     
  6. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    Configserver has two programs, one is mail manage and the other is mail queues. Not sur how to tell if they have been read. I am sure there is a flag set.

    As I said before, the client should use their email software for it. We host over 300 clients, some choose not to delete thier email, it does not matter to us, it is thier disk space to do what they want with.
     
  7. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    POP3 should delete the messages by default when you check the messages. Most POP3 clients have an option to leave the messages on the server after downloading the messages, but all the clients I have ever seen this has to be explicitly enabled.

    Are you sure you are logging into the account as a POP3 account? Or are you logging into the account as an IMAP account?
     
  8. rjbsec

    rjbsec Member

    Joined:
    Apr 9, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Just to clarify, I understand that the email client allows removal of user level email from the server and I know that individual account holders can login and delete their own stored email.

    My question does not ask concerning individual accounts and accout users, it relates to server admin at server not account level.

    I understand that most people will do things (or not do them) differently but I am looking for an answer related to deleting old delivered mail at Server Level.
     
  9. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    This would be something like the aging feature that was around several versions ago.

    One thing to consider. If users are checking their mail solely with webmail or with IMAP, then the messages are suppose to stay on the server. Deleting these messages may cause an adverse affect for those users who wish to keep the messages on the server.

    Ideally, users would only set up mail accounts for e-mail addresses that they intend to check regularly. If the mail accounts are not being logged into or checked regularly, then one might question why it was set up in the first place. The best solution in this case would be to remove the mail account, insure that the default address is set to discard messages, so that your mail server does not have to work on those messages when the mail server receives messages for that mail account.
     
  10. johnmigen

    johnmigen Active Member

    Joined:
    Jan 19, 2008
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    What you can do is run a cron job to remove the files.

    You can change this code to suit your liking.

    find /home/*/mail/*/*/.spam/* -type f -mtime +200 | xargs rm -rf

    These code checks for emails inside the .spam folder which is 200 days old, it then delete all those email that match.

    Making a slight change to the above code
    find /home/*/mail/*/*/cur/*serverdomain.com:2, -type f -mtime +200 | xargs rm -rf

    Notice the :2, this is the Maildir way of tagging the emails, :2,S means read, you can do some testing on your server to see the different file naming convention.

    Please do it with care. Omit the rm -rf argument to test thoroughly.

    Hope that helps.
     
Loading...

Share This Page