I want to thank all of you for your help and forbearance.
The script is working to my satisfaction, though I still have to see
tonight if it again throws an selinux alert for the logwatch cron task.
Next I will probably be active over on the procmail list as I rewrite
this using formail and procmail.
Here is the 'final' script:
local]# cat mycron
#!/bin/sh
# the sed commands only work if USER == MAILTO in crontab
exec 3>> /var/spool/mail/$USER
exec 100>/var/tmp/$USERlock.lock || exit 1
flock -w 120 100 || exit 1
currentDate=$(date +'%a %b %d %T %Y')
echo "From cron@localhost $currentDate" >&3
currentDate2=$(date +'%a, %e %b %Y %T %z (%Z)')
echo "Date: $currentDate2" >&3
echo "Message-ID: $(uuidgen)@$HOSTNAME" >&3
# (cat) >&3
(sed -e "/^From: / s/$USER/$USER@$HOSTNAME/"|sed -e "/^To: /
s/$USER/$USER@$HOSTNAME/") >&3
echo "" >&3
Again, thanks
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx