Results 1 to 7 of 7

Thread: Crontab mailto not working

  1. #1
    Join Date
    Jul 2011
    Beans
    7

    Crontab mailto not working

    we are using a ubuntu server 10.04 for cronjobs execution
    i added 14 scripts as cronjobs in root crontab with mailto as my mail id.

    I was receiving the cronjob emails regularly, but from the past 2 days am not receiving any cron job mails, i checked the logs for the 14scripts and they all are executed as per schedule and the tasks that they meant to do are successful. But sending the cronjobs mails are failing.

    I tried reinstalling the sendmail service but the the terminal shows sendmail service is already installed in your system.



    --
    Thanks

  2. #2
    Join Date
    Jan 2012
    Beans
    342

    Re: Crontab mailto not working

    sangramanand ...

    Is your sendmail configured to recieve incomming mail and does it have an MX (mail) record?

    If you have bind-utils installed, you can check the MX with the following:

    Code:
    nslookup type=MX <hostname of server>
    Given that it was working until two days ago, it sounds to me like you had a mail delivery problem, and as the recipeint mailserver can't return the mail, or inform you that mail is being held until it can be delivered, it gives up.

    So, unless your mailserver has a world accessable IP and domain name asigned (or an MX record that point to a mailserver that does), and can recieve mail, these things may happen from time to time.

    Some mailservers will auto blacklist mail coming from badly configured mailservers (or mailservers it can't send delivery status to), and so future mail from cron may be dropped. This may be why you haven't had anything in the past two days. I'd suggest you contact your ISP if it continues.

    HTH ...

  3. #3
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,323
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Crontab mailto not working

    Install the mailutils package. Now you can send a message from the command prompt the same way crond does.

    Code:
    echo 'This is a test.' | mail -v -s 'test message' your_mailto_address
    Replace "your_mailto_address" with the address you assigned to the MAILTO variable in your scripts. The "-v" switch will provide a transcript of the transaction.

  4. #4
    Join Date
    Jul 2011
    Beans
    7

    Re: Crontab mailto not working

    Quote Originally Posted by Khayyam View Post
    sangramanand ...

    Is your sendmail configured to recieve incomming mail and does it have an MX (mail) record?

    If you have bind-utils installed, you can check the MX with the following:

    Code:
    nslookup type=MX <hostname of server>
    Given that it was working until two days ago, it sounds to me like you had a mail delivery problem, and as the recipeint mailserver can't return the mail, or inform you that mail is being held until it can be delivered, it gives up.

    So, unless your mailserver has a world accessable IP and domain name asigned (or an MX record that point to a mailserver that does), and can recieve mail, these things may happen from time to time.

    Some mailservers will auto blacklist mail coming from badly configured mailservers (or mailservers it can't send delivery status to), and so future mail from cron may be dropped. This may be why you haven't had anything in the past two days. I'd suggest you contact your ISP if it continues.

    HTH ...
    I entered the below command
    $ps ax | grep sendmail - to check whether the sendmail process is running, and i would the above response.


    sendmail: MTA: rejecting new messages: min free: 100
    Is it because of the insufficient space that its not sending emails?

  5. #5
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,323
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Crontab mailto not working

    Yes.

    Whenever you have a mail problem the first place to look for answers is /var/log/mail.log. You would have seen this message in the log when it first began happening.

  6. #6
    Join Date
    Jul 2011
    Beans
    7

    Re: Crontab mailto not working

    Quote Originally Posted by SeijiSensei View Post
    Yes.

    Whenever you have a mail problem the first place to look for answers is /var/log/mail.log. You would have seen this message in the log when it first began happening.

    the mail.log file was empty, i couldn't find any errors in that.

  7. #7
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,323
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Crontab mailto not working

    You probably ran out of space in /var, since sendmail couldn't queue the messages in /var/spool/mqueue, nor write to /var/log/mail.log.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •