[jira] Created: (JAMES-579) Update license headers and NOTICE to follow the latest ASF requirements

2006-07-27 Thread Stefano Bagnara (JIRA)
Update license headers and NOTICE to follow the latest ASF requirements
---

 Key: JAMES-579
 URL: http://issues.apache.org/jira/browse/JAMES-579
 Project: James
  Issue Type: Bug
Reporter: Stefano Bagnara
 Assigned To: Stefano Bagnara
 Fix For: 2.4.0


We have to update source file headers and NOTICE content
http://www.apache.org/legal/

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



Conditional build / check for jdbc 3.x presence

2006-07-27 Thread Stefano Bagnara

Can we remove this thing?

AFAIK we now build only against java 1.4+ and it should include jdbc 3.0 
by default.


Any drawbacks?

Stefano


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



svn commit: r426007 [18/18] - in /james/server/trunk: ./ src/java/org/apache/james/ src/java/org/apache/james/context/ src/java/org/apache/james/core/ src/java/org/apache/james/dnsserver/ src/java/org

2006-07-27 Thread bago
Modified: 
james/server/trunk/src/test/org/apache/james/transport/matchers/SMTPIsAuthNetworkTest.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/transport/matchers/SMTPIsAuthNetworkTest.java?rev=426007r1=426006r2=426007view=diff
==
--- 
james/server/trunk/src/test/org/apache/james/transport/matchers/SMTPIsAuthNetworkTest.java
 (original)
+++ 
james/server/trunk/src/test/org/apache/james/transport/matchers/SMTPIsAuthNetworkTest.java
 Thu Jul 27 01:52:06 2006
@@ -1,19 +1,22 @@
-/***
- * Copyright (c) 2006 The Apache Software Foundation.  *
- * All rights reserved.*
- * --- *
- * Licensed under the Apache License, Version 2.0 (the License); you *
- * may not use this file except in compliance with the License. You*
- * may obtain a copy of the License at:*
- * *
- * http://www.apache.org/licenses/LICENSE-2.0  *
- * *
- * Unless required by applicable law or agreed to in writing, software *
- * distributed under the License is distributed on an AS IS BASIS,   *
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or *
- * implied.  See the License for the specific language governing   *
- * permissions and limitations under the License.  *
- ***/
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * License); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
 
 package org.apache.james.transport.matchers;
 

Modified: 
james/server/trunk/src/test/org/apache/james/transport/matchers/SenderIsNullTest.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/transport/matchers/SenderIsNullTest.java?rev=426007r1=426006r2=426007view=diff
==
--- 
james/server/trunk/src/test/org/apache/james/transport/matchers/SenderIsNullTest.java
 (original)
+++ 
james/server/trunk/src/test/org/apache/james/transport/matchers/SenderIsNullTest.java
 Thu Jul 27 01:52:06 2006
@@ -1,19 +1,22 @@
-/***
- * Copyright (c) 2006 The Apache Software Foundation.  *
- * All rights reserved.*
- * --- *
- * Licensed under the Apache License, Version 2.0 (the License); you *
- * may not use this file except in compliance with the License. You*
- * may obtain a copy of the License at:*
- * *
- * http://www.apache.org/licenses/LICENSE-2.0  *
- * *
- * Unless required by applicable law or agreed to in writing, software *
- * distributed under the License is distributed on an AS IS BASIS,   *
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or *
- * implied.  See the License for the specific language governing   *
- * permissions and limitations under the License.  *
- ***/
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * 

[jira] Commented: (JAMES-579) Update license headers and NOTICE to follow the latest ASF requirements

2006-07-27 Thread Stefano Bagnara (JIRA)
[ 
http://issues.apache.org/jira/browse/JAMES-579?page=comments#action_12423809 ] 

Stefano Bagnara commented on JAMES-579:
---

Updated the license headers.
Updated the NOTICE.

Maybe we also need to add a LICENSE file for each library mentioned in the 
NOTICE.

 Update license headers and NOTICE to follow the latest ASF requirements
 ---

 Key: JAMES-579
 URL: http://issues.apache.org/jira/browse/JAMES-579
 Project: James
  Issue Type: Bug
Reporter: Stefano Bagnara
 Assigned To: Stefano Bagnara
 Fix For: 2.4.0


 We have to update source file headers and NOTICE content
 http://www.apache.org/legal/

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



Legal related things to do before James 2.3.0 Release

2006-07-27 Thread Stefano Bagnara

Noel J. Bergman wrote:
Just a reminder. Before we release JAMES v2.3, we're going to 
have to do some non-technical changes. We have to update the 
source headers, notice files, etc.


I just updated the license headers for all files included in our trunk.

I also updated the NOTICE file to include hte new copyrigth statement 
and link to all the softwares we redistribute.


We probably have to add a LICENSE file for each library in our root and
we are done: can anyone confirm this? Have we really to add 10 LICENSE 
files in our root folder?? Maybe we can update the NOTICE text saying to 
look in the licenses folder and add all the licenses files there?


Stefano


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



Re: Legal related things to do before James 2.3.0 Release

2006-07-27 Thread Stefano Bagnara
An additional note: if I understood it correctly ASF require this update 
only for releases done after 1 september 2006 and active branches at 
that time.


As we'll hopefully cut the 2.3.0 release before that date we could 
probably skip this update for the 2.3 branch.


Stefano

Stefano Bagnara wrote:

Noel J. Bergman wrote:
Just a reminder. Before we release JAMES v2.3, we're going to have to 
do some non-technical changes. We have to update the source headers, 
notice files, etc.


I just updated the license headers for all files included in our trunk.

I also updated the NOTICE file to include hte new copyrigth statement 
and link to all the softwares we redistribute.


We probably have to add a LICENSE file for each library in our root and
we are done: can anyone confirm this? Have we really to add 10 LICENSE 
files in our root folder?? Maybe we can update the NOTICE text saying to 
look in the licenses folder and add all the licenses files there?


Stefano



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



Re: New website proposal

2006-07-27 Thread Stefano Bagnara

Noel J. Bergman wrote:

http://people.apache.org/~bago/james/site-20060723/


The source code link for JAMES Server is broken.


Fixed. (it was broken also in our previous site)


Minor nits:

  James where it refers to the project - JAMES

  James where it refers to the server - JAMES Server


I agree. I have not done this yet, but we can update the texts as soon 
as we change each xdoc.



Under related projects, we can add Maven and Derby.  Not sure if we would
want to change Jakarta to Jakarta Commons and/or add dnsjava (it is not an
ASF project).


Just updated my local copy.. will commit this later.


There are other broken links, but they may be fixed when the site is
deployed.


Please check it again now that is online and let me know.


But generally a very nice update to james.apache.org!  :-)

