I think the original poster would rather be looking for the line:
RCPT TO: youraddy@someplace.com
And then just record the e-mail address here. This would just be one more branch in your code.
Also, I'm a newbie, but shouldn't you be recording all the log information at one time? To prevent two clients from writing to the log at the same time.
You are right, the code should also flock() the log file
or a sentinel file and maybe do a lot more things off course...
my code was just a trivial example...