Andrew Sykes wrote:
Stefano,

Were you looking for something like this?

Yes, but extended to all the messages (ideally).

Probably more error logs contains uncomplete messages and could be enhanced like this.

The bug report point to that specific log as an example but also refer to a general approach to the logging.

In that specific log you could add the log of sender and recipient, in many other calls to the logger we could add more contextual informations.

Please keep in mind that the CmdHandlers are now modular so when you get a value from the state map you always have to check for null.

Stefano


I've added this to JIRA (JAMES-437) too.

Index: src/java/org/apache/james/smtpserver/RcptCmdHandler.java
===================================================================
--- src/java/org/apache/james/smtpserver/RcptCmdHandler.java
(revision 370873)
+++ src/java/org/apache/james/smtpserver/RcptCmdHandler.java    (working
copy)
@@ -149,7 +149,7 @@
                     if (!session.getConfigurationData().getMailServer
().isLocalServer(toDomain)) {
                         responseString = "530 "+DSNStatus.getStatus
(DSNStatus.PERMANENT,DSNStatus.SECURITY_AUTH)+" Authentication
Required";
                         session.writeResponse(responseString);
-                        getLogger().error("Rejected message -
authentication is required for mail request");
+                        getLogger().error("Rejected message to: " +
recipientAddress.toInternetAddress().getAddress() + " - authentication
is required for mail request");
                         return;
                     }
                 } else {





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to