--- Noel


Thank you!
It's far from perfect, but I hope better than before in all aspects.

Stefano


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



[jira] Resolved: (JAMES-572) Create a common look and feel for James project, server, and other james products

2006-07-27 Thread Stefano Bagnara (JIRA)
 [ http://issues.apache.org/jira/browse/JAMES-572?page=all ]

Stefano Bagnara resolved JAMES-572.
---

Resolution: Fixed

 Create a common look and feel for James project, server, and other james 
 products
 -

 Key: JAMES-572
 URL: http://issues.apache.org/jira/browse/JAMES-572
 Project: James
  Issue Type: Sub-task
  Components: Documentation
Reporter: Stefano Bagnara
 Assigned To: Stefano Bagnara
 Fix For: 2.3.0

 Attachments: maven-skin-1-src.tar.gz


 I already did something and we seems to like it.
 I published a first test here:
 http://people.apache.org/~bago/james/bago/index.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



[jira] Resolved: (JAMES-571) Split james documentation for james project and server documentation

2006-07-27 Thread Stefano Bagnara (JIRA)
 [ http://issues.apache.org/jira/browse/JAMES-571?page=all ]

Stefano Bagnara resolved JAMES-571.
---

Resolution: Fixed
  Assignee: Stefano Bagnara

 Split james documentation for james project and server documentation
 

 Key: JAMES-571
 URL: http://issues.apache.org/jira/browse/JAMES-571
 Project: James
  Issue Type: Sub-task
  Components: Documentation
Reporter: Stefano Bagnara
 Assigned To: Stefano Bagnara
 Fix For: 2.3.0




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



svn commit: r426056 - /james/server/trunk/src/test/org/apache/james/smtpserver/TarpitHandlerTest.java

2006-07-27 Thread norman
Author: norman
Date: Thu Jul 27 06:05:27 2006
New Revision: 426056

URL: http://svn.apache.org/viewvc?rev=426056view=rev
Log:
Junit test for TarpitHandler

Added:

james/server/trunk/src/test/org/apache/james/smtpserver/TarpitHandlerTest.java

Added: 
james/server/trunk/src/test/org/apache/james/smtpserver/TarpitHandlerTest.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/smtpserver/TarpitHandlerTest.java?rev=426056view=auto
==
--- 
james/server/trunk/src/test/org/apache/james/smtpserver/TarpitHandlerTest.java 
(added)
+++ 
james/server/trunk/src/test/org/apache/james/smtpserver/TarpitHandlerTest.java 
Thu Jul 27 06:05:27 2006
@@ -0,0 +1,65 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * License); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+package org.apache.james.smtpserver;
+
+import org.apache.avalon.framework.container.ContainerUtil;
+import org.apache.james.smtpserver.core.filter.fastfail.TarpitHandler;
+import org.apache.james.test.mock.avalon.MockLogger;
+
+import junit.framework.TestCase;
+
+public class TarpitHandlerTest extends TestCase {
+
+private SMTPSession session;
+
+private SMTPSession setupMockedSession(final int rcptCount) {
+session = new AbstractSMTPSession() {
+
+public int getRcptCount() {
+return rcptCount;
+}
+
+};
+
+return session;
+}
+
+public void testTarpit() {
+long tarpitTime = 1000;
+long startTime;
+TarpitHandler handler = new TarpitHandler();
+
+ContainerUtil.enableLogging(handler, new MockLogger());
+
+handler.setTarpitRcptCount(2);
+handler.setTarpitSleepTime(tarpitTime);
+
+// no tarpit used
+startTime = System.currentTimeMillis();
+handler.onCommand(setupMockedSession(0));
+assertTrue(No tarpit,
+(System.currentTimeMillis() - startTime)  tarpitTime);
+
+// tarpit used
+startTime = System.currentTimeMillis();
+handler.onCommand(setupMockedSession(3));
+assertTrue(tarpit,
+(System.currentTimeMillis() - startTime) = tarpitTime);
+}
+}



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



svn commit: r426066 - in /james/server/trunk/src: java/org/apache/james/util/SpamAssassinInvoker.java test/org/apache/james/smtpserver/DNSRBLHandlerTest.java

2006-07-27 Thread norman
Author: norman
Date: Thu Jul 27 06:31:08 2006
New Revision: 426066

URL: http://svn.apache.org/viewvc?rev=426066view=rev
Log:
Fix log messages
Add new junit test

Modified:
james/server/trunk/src/java/org/apache/james/util/SpamAssassinInvoker.java

james/server/trunk/src/test/org/apache/james/smtpserver/DNSRBLHandlerTest.java

Modified: 
james/server/trunk/src/java/org/apache/james/util/SpamAssassinInvoker.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/util/SpamAssassinInvoker.java?rev=426066r1=426065r2=426066view=diff
==
--- james/server/trunk/src/java/org/apache/james/util/SpamAssassinInvoker.java 
(original)
+++ james/server/trunk/src/java/org/apache/james/util/SpamAssassinInvoker.java 
Thu Jul 27 06:31:08 2006
@@ -141,10 +141,10 @@
 + spamdHost);
 } catch (IOException e1) {
 throw new MessagingException(Error communicating with spamd on 
-+ spamdHost + : + spamdPort + Exception: + e1);
++ spamdHost + : + spamdPort +  Exception:  + e1);
 } catch (MessagingException e1) {
 throw new MessagingException(Error communicating with spamd on 
-+ spamdHost + : + spamdPort + Exception: + e1);
++ spamdHost + : + spamdPort +  Exception:  + e1);
 } finally {
 try {
 in.close();

Modified: 
james/server/trunk/src/test/org/apache/james/smtpserver/DNSRBLHandlerTest.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/smtpserver/DNSRBLHandlerTest.java?rev=426066r1=426065r2=426066view=diff
==
--- 
james/server/trunk/src/test/org/apache/james/smtpserver/DNSRBLHandlerTest.java 
(original)
+++ 
james/server/trunk/src/test/org/apache/james/smtpserver/DNSRBLHandlerTest.java 
Thu Jul 27 06:31:08 2006
@@ -28,6 +28,9 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.configuration.DefaultConfiguration;
 import org.apache.avalon.framework.container.ContainerUtil;
 import org.apache.james.services.DNSServer;
 import org.apache.james.smtpserver.core.filter.fastfail.DNSRBLHandler;
@@ -267,6 +270,18 @@
 rbl.onConnect(mockedSMTPSession);
 
assertNull(mockedSMTPSession.getConnectionState().get(RBL_DETAIL_MAIL_ATTRIBUTE_NAME));
 
assertEquals(false,mockedSMTPSession.getConnectionState().get(RBL_BLOCKLISTED_MAIL_ATTRIBUTE_NAME));
+}
+
+public void testInvalidConfig() {
+boolean exception = false;
+DNSRBLHandler rbl = new DNSRBLHandler();
+try {
+rbl.configure((Configuration) new 
DefaultConfiguration(rblserver));
+} catch (ConfigurationException e) {
+exception = true;
+}
+
+assertTrue(Invalid config,exception);
 }
 
 }



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



Re: Conditional build / check for jdbc 3.x presence

2006-07-27 Thread Serge Knystautas

On 7/27/06, Stefano Bagnara [EMAIL PROTECTED] wrote:

Can we remove this thing?

AFAIK we now build only against java 1.4+ and it should include jdbc 3.0
by default.

Any drawbacks?


I think that should be safe to remove if we have deprecrated 1.3.

--
Serge Knystautas
Lokitech  software . strategy . design  http://www.lokitech.com
p. 301.656.5501
e. [EMAIL PROTECTED]

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



svn commit: r426084 - in /james/server/trunk/src: java/org/apache/james/transport/mailets/RemoveMailAttribute.java test/org/apache/james/transport/mailets/RemoveMailAttributeTest.java

2006-07-27 Thread norman
Author: norman
Date: Thu Jul 27 07:16:03 2006
New Revision: 426084

URL: http://svn.apache.org/viewvc?rev=426084view=rev
Log:
Throw an exception on invalidConfig
Add junit test

Added:

james/server/trunk/src/test/org/apache/james/transport/mailets/RemoveMailAttributeTest.java
Modified:

james/server/trunk/src/java/org/apache/james/transport/mailets/RemoveMailAttribute.java

Modified: 
james/server/trunk/src/java/org/apache/james/transport/mailets/RemoveMailAttribute.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/mailets/RemoveMailAttribute.java?rev=426084r1=426083r2=426084view=diff
==
--- 
james/server/trunk/src/java/org/apache/james/transport/mailets/RemoveMailAttribute.java
 (original)
+++ 
james/server/trunk/src/java/org/apache/james/transport/mailets/RemoveMailAttribute.java
 Thu Jul 27 07:16:03 2006
@@ -69,6 +69,8 @@
 String attribute_name = st.nextToken().trim() ;
 attributesToRemove.add(attribute_name);
 }
+} else {
+throw new MailetException(Please configure at least one attribute 
to remove);
 }
 }
 

Added: 
james/server/trunk/src/test/org/apache/james/transport/mailets/RemoveMailAttributeTest.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/transport/mailets/RemoveMailAttributeTest.java?rev=426084view=auto
==
--- 
james/server/trunk/src/test/org/apache/james/transport/mailets/RemoveMailAttributeTest.java
 (added)
+++ 
james/server/trunk/src/test/org/apache/james/transport/mailets/RemoveMailAttributeTest.java
 Thu Jul 27 07:16:03 2006
@@ -0,0 +1,86 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * License); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.transport.mailets;
+
+import junit.framework.TestCase;
+
+import org.apache.james.test.mock.mailet.MockMail;
+import org.apache.james.test.mock.mailet.MockMailContext;
+import org.apache.james.test.mock.mailet.MockMailetConfig;
+import org.apache.mailet.Mail;
+import org.apache.mailet.Mailet;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.ParseException;
+
+public class RemoveMailAttributeTest extends TestCase {
+
+public static final String MAIL_ATTRIBUTE_NAME1 = 
org.apache.james.test.junit;
+
+public static final String MAIL_ATTRIBUTE_NAME2 = 
org.apache.james.test.junit2;
+
+private Mail setupMockedMail() throws ParseException {
+Mail mockedMail = new MockMail();
+mockedMail.setAttribute(MAIL_ATTRIBUTE_NAME1, true);
+mockedMail.setAttribute(MAIL_ATTRIBUTE_NAME2, true);
+return mockedMail;
+}
+
+private Mailet setupMailet(String attribute) throws MessagingException {
+Mailet mailet = new RemoveMailAttribute();
+MockMailetConfig mci = new MockMailetConfig(Test,
+new MockMailContext());
+if (attribute != null) {
+mci.setProperty(name, attribute);
+}
+
+mailet.init(mci);
+return mailet;
+}
+
+
+public void testRemoveMailAttribute() throws MessagingException {
+Mail m = setupMockedMail();
+Mailet mailet = setupMailet(MAIL_ATTRIBUTE_NAME1);
+
+// check if the mail has a attribute
+assertNotNull(Attribute exists,m.getAttribute(MAIL_ATTRIBUTE_NAME1));
+assertNotNull(Attribute exists,m.getAttribute(MAIL_ATTRIBUTE_NAME2));
+
+mailet.service(m);
+
+// Check if the attribute was removed
+assertNull(Attribute exists,m.getAttribute(MAIL_ATTRIBUTE_NAME1));
+assertNotNull(Attribute 
deleted,m.getAttribute(MAIL_ATTRIBUTE_NAME2));
+}
+
+
+public void testInvalidConfig() throws MessagingException {
+

svn commit: r426093 - in /james/server/trunk/src/java/org/apache/james/transport/mailets: BayesianAnalysis.java WhiteListManager.java

2006-07-27 Thread norman
Author: norman
Date: Thu Jul 27 07:49:54 2006
New Revision: 426093

URL: http://svn.apache.org/viewvc?rev=426093view=rev
Log:
Remove unneded methods and imports

Modified:

james/server/trunk/src/java/org/apache/james/transport/mailets/BayesianAnalysis.java

james/server/trunk/src/java/org/apache/james/transport/mailets/WhiteListManager.java

Modified: 
james/server/trunk/src/java/org/apache/james/transport/mailets/BayesianAnalysis.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/mailets/BayesianAnalysis.java?rev=426093r1=426092r2=426093view=diff
==
--- 
james/server/trunk/src/java/org/apache/james/transport/mailets/BayesianAnalysis.java
 (original)
+++ 
james/server/trunk/src/java/org/apache/james/transport/mailets/BayesianAnalysis.java
 Thu Jul 27 07:49:54 2006
@@ -29,17 +29,11 @@
 import org.apache.james.util.JDBCUtil;
 import org.apache.mailet.GenericMailet;
 import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
 import org.apache.mailet.RFC2822Headers;
-import org.apache.mailet.dates.RFC822DateFormat;
 
-import javax.mail.Message;
 import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
+
 
 import java.io.BufferedReader;
 import java.io.ByteArrayOutputStream;
@@ -47,9 +41,7 @@
 import java.sql.Connection;
 import java.text.DecimalFormat;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Set;
 
 /**
  * PSpam detection mailet using bayesian analysis techniques./P
@@ -140,9 +132,6 @@
 private String headerName;
 private boolean ignoreLocalSender = false;
 
-/** The date format object used to generate RFC 822 compliant date 
headers. */
-private RFC822DateFormat rfc822DateFormat = new RFC822DateFormat();
-
 /**
  * Return a string describing this mailet.
  *
@@ -388,62 +377,7 @@
 }
 } catch (MessagingException ex) {}
 }
-
-private void sendReplyFromPostmaster(Mail mail, String stringContent) 
throws MessagingException {
-try {
-MailAddress notifier = getMailetContext().getPostmaster();
-
-MailAddress senderMailAddress = mail.getSender();
-
-MimeMessage message = mail.getMessage();
-//Create the reply message
-MimeMessage reply = new 
MimeMessage(Session.getDefaultInstance(System.getProperties(), null));
-
-//Create the list of recipients in the Address[] format
-InternetAddress[] rcptAddr = new InternetAddress[1];
-rcptAddr[0] = senderMailAddress.toInternetAddress();
-reply.setRecipients(Message.RecipientType.TO, rcptAddr);
-
-//Set the sender...
-reply.setFrom(notifier.toInternetAddress());
-
-//Create the message body
-MimeMultipart multipart = new MimeMultipart();
-//Add message as the first mime body part
-MimeBodyPart part = new MimeBodyPart();
-part.setContent(stringContent, text/plain);
-part.setHeader(RFC2822Headers.CONTENT_TYPE, text/plain);
-multipart.addBodyPart(part);
-
-reply.setContent(multipart);
-reply.setHeader(RFC2822Headers.CONTENT_TYPE, 
multipart.getContentType());
-
-//Create the list of recipients in our MailAddress format
-Set recipients = new HashSet();
-recipients.add(senderMailAddress);
-
-//Set additional headers
-if (reply.getHeader(RFC2822Headers.DATE)==null){
-reply.setHeader(RFC2822Headers.DATE, 
rfc822DateFormat.format(new java.util.Date()));
-}
-String subject = message.getSubject();
-if (subject == null) {
-subject = ;
-}
-if (subject.indexOf(Re:) == 0){
-reply.setSubject(subject);
-} else {
-reply.setSubject(Re: + subject);
-}
-reply.setHeader(RFC2822Headers.IN_REPLY_TO, 
message.getMessageID());
-
-//Send it off...
-getMailetContext().sendMail(notifier, recipients, reply);
-} catch (Exception e) {
-log(Exception found sending reply, e);
-}
-}
-
+   
 /**
  * Saves changes resetting the original message id.
  */

Modified: 
james/server/trunk/src/java/org/apache/james/transport/mailets/WhiteListManager.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/mailets/WhiteListManager.java?rev=426093r1=426092r2=426093view=diff

svn commit: r426098 - /james/server/trunk/src/java/org/apache/james/transport/matchers/

2006-07-27 Thread norman
Author: norman
Date: Thu Jul 27 08:10:07 2006
New Revision: 426098

URL: http://svn.apache.org/viewvc?rev=426098view=rev
Log:
Code cleanup
Add javadocs

Modified:

james/server/trunk/src/java/org/apache/james/transport/matchers/AbstractQuotaMatcher.java
james/server/trunk/src/java/org/apache/james/transport/matchers/All.java

james/server/trunk/src/java/org/apache/james/transport/matchers/AttachmentFileNameIs.java

james/server/trunk/src/java/org/apache/james/transport/matchers/CommandForListserv.java

james/server/trunk/src/java/org/apache/james/transport/matchers/CompareNumericHeaderValue.java

james/server/trunk/src/java/org/apache/james/transport/matchers/FetchedFrom.java

james/server/trunk/src/java/org/apache/james/transport/matchers/FileRegexMatcher.java

james/server/trunk/src/java/org/apache/james/transport/matchers/GenericRegexMatcher.java

james/server/trunk/src/java/org/apache/james/transport/matchers/IsInWhiteList.java

Modified: 
james/server/trunk/src/java/org/apache/james/transport/matchers/AbstractQuotaMatcher.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/matchers/AbstractQuotaMatcher.java?rev=426098r1=426097r2=426098view=diff
==
--- 
james/server/trunk/src/java/org/apache/james/transport/matchers/AbstractQuotaMatcher.java
 (original)
+++ 
james/server/trunk/src/java/org/apache/james/transport/matchers/AbstractQuotaMatcher.java
 Thu Jul 27 08:10:07 2006
@@ -72,7 +72,6 @@
  * @return true if over quota
  */
 protected boolean isOverQuota(MailAddress address, Mail mail) {
-String user = address.getUser();
 try {
 boolean over = getQuota(address, mail)  getUsed(address, mail);
 if (over) log(address +  is over quota.);

Modified: 
james/server/trunk/src/java/org/apache/james/transport/matchers/All.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/matchers/All.java?rev=426098r1=426097r2=426098view=diff
==
--- james/server/trunk/src/java/org/apache/james/transport/matchers/All.java 
(original)
+++ james/server/trunk/src/java/org/apache/james/transport/matchers/All.java 
Thu Jul 27 08:10:07 2006
@@ -16,9 +16,6 @@
  * specific language governing permissions and limitations  *
  * under the License.   *
  /
-
-
-
 package org.apache.james.transport.matchers;
 
 import org.apache.mailet.GenericMatcher;
@@ -30,6 +27,10 @@
  * @version 1.0.0, 24/04/1999
  */
 public class All extends GenericMatcher {
+
+/**
+ * @see org.apache.mailet.GenericMatcher#match(Mail)
+ */
 public Collection match(Mail mail) {
 return mail.getRecipients();
 }

Modified: 
james/server/trunk/src/java/org/apache/james/transport/matchers/AttachmentFileNameIs.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/matchers/AttachmentFileNameIs.java?rev=426098r1=426097r2=426098view=diff
==
--- 
james/server/trunk/src/java/org/apache/james/transport/matchers/AttachmentFileNameIs.java
 (original)
+++ 
james/server/trunk/src/java/org/apache/james/transport/matchers/AttachmentFileNameIs.java
 Thu Jul 27 08:10:07 2006
@@ -85,6 +85,9 @@
 /** True if unzip is requested. */
 protected boolean unzipIsRequested;
 
+/**
+ * @see org.apache.mailet.GenericMatcher#init()
+ */
 public void init() throws MessagingException {
 /* sets up fileNameMasks variable by parsing the condition */
 

Modified: 
james/server/trunk/src/java/org/apache/james/transport/matchers/CommandForListserv.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/matchers/CommandForListserv.java?rev=426098r1=426097r2=426098view=diff
==
--- 
james/server/trunk/src/java/org/apache/james/transport/matchers/CommandForListserv.java
 (original)
+++ 
james/server/trunk/src/java/org/apache/james/transport/matchers/CommandForListserv.java
 Thu Jul 27 08:10:07 2006
@@ -36,10 +36,16 @@
 
 private MailAddress listservAddress;
 
+/**
+ * @see org.apache.mailet.GenericRecipientMatcher#init()
+ */
 public void init() throws MessagingException {
 listservAddress = new MailAddress(getCondition());
 }
 
+/**
+ * @see 
org.apache.mailet.GenericRecipientMatcher#matchRecipient(MailAddress)
+ */
 public boolean matchRecipient(MailAddress recipient) {
 if (recipient.getHost().equals(listservAddress.getHost())) {
 if (recipient.getUser().equals(listservAddress.getUser() + -on)

Modified: 

[jira] Created: (JAMES-580) NPE is issued when receiving a read receipt from MS Outlook, and checkValidSenderDomain is set to true

2006-07-27 Thread Vincenzo Gianferrari Pini (JIRA)
NPE is issued when receiving a read receipt from MS Outlook, and 
checkValidSenderDomain is set to true
--

 Key: JAMES-580
 URL: http://issues.apache.org/jira/browse/JAMES-580
 Project: James
  Issue Type: Bug
  Components: SMTPServer
Affects Versions: 2.3.0rc1
Reporter: Vincenzo Gianferrari Pini


A NPE is issued when receiving a read receipt from MS Outlook (not Outlook 
express nor Thunderbird), and checkValidSenderDomain is set to true and  the 
sender IP address is not in authorizedAddresses:

27/07/06 17:17:00 ERROR smtpserver: Exception opening socket: null
java.lang.NullPointerException
at 
org.apache.james.smtpserver.MailCmdHandler.doMAIL(MailCmdHandler.java:210)
at 
org.apache.james.smtpserver.MailCmdHandler.onCommand(MailCmdHandler.java:83)
at 
org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:391)
at 
org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:422)
at 
org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
at 
org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



[jira] Commented: (JAMES-580) NPE is issued when receiving a read receipt from MS Outlook, and checkValidSenderDomain is set to true

2006-07-27 Thread Vincenzo Gianferrari Pini (JIRA)
[ 
http://issues.apache.org/jira/browse/JAMES-580?page=comments#action_12423864 ] 

Vincenzo Gianferrari Pini commented on JAMES-580:
-

I don't know if this error was also in 2.2. In such case IMO we should consider 
it a blocker :-( , because after an upgrade from 2.2.0 to 2.3.0 the systems 
having  checkValidSenderDomain set to true would lose messages.

 NPE is issued when receiving a read receipt from MS Outlook, and 
 checkValidSenderDomain is set to true
 --

 Key: JAMES-580
 URL: http://issues.apache.org/jira/browse/JAMES-580
 Project: James
  Issue Type: Bug
  Components: SMTPServer
Affects Versions: 2.3.0rc1
Reporter: Vincenzo Gianferrari Pini

 A NPE is issued when receiving a read receipt from MS Outlook (not Outlook 
 express nor Thunderbird), and checkValidSenderDomain is set to true and  
 the sender IP address is not in authorizedAddresses:
 27/07/06 17:17:00 ERROR smtpserver: Exception opening socket: null
 java.lang.NullPointerException
   at 
 org.apache.james.smtpserver.MailCmdHandler.doMAIL(MailCmdHandler.java:210)
   at 
 org.apache.james.smtpserver.MailCmdHandler.onCommand(MailCmdHandler.java:83)
   at 
 org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:391)
   at 
 org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:422)
   at 
 org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
   at 
 org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



svn commit: r426107 - in /james/server/trunk/src/java/org/apache/james: transport/mailets/CommandListservProcessor.java transport/mailets/GenericListserv.java transport/mailets/WhiteListManager.java u

2006-07-27 Thread norman
Author: norman
Date: Thu Jul 27 08:42:42 2006
New Revision: 426107

URL: http://svn.apache.org/viewvc?rev=426107view=rev
Log:
Add new util class which provides usefull static methods for mailets
Code cleanup

Added:
james/server/trunk/src/java/org/apache/james/util/mailet/
james/server/trunk/src/java/org/apache/james/util/mailet/MailetUtil.java
Modified:

james/server/trunk/src/java/org/apache/james/transport/mailets/CommandListservProcessor.java

james/server/trunk/src/java/org/apache/james/transport/mailets/GenericListserv.java

james/server/trunk/src/java/org/apache/james/transport/mailets/WhiteListManager.java

Modified: 
james/server/trunk/src/java/org/apache/james/transport/mailets/CommandListservProcessor.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/mailets/CommandListservProcessor.java?rev=426107r1=426106r2=426107view=diff
==
--- 
james/server/trunk/src/java/org/apache/james/transport/mailets/CommandListservProcessor.java
 (original)
+++ 
james/server/trunk/src/java/org/apache/james/transport/mailets/CommandListservProcessor.java
 Thu Jul 27 08:42:42 2006
@@ -28,6 +28,7 @@
 import org.apache.james.services.UsersStore;
 import org.apache.mailet.RFC2822Headers;
 import org.apache.james.util.XMLResources;
+import org.apache.james.util.mailet.MailetUtil;
 import org.apache.mailet.GenericMailet;
 import org.apache.mailet.Mail;
 import org.apache.mailet.MailAddress;
@@ -262,7 +263,7 @@
 if (subj == null) {
 subj = ;
 }
-subj = normalizeSubject(subj, prefix);
+subj = MailetUtil.normalizeSubject(subj, prefix);
 AbstractRedirect.changeSubject(message, subj);
 }
 }
@@ -421,79 +422,6 @@
 
 usersRepository = usersStore.getRepository(repName);
 if (usersRepository == null) throw new Exception(Invalid user 
repository:  + repName);
-}
-
-/**
- * pThis takes the subject string and reduces (normailzes) it.
- * Multiple Re: entries are reduced to one, and capitalized.  The
- * prefix is always moved/placed at the beginning of the line, and
- * extra blanks are reduced, so that the output is always of the
- * form:/p
- * code
- * lt;prefixgt; + lt;one-optional-Re:*gt; + lt;remaining subjectgt;
- * /code
- * pI have done extensive testing of this routine with a standalone
- * driver, and am leaving the commented out debug messages so that
- * when someone decides to enhance this method, it can be yanked it
- * from this file, embedded it with a test driver, and the comments
- * enabled./p
- */
-static private String normalizeSubject(final String subj, final String 
prefix) {
-// JDK IMPLEMENTATION NOTE!  When we require JDK 1.4+, all
-// occurrences of subject.toString.().indexOf(...) can be
-// replaced by subject.indexOf(...).
-
-StringBuffer subject = new StringBuffer(subj);
-int prefixLength = prefix.length();
-
-// System.err.println(In:   + subject);
-
-// If the prefix is not at the beginning the subject line, remove it
-int index = subject.toString().indexOf(prefix);
-if (index != 0) {
-// System.err.println((p) index:  + index + , subject:  + 
subject);
-if (index  0) {
-subject.delete(index, index + prefixLength);
-}
-subject.insert(0, prefix); // insert prefix at the front
-}
-
-// Replace Re: with RE:
-String match = Re:;
-index = subject.toString().indexOf(match, prefixLength);
-
-while(index  -1) {
-// System.err.println((a) index:  + index + , subject:  + 
subject);
-subject.replace(index, index + match.length(), RE:);
-index = subject.toString().indexOf(match, prefixLength);
-// System.err.println((b) index:  + index + , subject:  + 
subject);
-}
-
-// Reduce them to one at the beginning
-match =RE:;
-int indexRE = subject.toString().indexOf(match, prefixLength) + 
match.length();
-index = subject.toString().indexOf(match, indexRE);
-while(index  0) {
-// System.err.println((c) index:  + index + , subject:  + 
subject);
-subject.delete(index, index + match.length());
-index = subject.toString().indexOf(match, indexRE);
-// System.err.println((d) index:  + index + , subject:  + 
subject);
-}
-
-// Reduce blanks
-match =   ;
-index = subject.toString().indexOf(match, prefixLength);
-while(index  -1) {
-// System.err.println((e) index:  + index + , subject:  + 
subject);
-subject.replace(index, index + match.length(),  );
-index = subject.toString().indexOf(match, prefixLength);
-// 

[jira] Assigned: (JAMES-580) NPE is issued when receiving a read receipt from MS Outlook, and checkValidSenderDomain is set to true

2006-07-27 Thread Norman Maurer (JIRA)
 [ http://issues.apache.org/jira/browse/JAMES-580?page=all ]

Norman Maurer reassigned JAMES-580:
---

Assignee: Norman Maurer

 NPE is issued when receiving a read receipt from MS Outlook, and 
 checkValidSenderDomain is set to true
 --

 Key: JAMES-580
 URL: http://issues.apache.org/jira/browse/JAMES-580
 Project: James
  Issue Type: Bug
  Components: SMTPServer
Affects Versions: 2.3.0rc1
Reporter: Vincenzo Gianferrari Pini
 Assigned To: Norman Maurer

 A NPE is issued when receiving a read receipt from MS Outlook (not Outlook 
 express nor Thunderbird), and checkValidSenderDomain is set to true and  
 the sender IP address is not in authorizedAddresses:
 27/07/06 17:17:00 ERROR smtpserver: Exception opening socket: null
 java.lang.NullPointerException
   at 
 org.apache.james.smtpserver.MailCmdHandler.doMAIL(MailCmdHandler.java:210)
   at 
 org.apache.james.smtpserver.MailCmdHandler.onCommand(MailCmdHandler.java:83)
   at 
 org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:391)
   at 
 org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:422)
   at 
 org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
   at 
 org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



Re: [jira] Commented: (JAMES-580) NPE is issued when receiving a read receipt from MS Outlook, and checkValidSenderDomain is set to true

2006-07-27 Thread Norman Maurer
I found the bug.. I will commit the fix + junit test as fast as i can.

bye
Norman

Am Donnerstag, den 27.07.2006, 08:37 -0700 schrieb Vincenzo Gianferrari
Pini (JIRA):
 [ 
 http://issues.apache.org/jira/browse/JAMES-580?page=comments#action_12423864 
 ] 
 
 Vincenzo Gianferrari Pini commented on JAMES-580:
 -
 
 I don't know if this error was also in 2.2. In such case IMO we should 
 consider it a blocker :-( , because after an upgrade from 2.2.0 to 2.3.0 the 
 systems having  checkValidSenderDomain set to true would lose messages.
 
  NPE is issued when receiving a read receipt from MS Outlook, and 
  checkValidSenderDomain is set to true
  --
 
  Key: JAMES-580
  URL: http://issues.apache.org/jira/browse/JAMES-580
  Project: James
   Issue Type: Bug
   Components: SMTPServer
 Affects Versions: 2.3.0rc1
 Reporter: Vincenzo Gianferrari Pini
 
  A NPE is issued when receiving a read receipt from MS Outlook (not 
  Outlook express nor Thunderbird), and checkValidSenderDomain is set to 
  true and  the sender IP address is not in authorizedAddresses:
  27/07/06 17:17:00 ERROR smtpserver: Exception opening socket: null
  java.lang.NullPointerException
  at 
  org.apache.james.smtpserver.MailCmdHandler.doMAIL(MailCmdHandler.java:210)
  at 
  org.apache.james.smtpserver.MailCmdHandler.onCommand(MailCmdHandler.java:83)
  at 
  org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:391)
  at 
  org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:422)
  at 
  org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
  at 
  org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)
 


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


[jira] Updated: (JAMES-580) NPE is issued when receiving a read receipt from MS Outlook, and checkValidSenderDomain is set to true

2006-07-27 Thread Norman Maurer (JIRA)
 [ http://issues.apache.org/jira/browse/JAMES-580?page=all ]

Norman Maurer updated JAMES-580:


Priority: Blocker  (was: Major)

 NPE is issued when receiving a read receipt from MS Outlook, and 
 checkValidSenderDomain is set to true
 --

 Key: JAMES-580
 URL: http://issues.apache.org/jira/browse/JAMES-580
 Project: James
  Issue Type: Bug
  Components: SMTPServer
Affects Versions: 2.3.0rc1
Reporter: Vincenzo Gianferrari Pini
 Assigned To: Norman Maurer
Priority: Blocker

 A NPE is issued when receiving a read receipt from MS Outlook (not Outlook 
 express nor Thunderbird), and checkValidSenderDomain is set to true and  
 the sender IP address is not in authorizedAddresses:
 27/07/06 17:17:00 ERROR smtpserver: Exception opening socket: null
 java.lang.NullPointerException
   at 
 org.apache.james.smtpserver.MailCmdHandler.doMAIL(MailCmdHandler.java:210)
   at 
 org.apache.james.smtpserver.MailCmdHandler.onCommand(MailCmdHandler.java:83)
   at 
 org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:391)
   at 
 org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:422)
   at 
 org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
   at 
 org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



svn commit: r426126 - in /james/server/trunk/src: java/org/apache/james/smtpserver/core/filter/fastfail/ValidSenderDomainHandler.java test/org/apache/james/smtpserver/ValidSenderDomainHandlerTest.java

2006-07-27 Thread norman
Author: norman
Date: Thu Jul 27 09:29:19 2006
New Revision: 426126

