Wrapper
Posted: Thu Aug 17, 2006 5:28 pm
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!
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!