Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Issue deleting emails with cron job

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

  1. juanp.realini

    juanp.realini Registered

    Jul 13, 2014
    Likes Received:
    Trophy Points:
    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/*


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

    May I be having a permissions problem??

  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice