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.

Cronjob MAILTO being ignored

Discussion in 'E-mail Discussions' started by Somethingblue, Jul 31, 2006.

  1. Somethingblue

    Somethingblue Member

    Joined:
    Sep 28, 2005
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    As far as I'm aware this is only affecting one user on our server. The user sets a cronjob up and the output to be sent to an email address.

    Here's his crontab:

    Code:
    MAILTO="validemail@domain.com"
    1 12 28 * * /usr/bin/php -q /home/user/public_html/clients/admin/cron_invoice.php > /dev/null
    1 12 * * * /usr/bin/php -q /home/user/public_html/clients/admin/cron_1215.php > /dev/null
    1 0 28 * * /usr/bin/php -q /home/user/public_html/clients/admin/cron_reports_monthly_revenue.php > /dev/null
    0 0 28 * * /usr/bin/php -q /home/user/public_html/clients/admin/cron_reports_new_monthly_signups.php > /dev/null
    5 0 * * 6 /usr/bin/php -q /home/user/public_html/clients/admin/cron_weekly_sales.php > /dev/null
    0 * * * * /usr/bin/php -q /home/user/public_html/clients/admin/cron_resolver.php > /dev/null
    The cron emails are sent, but they are sent to user@servername.com:

    Code:
    A message that you sent contained no recipient addresses, and therefore no
    delivery could be attempted.
    
    ------ This is a copy of your message, including all the headers. ------
    
    To: 
    Subject: DB Backup: 07/23/2006 12:01:02 pm
    From: 
    Reply-To: 
    X-Mailer: PHP/4.3.11
    Message-Id: <E1G4gO6-0004D1-9M@servername.net>
    Date: Sun, 23 Jul 2006 12:01:02 -0400
    
    Below are the results of the database backup:
    You should save this email in case of disaster!
    -------------------------------------------------
    It's like the MAILTO line in the user's crontab is being ignored. There's no 'To' address in the header of the message that sent. We found these messages in the user's main cPanel email account.

    Also email can be sent successfully to and from the address in the user's crontab.

    Any ideas on what the problem might be? I'm stumped.
     
    #1 Somethingblue, Jul 31, 2006
    Last edited: Jul 31, 2006
  2. Dmitry M.

    Dmitry M. Active Member

    Joined:
    Dec 4, 2003
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    hi

    All your cron jobs outputs info to /dev/null

    This means that your cron doesn't send any letters I think.

    Try to add such command

    */5 * * * * /bin/echo "just a test"

    You'll should be mailed :)

    Also mentioned backup message can be generated by another mail script.
     
  3. iamsamurai

    iamsamurai Registered

    Joined:
    May 24, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    thats the fix. I added your small sample cron and the email went through fine.
     

Share This Page