URL: http://svn.apache.org/viewvc?rev=426126view=rev
Log:
Fix the Nullpointer on null sender if CheckValidSenderDomain is enabled. See 
JAMES-580

Added:

james/server/trunk/src/test/org/apache/james/smtpserver/ValidSenderDomainHandlerTest.java
Modified:

james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/ValidSenderDomainHandler.java

Modified: 
james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/ValidSenderDomainHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/ValidSenderDomainHandler.java?rev=426126r1=426125r2=426126view=diff
==
--- 
james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/ValidSenderDomainHandler.java
 (original)
+++ 
james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/ValidSenderDomainHandler.java
 Thu Jul 27 09:29:19 2006
@@ -90,6 +90,9 @@
String responseString = null;
 MailAddress senderAddress = (MailAddress) 
session.getState().get(SMTPSession.SENDER);
 
+// null sender so return
+if (senderAddress == null) return;
+
 /**
  * don't check if the ip address is allowed to relay. Only check if it 
is set in the config. 
  */

Added: 
james/server/trunk/src/test/org/apache/james/smtpserver/ValidSenderDomainHandlerTest.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/smtpserver/ValidSenderDomainHandlerTest.java?rev=426126view=auto
==
--- 
james/server/trunk/src/test/org/apache/james/smtpserver/ValidSenderDomainHandlerTest.java
 (added)
+++ 
james/server/trunk/src/test/org/apache/james/smtpserver/ValidSenderDomainHandlerTest.java
 Thu Jul 27 09:29:19 2006
@@ -0,0 +1,113 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * License); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.smtpserver;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.apache.avalon.framework.container.ContainerUtil;
+import org.apache.james.services.DNSServer;
+import 
org.apache.james.smtpserver.core.filter.fastfail.ValidSenderDomainHandler;
+import org.apache.james.test.mock.avalon.MockLogger;
+import org.apache.mailet.MailAddress;
+
+import junit.framework.TestCase;
+
+public class ValidSenderDomainHandlerTest extends TestCase {
+
+private String response = null;
+
+public void setUp() {
+response = null;
+}
+
+private DNSServer setupDNSServer() {
+DNSServer dns = new DNSServer(){
+
+public Collection findMXRecords(String hostname) {
+Collection mx = new ArrayList();
+if (hostname.equals(test.james.apache.org)) {
+mx.add(mail.james.apache.org);
+}
+return mx;
+}
+
+public Collection findTXTRecords(String hostname) {
+throw new UnsupportedOperationException(Unimplemented mock 
service);
+}
+
+public InetAddress[] getAllByName(String host) throws 
UnknownHostException {
+throw new UnsupportedOperationException(Unimplemented mock 
service);
+}
+
+public InetAddress getByName(String host) throws 
UnknownHostException {
+throw new UnsupportedOperationException(Unimplemented mock 
service);
+}
+
+public Iterator getSMTPHostAddresses(String domainName) {
+throw new 

svn commit: r426127 - /james/server/branches/v2.3/src/java/org/apache/james/smtpserver/MailCmdHandler.java

2006-07-27 Thread norman
Author: norman
Date: Thu Jul 27 09:31:03 2006
New Revision: 426127

URL: http://svn.apache.org/viewvc?rev=426127view=rev
Log:
Fix the Nullpointer on null sender if CheckValidSenderDomain is enabled. See 
JAMES-580

Modified:

james/server/branches/v2.3/src/java/org/apache/james/smtpserver/MailCmdHandler.java

Modified: 
james/server/branches/v2.3/src/java/org/apache/james/smtpserver/MailCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/branches/v2.3/src/java/org/apache/james/smtpserver/MailCmdHandler.java?rev=426127r1=426126r2=426127view=diff
==
--- 
james/server/branches/v2.3/src/java/org/apache/james/smtpserver/MailCmdHandler.java
 (original)
+++ 
james/server/branches/v2.3/src/java/org/apache/james/smtpserver/MailCmdHandler.java
 Thu Jul 27 09:31:03 2006
@@ -197,7 +197,8 @@
 }
 }
 
-if (checkValidSenderDomain == true) {
+// check only if its no null sender
+if (checkValidSenderDomain == true  sender != null) {
 
 /**
  * don't check if the ip address is allowed to relay. Only 
check if it is set in the config. 



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



[jira] Resolved: (JAMES-580) NPE is issued when receiving a read receipt from MS Outlook, and checkValidSenderDomain is set to true

2006-07-27 Thread Norman Maurer (JIRA)
 [ http://issues.apache.org/jira/browse/JAMES-580?page=all ]

Norman Maurer resolved JAMES-580.
-

Fix Version/s: 2.3.0rc2
   Resolution: Fixed

 NPE is issued when receiving a read receipt from MS Outlook, and 
 checkValidSenderDomain is set to true
 --

 Key: JAMES-580
 URL: http://issues.apache.org/jira/browse/JAMES-580
 Project: James
  Issue Type: Bug
  Components: SMTPServer
Affects Versions: 2.3.0rc1
Reporter: Vincenzo Gianferrari Pini
 Assigned To: Norman Maurer
Priority: Blocker
 Fix For: 2.3.0rc2


 A NPE is issued when receiving a read receipt from MS Outlook (not Outlook 
 express nor Thunderbird), and checkValidSenderDomain is set to true and  
 the sender IP address is not in authorizedAddresses:
 27/07/06 17:17:00 ERROR smtpserver: Exception opening socket: null
 java.lang.NullPointerException
   at 
 org.apache.james.smtpserver.MailCmdHandler.doMAIL(MailCmdHandler.java:210)
   at 
 org.apache.james.smtpserver.MailCmdHandler.onCommand(MailCmdHandler.java:83)
   at 
 org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:391)
   at 
 org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:422)
   at 
 org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:55)
   at 
 org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:116)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



Re: [jira] Commented: (JAMES-580) NPE is issued when receiving a read receipt from MS Outlook, and checkValidSenderDomain is set to true

2006-07-27 Thread Stefano Bagnara

Vincenzo Gianferrari Pini (JIRA) wrote:
[ http://issues.apache.org/jira/browse/JAMES-580?page=comments#action_12423864 ] 

Vincenzo Gianferrari Pini commented on JAMES-580:

-

I don't know if this error was also in 2.2. In such case IMO we should consider it a 
blocker :-( , because after an upgrade from 2.2.0 to 2.3.0 the systems having  
checkValidSenderDomain set to true would lose messages.


IIRC our default configuration does not have this checkValidSenderDomain 
set to true, btw I think we should fix this anyway for 2.3.0 because it 
is a small fix and it otherwise loose the mail.


If I understood the problem then we are also loosing all DSN messages 
(bounces) if that option is activated because they have to be sent with 
empty sender.


I would prefer to wait something more before trying to release RC2. This 
issue is limited to an experimental (disabled by default) and the fix 
have not to be tested so much (it is a clean/obvious fix) so we can wait 
something more for other bugreports against RC1 and try releasing RC2 later.


Stefano


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



[jira] Created: (JAMES-581) Add an Upgrade documentation to our docs explaining the upgrade from 2.2.0 to 2.3.0

2006-07-27 Thread Stefano Bagnara (JIRA)
Add an Upgrade documentation to our docs explaining the upgrade from 2.2.0 to 
2.3.0
-

 Key: JAMES-581
 URL: http://issues.apache.org/jira/browse/JAMES-581
 Project: James
  Issue Type: Wish
  Components: Documentation
Affects Versions: 2.3.0rc1
Reporter: Stefano Bagnara
 Fix For: 2.3.0


We already have something in here:
http://wiki.apache.org/james/JamesV2

But imo we should include it in the official documentation to allow for simpler 
2.3.0 upgrades.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



[jira] Created: (JAMES-582) Released packages confusions (name, artifacts)

2006-07-27 Thread Stefano Bagnara (JIRA)
Released packages confusions (name, artifacts)
--

 Key: JAMES-582
 URL: http://issues.apache.org/jira/browse/JAMES-582
 Project: James
  Issue Type: Wish
  Components: Build System
Affects Versions: 2.3.0rc1
Reporter: Stefano Bagnara
Priority: Minor
 Fix For: 2.3.0


We currently name james-* our releases.
1) We should rename them to add at least server = james-server-*
2) Currenlty james-XXX-src.* and james-with-phoenix-XXX-src.* are the same 
thing: why do we need 2? what would be the intended difference? I would like to 
remove the james-with-phoenix-XXX-src from our release.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



[jira] Commented: (JAMES-582) Released packages confusions (name, artifacts)

2006-07-27 Thread Stefano Bagnara (JIRA)
[ 
http://issues.apache.org/jira/browse/JAMES-582?page=comments#action_12423875 ] 

Stefano Bagnara commented on JAMES-582:
---

Furthermore Norman noted that in our rc1 src distro there are javadocs in the 
www folder.

I think this is a lack in our build system: I see that some of our src releases 
include the www folder with some parts of the website, other releases don't 
include this one.

Should we try to fix this for 2.3.0? What would we like to include and in what 
packages?


 Released packages confusions (name, artifacts)
 --

 Key: JAMES-582
 URL: http://issues.apache.org/jira/browse/JAMES-582
 Project: James
  Issue Type: Wish
  Components: Build System
Affects Versions: 2.3.0rc1
Reporter: Stefano Bagnara
Priority: Minor
 Fix For: 2.3.0


 We currently name james-* our releases.
 1) We should rename them to add at least server = james-server-*
 2) Currenlty james-XXX-src.* and james-with-phoenix-XXX-src.* are the same 
 thing: why do we need 2? what would be the intended difference? I would like 
 to remove the james-with-phoenix-XXX-src from our release.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



Re: [jira] Commented: (JAMES-580) NPE is issued when receiving a read receipt from MS Outlook, and checkValidSenderDomain is set to true

2006-07-27 Thread Norman Maurer
You are right its a small fix.. BTW, its tested.. before the  junit test
throws a Nullpointer. After the fix  the test pass..

But i agree not enough for a rc2.

So please test.

bye
Norman

Am Donnerstag, den 27.07.2006, 19:13 +0200 schrieb Stefano Bagnara:
 Vincenzo Gianferrari Pini (JIRA) wrote:
  [ 
  http://issues.apache.org/jira/browse/JAMES-580?page=comments#action_12423864
   ] 
  
  Vincenzo Gianferrari Pini commented on JAMES-580:
  -
  
  I don't know if this error was also in 2.2. In such case IMO we should 
  consider it a blocker :-( , because after an upgrade from 2.2.0 to 2.3.0 
  the systems having  checkValidSenderDomain set to true would lose 
  messages.
 
 IIRC our default configuration does not have this checkValidSenderDomain 
 set to true, btw I think we should fix this anyway for 2.3.0 because it 
 is a small fix and it otherwise loose the mail.
 
 If I understood the problem then we are also loosing all DSN messages 
 (bounces) if that option is activated because they have to be sent with 
 empty sender.
 
 I would prefer to wait something more before trying to release RC2. This 
 issue is limited to an experimental (disabled by default) and the fix 
 have not to be tested so much (it is a clean/obvious fix) so we can wait 
 something more for other bugreports against RC1 and try releasing RC2 later.
 
 Stefano
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 !EXCUBATOR:1,44c8f48943381751252140!


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: MINA integration

2006-07-27 Thread Mike Heath
Sorry to come so late to the discussion.  I've been trying to set aside
more time to get back into the open-source projects I'm apart of but
other things keep coming up that require my time.

HausMail is ASLv2.0.  It is not LGPL.  Never has been.  I wrote a
distributed locking manager for JAMES a while ago that was LGPL.  The
LGPL DLM is out on Source Forge somewhere but it has a number of issues
and I think there's a better way to solve the clustering problem in
JAMES but that's a discussion for a different thread.

The code that's in HausMail is essentially a MINA based SMTP server-side
protocol handler.  There is a lot of Java 5 code in there (enums and
generics) that may have to be refactored.  There is also some
experimental code in HausMail that needs to be tested/cleaned up.

In all honesty, I'm more inclined to contribute the SMTP server code in
HausMail to the MINA project.  One of the motivating factors in me
writing the HausMail code was because I needed something that could
receive SMTP message but I didn't need a full mail server.  I also
wanted something that was much more embeddable than what JAMES is today.
The other motivation for adding it to MINA is that there has been talk
on the MINA list to adding some protocol implementations to the MINA
project.

The HausMail code seems welcome at the MINA project.  I need to dedicate
the time to get it moved over there and coordinate with Peter Royal and
Trustin Lee.  Does such a move make sense for the JAMES project?  I
think it does but that may only be my opinion.  Either way, I'm more
than happy to help get the code in HausMail into JAMES.  I just think it
makes more since to put the code in MINA and have JAMES use that code.

WDYT?

-Mike

On Wed, 2006-07-12 at 15:06 +0200, Norman Maurer wrote:
 Hi guys,
 
 i whould like to work on MINA integration for connection handling. I
 just want to know what you guys think about a problem...
 
 Currently MINA only support SSL with java 5. So SSL can only be used
 with java 5.  I think its not a big problem cause the SSL support is
 still experimental. So if someone want use it he must upgrade, if not he
 can use james with java 1.4 (MINA itself works with java 1.4). 
 Anyone see a problem with it and so with integrate MINA ?
 
 bye
 Norman
 


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