Here is my patch for Auth.pm, which stores the authenticated user in the Session Notes, which can be later used by plugins like my 'maillog'. I would be thankful if this would be included into the upstream Auth.pm.
If the user information is useful (and I agree that it is), it should be added to the normal logging before stuffing it in ->notes. I was thinking more along the lines of this:
--- Auth.pm (revision 302)
+++ Auth.pm (revision 326)
@@ -316,7 +316,7 @@
} if ( $rc == OK ) {
- $msg = "Authentication successful" .
+ $msg = "Authentication successful for $user" .
( defined $msg ? " - " . $msg : "" );
$session->respond( 235, $msg );
$ENV{RELAYCLIENT} = 1;
@@ -324,7 +324,7 @@
return OK;
}
else {
- $msg = "Authentication failed" .
+ $msg = "Authentication failed for $user" .
( defined $msg ? " - " . $msg : "" );
$session->respond( 535, $msg );
$session->log( LOGERROR, $msg );Michael - I wonder if your quest to create a summary log wouldn't be better served if the ->log call itself were extended with your own code. What I am considering is that log() itself would have hooks that could be registered: your code could then collect the lines it was interested in from a single location, rather than editing all other plugins to support your needs. This would also be a nice way to collect the kinds of summary information that make pretty graphs (see also Robert's recent additions to Trunk).
John
