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.

Issue deleting emails with cron job

Discussion in 'E-mail Discussions' started by juanp.realini, Jul 14, 2014.

  1. juanp.realini

    juanp.realini Registered

    Joined:
    Jul 13, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi... I am using CPanel Pro 1.0 RC1, not sure what Linux version the server is using
    I am forwarding emails to a gmail account... since the user needs to send emails using his server account from gmail, I need to have an account created (can't use just the forward).
    The problem is that I need to empty the email account periodically... I am trying to implement this with a cron job
    I tried different approaches I found in the forum, but none worked. The guys from the hosting provider asked me to put the cron command in a php file in the public_html folder, and then run the cron job using "curl path_to_php_file"... I did, but that didn't work either.
    When running the normal way, I was always getting "No such file or directory", even though the hosting guys tell me the path is correct... I am using

    /bin/rm /home2/[cpanel_user]/mail/[domain]/[account]/new/*

    and

    /bin/rm /home2/[cpanel_user]/mail/[domain]/[account]/cur/*

    May I be having a permissions problem??


    Thanks
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Have you considered setting up a user-level filter that discards the email after delivery/forward if you have no need for the locally stored mail?

    Thank you.
     
Loading...

Share This Page