drtravix Posted December 8, 2003 Posted December 8, 2003 I've worked out a shell script which collects various information, parses it a bit with grep and a few other standard commands, and spits out a file called 'error.log' which, if it contains anything, needs to be e-mailed to an address of my choosing along with the unparsed file. Both files are plain text, and don't need to be actually attached to the message - they just need to be printed in the body. I've played around with sendmail a bit, tried piping in my file with the 'proper' header, but can't quite get it to shoot the e-mail off. Does anyone know a good way to do this, or even better have a small code snippet to show how to do this? I know it's fairly simple, I'm probably just missing something small. Thanks for any help. Quote
drtravix Posted December 8, 2003 Author Posted December 8, 2003 Oh, I also tried to create a file that contains: =================== To: addr@**** From: addr2@**** Subject: My subject here Here is test data =================== And then running: /usr/sbin/sendmail -t < testfile It doesn't give any error, but I also don't receive the e-mail. Quote
drtravix Posted December 8, 2003 Author Posted December 8, 2003 Solved. I just started to get the e-mails... it appears that it takes an hour or two to work it's way through sendmail for some reason. Seems to work halfway decent. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.