Hi misc@,

I have set up mail(1) so that it forwards mails such as the output of
/etc/daily to my mail account and now I want to encrypt these mails
using my public gpg-key. The best solution I have come up with is
changing these two lines at the end of /etc/daily:

- } 2>&1 | mail -s "`hostname` daily output" root
+ } 2>&1 | gpg2 --encrypt -r <key-ID> --armor | mail -s "`hostname` daily 
output" root

...

- [ -s $MAINOUT ] && mail -s "`hostname` daily insecurity output" root < 
$MAINOUT
+ [ -s $MAINOUT ] && gpg2 --encrypt -r <key-ID> --armor < $MAINOUT | mail -s 
"`hostname` daily insecurity output" root

While it perfectly does what I want, I consider it bad habit to change
/etc/daily itself and would like to know if there is any preferred
solution to this issue?

Thanks in advance
Simon

Reply via email to