Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable-substitution in MAILFROM does not work #182

Open
lowrider59 opened this issue May 27, 2024 · 0 comments
Open

Variable-substitution in MAILFROM does not work #182

lowrider59 opened this issue May 27, 2024 · 0 comments

Comments

@lowrider59
Copy link

Is this cronie the cron/crontab implementation used in RHEL9?
(If no, you can just reject this ticket.)

If yes, I think there is a bug vs what the documentation says:

man 5 crontab
in RHEL9 says:

"Note: Both MAILFROM and MAILTO variables are expanded, so setting them as in the following example works as expected: [email protected] ($USER is replaced by the system user)"

After a lot of trail'n'error I have concluded that any $variable in the
MAILFROM=someExpression
will cause that assignment to fail/get ignored and the sender of crontab mails will fall back to the default.
Hardcoding the value (without any $variable) works, but no variable substitution will work.

It's very easy to make a crontab test-case, like:

[email protected]
* * * * * scriptThatDoesntExist.sh

The mail sent will have the default sender: user@hostname
not what you specified in MAILFROM.

If I'm totally missing something here, I am happy to get enlightened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant