Bug 237593 - Strange behaviour of kcron with a MAILTO
Summary: Strange behaviour of kcron with a MAILTO
Status: RESOLVED NOT A BUG
Alias: None
Product: kcron
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Gary Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 10:47 UTC by Anne Wilson
Modified: 2010-10-20 17:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
KCron display, showing strange separation of job and mailto (20.77 KB, image/png)
2010-05-14 10:48 UTC, Anne Wilson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anne Wilson 2010-05-14 10:47:11 UTC
Version:            (using KDE 4.4.3)
OS:                Linux
Installed from:    Fedora RPMs

I added a MAILTO to a cron job intended to send messages to my mail server, rather than the local file.  The MAILTO was ignored.  I used SystemSettings to view the cron job and everything looked fine.  Eventually, someone suggested that the problem was caused by the MAILTO being after the script command, so I moved it to precede the command.  This cured my problem, but the kcron view of it was very odd indeed.  It appeared that the mail command was to be executed at a completely different time to the script.

Although I'm happy with the result, the kcron display is misleading and worrying.
Comment 1 Anne Wilson 2010-05-14 10:48:16 UTC
Created attachment 43566 [details]
KCron display, showing strange separation of job and mailto
Comment 2 Christoph Feck 2010-10-20 01:58:01 UTC
You have to set the MAILTO variable at the "Environment Variables" list at the bottom half of the kcron window.

You cannot set "per command" environment variables as you are used from the bash command line. If you want some variables only to be applied to a specific command, you probably have to wrap it in a separate script that you execute.

If unsure, please verify the resulting crontab using the "crontab -l" command.
Comment 3 Anne Wilson 2010-10-20 12:09:46 UTC
Root mail from every other application already goes to the required address.  If kcron needs something different it should at least be obvious how and where to set it.
Comment 4 Christoph Feck 2010-10-20 17:24:27 UTC
cron uses its own set of environment variables for security reasons, and it is assumed that kcron users understand how cron works. The kcron documentation ("Help" button) additionally mentions the MAILTO variable.