Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EMail Log Files As Attachments

Status
Not open for further replies.

rabjac

Programmer
Sep 5, 2001
35
GB
Hi All,

I've written a small shell script that emails some audit information from Redhat Linux 9 to a support email address.

What I want to be able to do is change the script so that it browses a logfile directory. If any files exist in that directory, mail those files as attachments (currently I'm using mail -s ..... to send emails).

Presumptions:
1. The files that exist in the log file directory will always be plain text (no graphics etc).

Can this be done? If so could someone please help?

Also what I've managed to pick up so far is that any attachment files always seem to be uuencoded. Is this still relevant even though any file I want to attach will be plain text?

If this is the case what .rpm files will I need to install on the Redhat 9 server? Currently I have the bare minimum of packages installed (no X Windows etc).

Many Thanks,
Rab.
 
I would use mutt for that. It's a command-line email client that will allow you to attach a file and mail it. First Google hit for "Mutt" will be the official website of it. It's also the default command-line email client with RedHat 9 and later. Check it out. I do what you're trying to do in a production environment all the time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top