Adding a header to a mail created in CRON

Good day!
There is an interesting question.

After the script is run via CRON, which has the output (stdout), formed mail.
A mail is generated and sent via the MTA.

Question: how in the headers to add their own headers?

Interesting the Content-Type header.
Fix CRON source code is not considered.
I understand you need the wrapper to form the letters - the mediator.
May already have a solution in ports?
 
Have the script mail by itself instead of relying on a script's output being sent.
 
Have the script mail by itself instead of relying on a script's output being sent.
Therefore, I ask: write your own, or have ready in /usr/ports. If there is a ready, to show. If not ready, then tell how to write. :)
 
It depends on the script, Perl, Python, Ruby, etc. all have specific modules you can use to send email. This includes converting things to a MIME compatible format. For shell scripts you can use mail(1) combined with uuencode(1) and a bit of clever scripting.
 
It depends on the script, Perl, Python, Ruby, etc. all have specific modules you can use to send email. This includes converting things to a MIME compatible format. For shell scripts you can use mail(1) combined with uuencode(1) and a bit of clever scripting.
It would be very ... difficult :)
When dozens of scripts, this is not efficient.
It is better to have a single point of entry, which forms letters in a single rule.
While these rules are laid down in /usr/src/usr.sbin/cron/cron/do_command.c who wouldn't want to touch it.
Ideally the solution when a variable MAILCMD own script, where the preparation of the letter.
 
Back
Top