thank you - cron mailer script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux