1

CentOS 5

I have setup /etc/crontab MAILTO=my@email.com and can get emails with outputs whenever any tasks run by crond. But if I use mail program send email to same email, I CAN'T receive the email. (with command this: mail -s "test email" "my@email.com") Is there any way to check what's happened?

Below is what is working and not:

  • crond can send email to my@email.com (this is just an example, I actually sending to company email)

  • mail can send email to gmail/yahoo/hotmail account

  • mail CAN'T send email to my@email.com

  • It would be helpful if you posted error messages or log messages. Are you getting reject responses? What does type -a mail (Bash) tell you? – Dennis Williamson Oct 14 '10 at 14:06
2

If mail can send to a gmail account, there are mails leaving. In the logs (possibly in /var/log/maillog) you should see, whether your mails to your company are leaving or not. Dependend on that, one has to think about the difference in the path of the mails, which arrive and those which don't.

1

make sure your crons have PATH set or us the absolute path on mail, also need to make sure that your mail server will accept email from this host (may be blocked since it could appear as a spam box)

  • 1
    the cron mailler is called in a different place from where ever your script calls mail, so it has different path info – Jimsmithkka Oct 14 '10 at 11:21

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.