How can I log all emails going through sSMTP?
I can point my applications to a wrapper script, I just don't know how to write a wrapper script which logs headers and contents to a file (as much information as possible).
The following should work as an sSMTP wrapper script. It logs the parameters it is called with and the data provided on stdin. Change the logfile location and name of the real sSMTP as appropriate.
Remember to make the script executable:
Why don't you just have your SMTP server log all of the messages received, hence capture the entire message?
If you use an external server you could just setup a simple internal server that then relays to the external server.