Find the answer to your Linux question:
Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By docbop
Hello, i found out that scripts i have in /etc/cron.d sents alot of emails to postmaster local server mailbox but that account dont exist or is disabled i think the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User postcd's Avatar
    Join Date
    Apr 2011
    Posts
    335

    How to disable scripts in /etc/cron.d to send mail to postmaster?


    Hello,

    i found out that scripts i have in /etc/cron.d sents alot of emails to postmaster local server mailbox but that account dont exist or is disabled i think

    the message:

    Return-Path: <anonymous@vps.mydomain.com>
    Received: (qmail 20156 invoked by alias); 4 Apr 2014 14:43:32 -0000
    Delivered-To: root@vps.mydomain.com
    Received: (qmail 20143 invoked by uid 0); 4 Apr 2014 14:43:32 -0000
    Date: 4 Apr 2014 14:43:06 -0000
    Message-ID: <20140404144306.17828.qmail@vps.mydomain.com>
    From: root@vps.mydomain.com (Cron Daemon)
    To: root@vps.mydomain.com
    Subject: Cron <root@vps> run-parts /etc/cron.hourly
    Content-Type: text/plain; charset=ANSI_X3.4-1968
    Auto-Submitted: auto-generated
    X-Cron-Env: <SHELL=/bin/bash>
    X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
    X-Cron-Env: <MAILTO=root>
    X-Cron-Env: <HOME=/>
    X-Cron-Env: <LOGNAME=root>
    X-Cron-Env: <USER=root>

    ...
    So i want to ask its linux cron default thing to send mail to this mailbox when an script in cron.d is run?

    How i can disable it and sent mail example on error or not at all? thx
    "Avoid the Gates of Hell. Use Linux affordable VPS."

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    Simple explanation at the link below:

    http://www.cyberciti.biz/faq/linux-u...ilto-settings/

  3. #3
    Linux User postcd's Avatar
    Join Date
    Apr 2011
    Posts
    335
    No that dont works for me, i already tried to set MAILTO, but dont send anything, question remains.
    "Avoid the Gates of Hell. Use Linux affordable VPS."

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    947
    When cron starts a process, it captures any output that reaches stdout and stderr, and sends that in an email. To prevent these emails, you can re-direct the stdout and stderr, either to a logfile that you monitor, or /dev/null, if you don't care.

    17 * * * * root cd / && run-parts --report /etc/cron.hourly 2>&1 > /dev/null
    postcd likes this.
    A lion does not lose sleep, over the opinion of sheep.

Posting Permissions

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