Wrapper

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
ghstber
Forum Newbie
Posts: 6
Joined: Fri Aug 11, 2006 8:54 pm

Wrapper

Post by ghstber »

Here's a crazy question:

I want to log all email leaving the server via sendmail, and more "user friendly" than the sendmail logs. To do this, I have decided that I would like to write a simple wrapper for sendmail to:

1) find the file calling sendmail so we know which script file is calling sendmail.
2) take the calling script and email information provided to sendmail and place them into a log file on the server.
3) feed sendmail the email so the email can be sent.

I decided that the best way to do this would be Perl, however I placed this here because the real hiccups in coding this are coming when dealing with the non-Perl issues. For example:

1) how do I find the file being accessed via Apache that is calling sendmail?
2) once I parse out and log the email (which I can do), how do I send the email back to sendmail to get the email on it's way?

I hope that this is in the right forum, and if not, please feel free to move it.

Thanks in advance!
Post Reply