Author: norman
Date: Thu Jan 28 13:19:32 2010
New Revision: 904075

URL: http://svn.apache.org/viewvc?rev=904075&view=rev
Log:
fix @Resource name

Modified:
    
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/integration/ValidRcptHandler.java

Modified: 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/integration/ValidRcptHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/integration/ValidRcptHandler.java?rev=904075&r1=904074&r2=904075&view=diff
==============================================================================
--- 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/integration/ValidRcptHandler.java
 (original)
+++ 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/integration/ValidRcptHandler.java
 Thu Jan 28 13:19:32 2010
@@ -92,7 +92,7 @@
                this.tableStore = tableStore;
        }
        
-       @Resource(name = "mailServer")
+       @Resource(name = "James")
        public void setMailServer(MailServer mailServer) {
            this.mailServer = mailServer;
        }
@@ -112,7 +112,7 @@
        }
 
        public void setVirtualUserTableSupport(boolean vut) {
-               this.vut  = vut;
+               this.vut = vut;
        }
 
        public void setTableName(String tableName) {
@@ -129,13 +129,25 @@
                        MailAddress recipient) {
 
            if (mailServer.isLocalServer(recipient.getDomain()) == false) {
+            session.getLogger().debug("Unknown domain " + 
recipient.getDomain() + " so reject it");
+
                return false;
            }
            
-               if (users.contains(recipient.getLocalPart()) == true) {
+           String username = recipient.toString();
+           
+           // check if the server use virtualhosting, if not use only the 
localpart as username
+           if (mailServer.supportVirtualHosting() == false) {
+               username = recipient.getLocalPart();
+           }
+           
+               if (users.contains(username) == true) {
                        return true;
                } else {
+
                        if (vut == true) {
+                   session.getLogger().debug("Unknown user " + username + " 
check if its an alias");
+
                                try {
                                        Collection<String> targetString = 
table.getMappings(
                                                        
recipient.getLocalPart(), recipient.getDomain());



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to