cvs commit: jakarta-james/src/java/org/apache/james/util NetMatcher.java

2003-06-06 Thread noel
noel2003/06/06 20:05:41

  Modified:src/java/org/apache/james/util NetMatcher.java
  Log:
  Added some internal logging back into NetMatcher.  Defaults to not logging.
  
  Revision  ChangesPath
  1.3   +5 -0  jakarta-james/src/java/org/apache/james/util/NetMatcher.java
  
  Index: NetMatcher.java
  ===
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/util/NetMatcher.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NetMatcher.java   27 May 2003 08:47:30 -  1.2
  +++ NetMatcher.java   7 Jun 2003 03:05:41 -   1.3
  @@ -77,6 +77,7 @@
   }
   catch (java.net.UnknownHostException uhe)
   {
  +log("Cannot resolve address: " + uhe.getMessage());
   }
   networks.trimToSize();
   }
  @@ -91,6 +92,7 @@
   }
   catch (java.net.UnknownHostException uhe)
   {
  +log("Cannot resolve address: " + uhe.getMessage());
   }
   networks.trimToSize();
   }
  @@ -105,6 +107,7 @@
   }
   catch (java.net.UnknownHostException uhe)
   {
  +log("Cannot resolve address: " + uhe.getMessage());
   }
   
   boolean sameNet = false;
  @@ -146,6 +149,8 @@
   public String toString() {
   return networks.toString();
   }
  +
  +protected void log(String s) { }
   }
   
   class InetNetwork
  
  
  

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



cvs commit: jakarta-james/src/java/org/apache/james/util NetMatcher.java

2003-06-06 Thread noel
noel2003/06/06 20:03:07

  Modified:src/java/org/apache/james/util Tag: branch_2_1_fcs
NetMatcher.java
  Log:
  Added some internal logging back into NetMatcher.  Defaults to not logging.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.5   +5 -0  jakarta-james/src/java/org/apache/james/util/NetMatcher.java
  
  Index: NetMatcher.java
  ===
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/util/NetMatcher.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- NetMatcher.java   26 May 2003 22:32:52 -  1.1.2.4
  +++ NetMatcher.java   7 Jun 2003 03:03:07 -   1.1.2.5
  @@ -77,6 +77,7 @@
   }
   catch (java.net.UnknownHostException uhe)
   {
  +log("Cannot resolve address: " + uhe.getMessage());
   }
   networks.trimToSize();
   }
  @@ -91,6 +92,7 @@
   }
   catch (java.net.UnknownHostException uhe)
   {
  +log("Cannot resolve address: " + uhe.getMessage());
   }
   networks.trimToSize();
   }
  @@ -105,6 +107,7 @@
   }
   catch (java.net.UnknownHostException uhe)
   {
  +log("Cannot resolve address: " + uhe.getMessage());
   }
   
   boolean sameNet = false;
  @@ -146,6 +149,8 @@
   public String toString() {
   return networks.toString();
   }
  +
  +protected void log(String s) { }
   }
   
   class InetNetwork
  
  
  

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



RE: how hard is it to write a SMTP client?

2003-06-06 Thread Noel J. Bergman
Chris,

You could store the message in a repository, and send a notification message
with a special URL (subclass of NotifySender).  The URL could be used to
initiate payment.  Once payment is received, another message would cause the
message to move from the repository back to the spool for delivery.

Your idea of pre-payment, and a quota matcher that deducts payment until
there is no credit left is an interesting idea.

Mind you, I doubt that there is really any spammer who wants to pay, so I'm
curious to see if that would *ever* work socially.

--- Noel


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



cvs commit: jakarta-james/src/conf james-config.xml

2003-06-06 Thread noel
noel2003/06/06 17:26:28

  Modified:src/conf james-config.xml
  Log:
  Bounce messages using the new Bounce mailet
  
  Revision  ChangesPath
  1.54  +3 -3  jakarta-james/src/conf/james-config.xml
  
  Index: james-config.xml
  ===
  RCS file: /home/cvs/jakarta-james/src/conf/james-config.xml,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- james-config.xml  17 May 2003 07:39:57 -  1.53
  +++ james-config.xml  7 Jun 2003 00:26:28 -   1.54
  @@ -260,7 +260,7 @@
   





   

  
  
  

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



cvs commit: jakarta-james/src/conf james-config.xml

2003-06-06 Thread noel
noel2003/06/06 17:25:51

  Modified:src/conf Tag: branch_2_1_fcs james-config.xml
  Log:
  Bounce messages using the new Bounce mailet
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.40.2.10 +3 -3  jakarta-james/src/conf/james-config.xml
  
  Index: james-config.xml
  ===
  RCS file: /home/cvs/jakarta-james/src/conf/james-config.xml,v
  retrieving revision 1.40.2.9
  retrieving revision 1.40.2.10
  diff -u -r1.40.2.9 -r1.40.2.10
  --- james-config.xml  29 May 2003 05:05:33 -  1.40.2.9
  +++ james-config.xml  7 Jun 2003 00:25:50 -   1.40.2.10
  @@ -211,7 +211,7 @@
   





   

  
  
  

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



CVS Changes

2003-06-06 Thread Noel J. Bergman
Basically committing changes people had posted that I've been running this
week.

I'm going to post a test build, and then I'm hoping for a nice quite
weekend, unless there are any reported problems in the test build.

--- Noel


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



cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets AbstractNotify.java AbstractRedirect.java Bounce.java Forward.java NotifyPostmaster.java NotifySender.java Redirect.java

2003-06-06 Thread noel
noel2003/06/06 16:55:05

  Modified:src/java/org/apache/james/transport/mailets Tag:
branch_2_1_fcs AbstractNotify.java
AbstractRedirect.java Bounce.java Forward.java
NotifyPostmaster.java NotifySender.java
Redirect.java
  Log:
  Enhanced the javadocs.  Fix in AbstractRedirect to avoid re-rendering a message that 
we aren't changing.  Check for valid Sender domain moved to AbstractRedirect.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.3   +11 -12
jakarta-james/src/java/org/apache/james/transport/mailets/AbstractNotify.java
  
  Index: AbstractNotify.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/AbstractNotify.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- AbstractNotify.java   3 Jun 2003 05:16:41 -   1.1.2.2
  +++ AbstractNotify.java   6 Jun 2003 23:55:04 -   1.1.2.3
  @@ -110,11 +110,11 @@
*
*/
   public abstract class AbstractNotify extends AbstractRedirect {
  -
  +
   /*  */
   /* ** Begin of getX and setX methods ** */
   /*  */
  -
  +
   /**
* @return true, as all notifications should
*/
  @@ -128,14 +128,14 @@
   protected int getInLineType() {
   return NONE;
   }
  -
  +
   /**
* @return MESSAGE
*/
   protected int getAttachmentType() {
   return MESSAGE;
   }
  -
  +
   /**
* @return the notice init parameter
*/
  @@ -146,7 +146,7 @@
   return getInitParameter("notice");
   }
   }
  -
  +
   /**
* @return the full message to append, built from the Mail object
*/
  @@ -154,7 +154,7 @@
   MimeMessage message = originalMail.getMessage();
   StringWriter sout = new StringWriter();
   PrintWriter out = new PrintWriter(sout, true);
  -
  +
   // First add the "local" notice
   // (either from conf or generic error message)
   out.println(getMessage());
  @@ -208,10 +208,10 @@
   if (message.getLineCount() >= 0) {
   out.println("  Number of lines: " + message.getLineCount());
   }
  -
  +
   return sout.toString();
   }
  -
  +
   /**
* @return the value of the sendingAddress init parameter if not 
null,
* the postmaster address otherwise
  @@ -223,7 +223,7 @@
   return new MailAddress(getInitParameter("sendingAddress"));
   }
   }
  -
  +
   /**
* @return the attachStackTrace init parameter
*/
  @@ -236,7 +236,7 @@
   }
   return attachStackTrace;
   }
  -
  +
   /**
* @return true
*/
  @@ -247,6 +247,5 @@
   /*  */
   /* *** End of getX and setX methods *** */
   /*  */
  -
  -}
   
  +}
  
  
  
  1.1.2.6   +64 -31
jakarta-james/src/java/org/apache/james/transport/mailets/AbstractRedirect.java
  
  Index: AbstractRedirect.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/AbstractRedirect.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- AbstractRedirect.java 6 Jun 2003 04:43:41 -   1.1.2.5
  +++ AbstractRedirect.java 6 Jun 2003 23:55:04 -   1.1.2.6
  @@ -298,11 +298,11 @@
* May return one of the following values to indicate how to append the 
original message
* to build the new message:
* 
  - *UNALTERED : original message is the new message body
  - *BODY : original message body is appended to the new message
  - *HEADS : original message headers are appended to the new message
  - *ALL : original is appended with all headers
  - *NONE : original is not appended
  + *UNALTERED : original message is the new message body
  + *BODY : original message body is appended to the new 
message
  + *HEADS : original message headers are appended to the new 
message
  + *ALL : original is appended with all headers
  + *NONE : original is not appended
* 
* Is a "getX()" method.
*
  @@ -317,23 +317,22 @@
* built dynamically using the original Mail object.
* Is a "getX(Mail)" method.
  

cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets LocalDelivery.java

2003-06-06 Thread noel
noel2003/06/06 16:53:47

  Modified:src/java/org/apache/james/transport/mailets Tag:
branch_2_1_fcs LocalDelivery.java
  Log:
  Minor code cleanup
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.6.4.6   +8 -17 
jakarta-james/src/java/org/apache/james/transport/mailets/LocalDelivery.java
  
  Index: LocalDelivery.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/LocalDelivery.java,v
  retrieving revision 1.6.4.5
  retrieving revision 1.6.4.6
  diff -u -r1.6.4.5 -r1.6.4.6
  --- LocalDelivery.java15 May 2003 18:19:34 -  1.6.4.5
  +++ LocalDelivery.java6 Jun 2003 23:53:47 -   1.6.4.6
  @@ -76,22 +76,6 @@
* @author Serge Knystautas <[EMAIL PROTECTED]>
*/
   public class LocalDelivery extends GenericMailet {
  -
  -/* MimeMessage that does NOT change the headers when we save it */
  -class LocalMimeMessage extends MimeMessage {
  -
  -public LocalMimeMessage(MimeMessage source) throws MessagingException {
  -super(source);
  -}
  -
  -protected void updateHeaders() throws MessagingException {
  -if (getMessageID() == null) super.updateHeaders();
  -else {
  -modified = false;
  -}
  -}
  -}
  -
   /**
* Delivers a mail to a local mailbox.
*
  @@ -107,7 +91,14 @@
   MailAddress recipient = (MailAddress) i.next();
   try {
   // Add qmail's de facto standard Delivered-To header
  -MimeMessage localMessage = new LocalMimeMessage(message);
  +MimeMessage localMessage = new MimeMessage(message) {
  +protected void updateHeaders() throws MessagingException {
  +if (getMessageID() == null) super.updateHeaders();
  +else {
  +modified = false;
  +}
  +}
  +};
   localMessage.addHeader("Delivered-To", recipient.toString());
   localMessage.saveChanges();
   
  
  
  

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



cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets RemoteDelivery.java

2003-06-06 Thread noel
noel2003/06/06 16:53:34

  Modified:src/java/org/apache/james/transport/mailets Tag:
branch_2_1_fcs RemoteDelivery.java
  Log:
  If send failure and no successful sends, try other servers on the list.  Also 
extended period when we wait for HELLO_NAME to be registered
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.33.4.11 +19 -4 
jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
  
  Index: RemoteDelivery.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java,v
  retrieving revision 1.33.4.10
  retrieving revision 1.33.4.11
  diff -u -r1.33.4.10 -r1.33.4.11
  --- RemoteDelivery.java   27 May 2003 02:41:54 -  1.33.4.10
  +++ RemoteDelivery.java   6 Jun 2003 23:53:34 -   1.33.4.11
  @@ -358,6 +358,17 @@
 .append(outgoingMailServer);
   log(logMessageBuffer.toString());
   return true;
  +} catch (SendFailedException sfe) {
  +if (sfe.getValidSentAddresses() == null
  +  || sfe.getValidSentAddresses().length < 1) {
  +if (isDebug) log("Send failed, continuing with any other 
servers");
  +lastError = sfe;
  +continue;
  +} else {
  +// If any mail was sent then the outgoing
  +// server config must be ok, therefore rethrow
  +throw sfe;
  +}
   } catch (MessagingException me) {
   //MessagingException are horribly difficult to figure out what 
actually happened.
   StringBuffer exceptionBuffer =
  @@ -723,9 +734,13 @@
* measure, I'm inserting this philosophically unsatisfactory
* fix.
*/
  -try {
  -Thread.sleep(5000);
  -} catch (Exception ignored) {} // wait for James to finish initializing
  +long stop = System.currentTimeMillis() + 6;
  +while ((getMailetContext().getAttribute(Constants.HELLO_NAME) == null)
  +   && stop > System.currentTimeMillis()) {
  +try {
  +Thread.sleep(1000);
  +} catch (Exception ignored) {} // wait for James to finish initializing
  +}
   
   //Checks the pool and delivers a mail message
   Properties props = new Properties();
  
  
  

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



cvs commit: jakarta-james/src/java/org/apache/james/transport/matchers AttachmentFileNameIs.java

2003-06-06 Thread noel
noel2003/06/06 16:53:02

  Modified:src/java/org/apache/james/transport/matchers Tag:
branch_2_1_fcs AttachmentFileNameIs.java
  Log:
  More robust content handling, case insensitive matching.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.2   +52 -25
jakarta-james/src/java/org/apache/james/transport/matchers/AttachmentFileNameIs.java
  
  Index: AttachmentFileNameIs.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/matchers/AttachmentFileNameIs.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- AttachmentFileNameIs.java 19 May 2003 23:51:08 -  1.1.2.1
  +++ AttachmentFileNameIs.java 6 Jun 2003 23:53:01 -   1.1.2.2
  @@ -69,15 +69,16 @@
   import java.util.Collection;
   import java.util.Iterator;
   import java.util.StringTokenizer;
  +import java.util.Locale;
   
   
   /**
  - * Checks if at least one attachment has a file name which matches any
  + * Checks if at least one attachment has a file name which matches any
* element of a comma-separated list of file name masks.
  - * File name masks may start with a wildcard * 
  - * Multiple file name masks can be specified, e.g.: '*.scr,*.bat'
  + * The match is case insensitive.
  + * File name masks may start with a wildcard '*'.
  + * Multiple file name masks can be specified, e.g.: '*.scr,*.bat'.
*
  - * Possible enhancement: it should be case insensitive
*/
   public class AttachmentFileNameIs extends GenericMatcher {
   /**
  @@ -110,6 +111,8 @@
   mask.suffixMatch = false;
   mask.matchString = fileName;
   }
  +mask.matchString = mask.matchString.toLowerCase(Locale.US);
  +mask.matchString = mask.matchString.trim();
   theMasks.add(mask);
   }
   masks = (Mask[])theMasks.toArray(new Mask[0]);
  @@ -119,42 +122,66 @@
* either every recipient is matching or neither of them
*/
   public Collection match(Mail mail) throws MessagingException {
  -Multipart content;
   MimeMessage message = mail.getMessage();
  +Object content;
   
   /**
  - * if the content-type is not multipart/mixed, then there is no 
  - * attachment 
  + * if there is an attachment and no inline text,
  + * the content type can be anything
*/ 
  -if (message.getContentType() == null ||
  -!message.getContentType().startsWith("multipart/mixed")) {
  +if (message.getContentType() == null) {
   return null;
   }
  +
   try {
  -content = (Multipart)message.getContent(); 
  +content = message.getContent(); 
   } catch (java.io.IOException e) {
   throw new MessagingException(
   "Attachment file names cannot be determined", e);
   }
  -for (int i = 0; i < content.getCount(); i++) {
  -Part part = content.getBodyPart(i);
  -String fileName = part.getFileName();
  -if (fileName == null) continue;
  -for (int j = 0; j < masks.length; j++) {
  -boolean fMatch;
  -Mask mask = masks[j];
  -
  -//XXX: file names in mail may contain directory - theoretically
  -if (mask.suffixMatch) {
  -fMatch = fileName.endsWith(mask.matchString);
  -} else {
  -fMatch = fileName.equals(mask.matchString);
  -}
  -if (fMatch) return mail.getRecipients(); // matching file found
  +if (content instanceof Multipart) {
  +Multipart multipart = (Multipart) content;
  +for (int i = 0; i < multipart.getCount(); i++) {
  +try {
  +Part part = multipart.getBodyPart(i);
  +String fileName = part.getFileName();
  +if (fileName != null && matchFound(fileName)) {
  +return mail.getRecipients(); // matching file found
  +}
  +} catch (Exception ex) {} // ignore any exception and process next 
bodypart
   }
  +} else {
  +try {
  +String fileName = message.getFileName();
  +if (fileName != null && matchFound(fileName)) {
  +return mail.getRecipients(); // matching file found
  +}
  +} catch (Exception ex) {} // ignore any exception
   }
   
   return null; // no matching attachment found
  +}
  +
  +/*
  + * Checks if fileName matches with at least one of the 
masks.
  +  

cvs commit: jakarta-james/src/java/org/apache/james/transport/matchers AbstractNetworkMatcher.java RemoteAddrInNetwork.java RemoteAddrNotInNetwork.java

2003-06-06 Thread noel
noel2003/06/06 16:52:49

  Modified:src/java/org/apache/james/transport/matchers Tag:
branch_2_1_fcs RemoteAddrInNetwork.java
RemoteAddrNotInNetwork.java
  Added:   src/java/org/apache/james/transport/matchers Tag:
branch_2_1_fcs AbstractNetworkMatcher.java
  Log:
  New AbstractNetworkMatcher class using NetMatcher.  RemoteAddr[Not]InNetwork are now 
subclasses.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.3.4.3   +6 -57 
jakarta-james/src/java/org/apache/james/transport/matchers/RemoteAddrInNetwork.java
  
  Index: RemoteAddrInNetwork.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/matchers/RemoteAddrInNetwork.java,v
  retrieving revision 1.3.4.2
  retrieving revision 1.3.4.3
  diff -u -r1.3.4.2 -r1.3.4.3
  --- RemoteAddrInNetwork.java  8 Mar 2003 21:54:09 -   1.3.4.2
  +++ RemoteAddrInNetwork.java  6 Jun 2003 23:52:49 -   1.3.4.3
  @@ -58,72 +58,21 @@
   
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.GenericMatcher;
   import org.apache.mailet.Mail;
   
   import javax.mail.MessagingException;
  -import java.net.InetAddress;
  -import java.net.UnknownHostException;
   import java.util.Collection;
  -import java.util.Iterator;
  -import java.util.StringTokenizer;
  -import java.util.Vector;
   
   /**
* Checks the IP address of the sending server against a comma-
  - * delimited list of IP addresses or domain names.
  - * Networks should be indicated with a wildcard *, e.g. 192.168.* 
  - * Note: The wildcard can go at any level, the matcher will match if the
  - * sending host's IP address (as a String based on the octet representation)
  - * starts with the String indicated in the configuration file, excluding the
  - * wildcard.
  - * Multiple addresses can be indicated, e.g: '127.0.0.1,192.168.*,domain.tld'
  + * delimited list of IP addresses, domain names or sub-nets.
  + *
  + * See AbstractNetworkMatcher for details on how to specify
  + * entries.
*
  - * @author  Serge Knystautas <[EMAIL PROTECTED]>
*/
  -public class RemoteAddrInNetwork extends GenericMatcher {
  -private Collection networks = null;
  -
  -public void init() throws MessagingException {
  -StringTokenizer st = new StringTokenizer(getCondition(), ", ", false);
  -networks = new Vector();
  -while (st.hasMoreTokens()) {
  -String addr = st.nextToken();
  -if (addr.equals("127.0.0.1")) {
  -//Add address of local machine as a match
  -try {
  -InetAddress localaddr = InetAddress.getLocalHost();
  -networks.add(localaddr.getHostAddress());
  -} catch (UnknownHostException uhe) {
  -}
  -}
  -
  -try {
  -if (addr.endsWith("*")) {
  -addr = addr.substring(0, addr.length() - 1);
  -}
  -else {
  -addr = InetAddress.getByName(addr).getHostAddress();
  -}
  -networks.add(addr);
  -} catch (UnknownHostException uhe) {
  -log("Cannot match against invalid domain: " + uhe.getMessage());
  -}
  -}
  -}
  -
  +public class RemoteAddrInNetwork extends AbstractNetworkMatcher {
   public Collection match(Mail mail) {
  -String host = mail.getRemoteAddr();
  -//Check to see whether it's in any of the networks... needs to be smarter to
  -// support subnets better
  -for (Iterator i = networks.iterator(); i.hasNext(); ) {
  -String networkAddr = i.next().toString();
  -if (host.startsWith(networkAddr)) {
  -//This is in this network... that's all we need for a match
  -return mail.getRecipients();
  -}
  -}
  -//Could not match this to any network
  -return null;
  +return matchNetwork(mail.getRemoteAddr()) ? mail.getRecipients() : null;
   }
   }
  
  
  
  1.4.4.3   +6 -57 
jakarta-james/src/java/org/apache/james/transport/matchers/RemoteAddrNotInNetwork.java
  
  Index: RemoteAddrNotInNetwork.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/matchers/RemoteAddrNotInNetwork.java,v
  retrieving revision 1.4.4.2
  retrieving revision 1.4.4.3
  diff -u -r1.4.4.2 -r1.4.4.3
  --- RemoteAddrNotInNetwork.java   8 Mar 2003 21:54:09 -   1.4.4.2
  +++ RemoteAddrNotInNetwork.java   6 Jun 2003 23:52:49 -   1.4.4.3
  @@ -58,72 +58,21 @@
   
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.GenericMatcher

cvs commit: jakarta-james/src/java/org/apache/james/transport/matchers AbstractNetworkMatcher.java RemoteAddrInNetwork.java RemoteAddrNotInNetwork.java

2003-06-06 Thread noel
noel2003/06/06 16:51:38

  Modified:src/java/org/apache/james/transport/matchers
RemoteAddrInNetwork.java
RemoteAddrNotInNetwork.java
  Added:   src/java/org/apache/james/transport/matchers
AbstractNetworkMatcher.java
  Log:
  New AbstractNetworkMatcher class using NetMatcher.  RemoteAddr[Not]InNetwork are now 
subclasses.
  
  Revision  ChangesPath
  1.9   +6 -57 
jakarta-james/src/java/org/apache/james/transport/matchers/RemoteAddrInNetwork.java
  
  Index: RemoteAddrInNetwork.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/matchers/RemoteAddrInNetwork.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- RemoteAddrInNetwork.java  8 Mar 2003 21:14:10 -   1.8
  +++ RemoteAddrInNetwork.java  6 Jun 2003 23:51:38 -   1.9
  @@ -58,72 +58,21 @@
   
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.GenericMatcher;
   import org.apache.mailet.Mail;
   
   import javax.mail.MessagingException;
  -import java.net.InetAddress;
  -import java.net.UnknownHostException;
   import java.util.Collection;
  -import java.util.Iterator;
  -import java.util.StringTokenizer;
  -import java.util.Vector;
   
   /**
* Checks the IP address of the sending server against a comma-
  - * delimited list of IP addresses or domain names.
  - * Networks should be indicated with a wildcard *, e.g. 192.168.* 
  - * Note: The wildcard can go at any level, the matcher will match if the
  - * sending host's IP address (as a String based on the octet representation)
  - * starts with the String indicated in the configuration file, excluding the
  - * wildcard.
  - * Multiple addresses can be indicated, e.g: '127.0.0.1,192.168.*,domain.tld'
  + * delimited list of IP addresses, domain names or sub-nets.
  + *
  + * See AbstractNetworkMatcher for details on how to specify
  + * entries.
*
  - * @author  Serge Knystautas <[EMAIL PROTECTED]>
*/
  -public class RemoteAddrInNetwork extends GenericMatcher {
  -private Collection networks = null;
  -
  -public void init() throws MessagingException {
  -StringTokenizer st = new StringTokenizer(getCondition(), ", ", false);
  -networks = new Vector();
  -while (st.hasMoreTokens()) {
  -String addr = st.nextToken();
  -if (addr.equals("127.0.0.1")) {
  -//Add address of local machine as a match
  -try {
  -InetAddress localaddr = InetAddress.getLocalHost();
  -networks.add(localaddr.getHostAddress());
  -} catch (UnknownHostException uhe) {
  -}
  -}
  -
  -try {
  -if (addr.endsWith("*")) {
  -addr = addr.substring(0, addr.length() - 1);
  -}
  -else {
  -addr = InetAddress.getByName(addr).getHostAddress();
  -}
  -networks.add(addr);
  -} catch (UnknownHostException uhe) {
  -log("Cannot match against invalid domain: " + uhe.getMessage());
  -}
  -}
  -}
  -
  +public class RemoteAddrInNetwork extends AbstractNetworkMatcher {
   public Collection match(Mail mail) {
  -String host = mail.getRemoteAddr();
  -//Check to see whether it's in any of the networks... needs to be smarter to
  -// support subnets better
  -for (Iterator i = networks.iterator(); i.hasNext(); ) {
  -String networkAddr = i.next().toString();
  -if (host.startsWith(networkAddr)) {
  -//This is in this network... that's all we need for a match
  -return mail.getRecipients();
  -}
  -}
  -//Could not match this to any network
  -return null;
  +return matchNetwork(mail.getRemoteAddr()) ? mail.getRecipients() : null;
   }
   }
  
  
  
  1.9   +6 -57 
jakarta-james/src/java/org/apache/james/transport/matchers/RemoteAddrNotInNetwork.java
  
  Index: RemoteAddrNotInNetwork.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/matchers/RemoteAddrNotInNetwork.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- RemoteAddrNotInNetwork.java   8 Mar 2003 21:14:10 -   1.8
  +++ RemoteAddrNotInNetwork.java   6 Jun 2003 23:51:38 -   1.9
  @@ -58,72 +58,21 @@
   
   package org.apache.james.transport.matchers;
   
  -import org.apache.mailet.GenericMatcher;
   import org.apache.mailet.Mail;
   
   import javax.mail.MessagingException;
  -import java.net.InetAddress;
  -import java.net.UnknownHostException;
   import 

cvs commit: jakarta-james/src/java/org/apache/james/transport/matchers AttachmentFileNameIs.java

2003-06-06 Thread noel
noel2003/06/06 16:49:37

  Modified:src/java/org/apache/james/transport/matchers
AttachmentFileNameIs.java
  Log:
  More robust content handling, case insensitive matching.
  
  Revision  ChangesPath
  1.3   +52 -25
jakarta-james/src/java/org/apache/james/transport/matchers/AttachmentFileNameIs.java
  
  Index: AttachmentFileNameIs.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/matchers/AttachmentFileNameIs.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AttachmentFileNameIs.java 19 May 2003 23:51:45 -  1.2
  +++ AttachmentFileNameIs.java 6 Jun 2003 23:49:37 -   1.3
  @@ -69,15 +69,16 @@
   import java.util.Collection;
   import java.util.Iterator;
   import java.util.StringTokenizer;
  +import java.util.Locale;
   
   
   /**
  - * Checks if at least one attachment has a file name which matches any
  + * Checks if at least one attachment has a file name which matches any
* element of a comma-separated list of file name masks.
  - * File name masks may start with a wildcard * 
  - * Multiple file name masks can be specified, e.g.: '*.scr,*.bat'
  + * The match is case insensitive.
  + * File name masks may start with a wildcard '*'.
  + * Multiple file name masks can be specified, e.g.: '*.scr,*.bat'.
*
  - * Possible enhancement: it should be case insensitive
*/
   public class AttachmentFileNameIs extends GenericMatcher {
   /**
  @@ -110,6 +111,8 @@
   mask.suffixMatch = false;
   mask.matchString = fileName;
   }
  +mask.matchString = mask.matchString.toLowerCase(Locale.US);
  +mask.matchString = mask.matchString.trim();
   theMasks.add(mask);
   }
   masks = (Mask[])theMasks.toArray(new Mask[0]);
  @@ -119,42 +122,66 @@
* either every recipient is matching or neither of them
*/
   public Collection match(Mail mail) throws MessagingException {
  -Multipart content;
   MimeMessage message = mail.getMessage();
  +Object content;
   
   /**
  - * if the content-type is not multipart/mixed, then there is no 
  - * attachment 
  + * if there is an attachment and no inline text,
  + * the content type can be anything
*/ 
  -if (message.getContentType() == null ||
  -!message.getContentType().startsWith("multipart/mixed")) {
  +if (message.getContentType() == null) {
   return null;
   }
  +
   try {
  -content = (Multipart)message.getContent(); 
  +content = message.getContent(); 
   } catch (java.io.IOException e) {
   throw new MessagingException(
   "Attachment file names cannot be determined", e);
   }
  -for (int i = 0; i < content.getCount(); i++) {
  -Part part = content.getBodyPart(i);
  -String fileName = part.getFileName();
  -if (fileName == null) continue;
  -for (int j = 0; j < masks.length; j++) {
  -boolean fMatch;
  -Mask mask = masks[j];
  -
  -//XXX: file names in mail may contain directory - theoretically
  -if (mask.suffixMatch) {
  -fMatch = fileName.endsWith(mask.matchString);
  -} else {
  -fMatch = fileName.equals(mask.matchString);
  -}
  -if (fMatch) return mail.getRecipients(); // matching file found
  +if (content instanceof Multipart) {
  +Multipart multipart = (Multipart) content;
  +for (int i = 0; i < multipart.getCount(); i++) {
  +try {
  +Part part = multipart.getBodyPart(i);
  +String fileName = part.getFileName();
  +if (fileName != null && matchFound(fileName)) {
  +return mail.getRecipients(); // matching file found
  +}
  +} catch (Exception ex) {} // ignore any exception and process next 
bodypart
   }
  +} else {
  +try {
  +String fileName = message.getFileName();
  +if (fileName != null && matchFound(fileName)) {
  +return mail.getRecipients(); // matching file found
  +}
  +} catch (Exception ex) {} // ignore any exception
   }
   
   return null; // no matching attachment found
  +}
  +
  +/*
  + * Checks if fileName matches with at least one of the 
masks.
  + */
  +private boolean matchFound(String fileName) {
  +fileName = fileName.toLowerCase(Locale.US);
  +   

cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets AbstractNotify.java AbstractRedirect.java Bounce.java Forward.java NotifyPostmaster.java NotifySender.java Redirect.java

2003-06-06 Thread noel
noel2003/06/06 16:46:36

  Modified:src/java/org/apache/james/transport/mailets
AbstractNotify.java AbstractRedirect.java
Bounce.java Forward.java NotifyPostmaster.java
NotifySender.java Redirect.java
  Log:
  Enhanced the javadocs.  Fix in AbstractRedirect to avoid re-rendering a message that 
we aren't changing.  Check for valid Sender domain moved to AbstractRedirect.
  
  Revision  ChangesPath
  1.3   +11 -12
jakarta-james/src/java/org/apache/james/transport/mailets/AbstractNotify.java
  
  Index: AbstractNotify.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/AbstractNotify.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractNotify.java   3 Jun 2003 05:07:30 -   1.2
  +++ AbstractNotify.java   6 Jun 2003 23:46:35 -   1.3
  @@ -110,11 +110,11 @@
*
*/
   public abstract class AbstractNotify extends AbstractRedirect {
  -
  +
   /*  */
   /* ** Begin of getX and setX methods ** */
   /*  */
  -
  +
   /**
* @return true, as all notifications should
*/
  @@ -128,14 +128,14 @@
   protected int getInLineType() {
   return NONE;
   }
  -
  +
   /**
* @return MESSAGE
*/
   protected int getAttachmentType() {
   return MESSAGE;
   }
  -
  +
   /**
* @return the notice init parameter
*/
  @@ -146,7 +146,7 @@
   return getInitParameter("notice");
   }
   }
  -
  +
   /**
* @return the full message to append, built from the Mail object
*/
  @@ -154,7 +154,7 @@
   MimeMessage message = originalMail.getMessage();
   StringWriter sout = new StringWriter();
   PrintWriter out = new PrintWriter(sout, true);
  -
  +
   // First add the "local" notice
   // (either from conf or generic error message)
   out.println(getMessage());
  @@ -208,10 +208,10 @@
   if (message.getLineCount() >= 0) {
   out.println("  Number of lines: " + message.getLineCount());
   }
  -
  +
   return sout.toString();
   }
  -
  +
   /**
* @return the value of the sendingAddress init parameter if not 
null,
* the postmaster address otherwise
  @@ -223,7 +223,7 @@
   return new MailAddress(getInitParameter("sendingAddress"));
   }
   }
  -
  +
   /**
* @return the attachStackTrace init parameter
*/
  @@ -236,7 +236,7 @@
   }
   return attachStackTrace;
   }
  -
  +
   /**
* @return true
*/
  @@ -247,6 +247,5 @@
   /*  */
   /* *** End of getX and setX methods *** */
   /*  */
  -
  -}
   
  +}
  
  
  
  1.5   +64 -31
jakarta-james/src/java/org/apache/james/transport/mailets/AbstractRedirect.java
  
  Index: AbstractRedirect.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/AbstractRedirect.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractRedirect.java 6 Jun 2003 04:46:03 -   1.4
  +++ AbstractRedirect.java 6 Jun 2003 23:46:35 -   1.5
  @@ -298,11 +298,11 @@
* May return one of the following values to indicate how to append the 
original message
* to build the new message:
* 
  - *UNALTERED : original message is the new message body
  - *BODY : original message body is appended to the new message
  - *HEADS : original message headers are appended to the new message
  - *ALL : original is appended with all headers
  - *NONE : original is not appended
  + *UNALTERED : original message is the new message body
  + *BODY : original message body is appended to the new 
message
  + *HEADS : original message headers are appended to the new 
message
  + *ALL : original is appended with all headers
  + *NONE : original is not appended
* 
* Is a "getX()" method.
*
  @@ -317,23 +317,22 @@
* built dynamically using the original Mail object.
* Is a "getX(Mail)" method.
*
  - * @return [EMAIL PROTECTED] #getInlineType()}
  + * @return [EMAIL PROTECTED] #getInLineType()}
*/
   protected int getInLineType(Mail origi

cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets RemoteDelivery.java

2003-06-06 Thread noel
noel2003/06/06 16:43:09

  Modified:src/java/org/apache/james/transport/mailets
RemoteDelivery.java
  Log:
  If send failure and no successful sends, try other servers on the list.  Also 
extended period when we wait for HELLO_NAME to be registered
  
  Revision  ChangesPath
  1.50  +19 -4 
jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
  
  Index: RemoteDelivery.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- RemoteDelivery.java   27 May 2003 03:02:22 -  1.49
  +++ RemoteDelivery.java   6 Jun 2003 23:43:08 -   1.50
  @@ -334,6 +334,17 @@
 .append(outgoingMailServer);
   log(logMessageBuffer.toString());
   return true;
  +} catch (SendFailedException sfe) {
  +if (sfe.getValidSentAddresses() == null
  +  || sfe.getValidSentAddresses().length < 1) {
  +if (isDebug) log("Send failed, continuing with any other 
servers");
  +lastError = sfe;
  +continue;
  +} else {
  +// If any mail was sent then the outgoing
  +// server config must be ok, therefore rethrow
  +throw sfe;
  +}
   } catch (MessagingException me) {
   //MessagingException are horribly difficult to figure out what 
actually happened.
   StringBuffer exceptionBuffer =
  @@ -698,9 +709,13 @@
* measure, I'm inserting this philosophically unsatisfactory
* fix.
*/
  -try {
  -Thread.sleep(5000);
  -} catch (Exception ignored) {} // wait for James to finish initializing
  +long stop = System.currentTimeMillis() + 6;
  +while ((getMailetContext().getAttribute(MailetContextConstants.HELLO_NAME) 
== null)
  +   && stop > System.currentTimeMillis()) {
  +try {
  +Thread.sleep(1000);
  +} catch (Exception ignored) {} // wait for James to finish initializing
  +}
   
   //Checks the pool and delivers a mail message
   Properties props = new Properties();
  
  
  

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



cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets LocalDelivery.java

2003-06-06 Thread noel
noel2003/06/06 16:41:38

  Modified:src/java/org/apache/james/transport/mailets
LocalDelivery.java
  Log:
  Minor code cleanup
  
  Revision  ChangesPath
  1.17  +8 -16 
jakarta-james/src/java/org/apache/james/transport/mailets/LocalDelivery.java
  
  Index: LocalDelivery.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/LocalDelivery.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- LocalDelivery.java16 May 2003 15:29:31 -  1.16
  +++ LocalDelivery.java6 Jun 2003 23:41:38 -   1.17
  @@ -123,21 +123,6 @@
   }
   }
   
  -/* MimeMessage that does NOT change the headers when we save it */
  -class LocalMimeMessage extends MimeMessage {
  -
  -public LocalMimeMessage(MimeMessage source) throws MessagingException {
  -super(source);
  -}
  -
  -protected void updateHeaders() throws MessagingException {
  -if (getMessageID() == null) super.updateHeaders();
  -else {
  -modified = false;
  -}
  -}
  -}
  -
   /**
* Delivers a mail to a local mailbox.
*
  @@ -208,7 +193,14 @@
   }
   try {
   // Add qmail's de facto standard Delivered-To header
  -MimeMessage localMessage = new LocalMimeMessage(message);
  +MimeMessage localMessage = new MimeMessage(message) {
  +protected void updateHeaders() throws MessagingException {
  +if (getMessageID() == null) super.updateHeaders();
  +else {
  +modified = false;
  +}
  +}
  +};
   localMessage.addHeader("Delivered-To", recipient.toString());
   localMessage.saveChanges();
   
  
  
  

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



New AbstractNetworkMatcher

2003-06-06 Thread Noel J. Bergman
I am about to check in a new AbstractNetworkMatcher that uses the same
NetMatcher class used by the SMTP Handler for fast fail.

RemoteAddrNotInNetwork and RemoteAddrInNetwork now extend
AbstractNetworkMatcher.  Other types of network matchers are faciliated.
The RemoteAddrNotInNetwork code demonstrates how trivial it is to code a
network matcher:

public class RemoteAddrNotInNetwork extends AbstractNetworkMatcher {
public Collection match(Mail mail) {
return matchNetwork(mail.getRemoteAddr()) ? null :
mail.getRecipients();
}
}

The default behavior of AbstractNetworkMatcher is to build the network
matcher from the matcher condition.  It could be subclassed, e.g., to load
the list from a file.

I've no current plans for any other subclasses, but the code is there to be
reused.

--- Noel


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



Re: Understanding the SMTPHandler Data method

2003-06-06 Thread Andrew C. Oliver
Doh... I accidentally tapped the touch pad and sent that before I was done
editing it.   I was just going to make it sound better...sorry.. :-(

-andy

On 6/5/03 9:34 PM, "Andrew C. Oliver" <[EMAIL PROTECTED]> wrote:

> Thanks, I think I understood that.  The other explanation posted I think
> answered my question (regarding the headers eating the crlf).  My objectives
> are really offtopic.  I'm writing an SMTP JMX service which interacts with
> message queues/topics in Jboss.  POP/IMAP will come later.  Note that I
> don't wish to debate JMX vs Avalon, J2ee, JMS or any of that...
> 
> Please reference me your mail on handlers, I couldn't find it.  I'm
> following the command pattern with it.  Each command gets its own class
> delegated from the handler.
> 
>> 
>> 
>>> Mail mail = Mail.create(msgIn);
>> 
>> This is a change to the Mailet API, not the James server implementation.  We
>> do not want to see the Mailet API balkanized.  Do what you want with the
>> org.apache.james.* packages in your fork.  In the above case, you could do:
>> 
>> Mail mail = MailImpl.create(msgIn);
>> 
>> and no one would care.  If you do feel that it is necessary to change the
>> Mailet Specification, please bring up your proposals for discussion.
>> 
> 
> No worries, I'm not using the mailet stuff, just happens to also be called
> mail.  This isn't an area I'll likely collaborate on.
> 
> Like I said, I don¹t want to debate.  I'll be taking code for my stuff, and
> I'll donate back where I can.
> 
> -andy
> 
>> --- Noel
>> 
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 

-- 
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?


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



Re: Understanding the SMTPHandler Data method

2003-06-06 Thread Andrew C. Oliver
Thanks, I think I understood that.  The other explanation posted I think
answered my question (regarding the headers eating the crlf).  My objectives
are really offtopic.  I'm writing an SMTP JMX service which interacts with
message queues/topics in Jboss.  POP/IMAP will come later.  Note that I
don't wish to debate JMX vs Avalon, J2ee, JMS or any of that...

Please reference me your mail on handlers, I couldn't find it.  I'm
following the command pattern with it.  Each command gets its own class
delegated from the handler.

> 
> 
>> Mail mail = Mail.create(msgIn);
> 
> This is a change to the Mailet API, not the James server implementation.  We
> do not want to see the Mailet API balkanized.  Do what you want with the
> org.apache.james.* packages in your fork.  In the above case, you could do:
> 
> Mail mail = MailImpl.create(msgIn);
> 
> and no one would care.  If you do feel that it is necessary to change the
> Mailet Specification, please bring up your proposals for discussion.
>

No worries, I'm not using the mailet stuff, just happens to also be called
mail.  This isn't an area I'll likely collaborate on.

Like I said, I don¹t want to debate.  I'll be taking code for my stuff, and
I'll donate back where I can.

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

-- 
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?


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



RE: Understanding the SMTPHandler Data method

2003-06-06 Thread Noel J. Bergman
> I have totally different objectives from JAMES.

What are your objectives?  :-)

> So I'm trying to understand how SMTPHandler: doData works.
> I've tried to do a little refactoring

FWIW, see a message I posted this morning for more information on how the
handlers may change in the future.

> how does the doDATA and its collaborating streams
> work?

The different streams add behavior to the pipe, as detailed below:

> in = new BufferedInputStream(socket.getInputStream(), 1024);

  This is the raw input stream.


> InputStream msgIn = new CharTerminatedInputStream(in,SMTPTerminator);

  The CharTerminatedInputStream is an InputStream that reads until
  it recognizes the particular pattern of data specified.  In this
  case, it is looking for CRLF.CRLF.


> msgIn = new SizeLimitedInputStream(msgIn,
>smtpProtocol.getPropertyLong(MAX_MSG_SIZE));

  This imposes a limit on the amount of data that will be allowed
  through the stream.

> msgIn = new DotStuffingInputStream(msgIn);

  This decodes dot stuffing.


> Mail mail = Mail.create(msgIn);

This is a change to the Mailet API, not the James server implementation.  We
do not want to see the Mailet API balkanized.  Do what you want with the
org.apache.james.* packages in your fork.  In the above case, you could do:

  Mail mail = MailImpl.create(msgIn);

and no one would care.  If you do feel that it is necessary to change the
Mailet Specification, please bring up your proposals for discussion.

--- Noel


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



RE: Bug 18471 missing attributes on mail

2003-06-06 Thread Danny Angus
> Note, that the required parameter is never checked.
> Now as I would like to call this with required=false, I will 
> change it to the 
> obvious correct code. 
> The question is now, does this qualify as a separate patch, or can it be 
> bundled with the patch for JdbcMailRepository?

I'd submit it seperately, so it gets a distinct mention in the cvs log


> Also in the same line, I have proposed a set of matchers/mailets which 
> operates on mail attributes. I guess they would be preferred in a 
> separate 
> patch, but is a patch preferred for each mailet/matcher or will it be 
> preferred to submit them in one patch.

All in one patch would be fine I guess, if you also submit documentation patches to 
cover them... :-)

d.

Re: Understanding the SMTPHandler Data method

2003-06-06 Thread Harmeet Bedi
- Original Message -
From: "Andrew C. Oliver" <[EMAIL PROTECTED]>
>ih = new InternetHeaders(msgIn);
> // just for debugging
>byte[] b = new byte[4];
>msgIn.read(b);

> Oddly, this just blocks when mozilla mail tries.

There may be a problem with above snippet.
It is my impression that InternetHeaders eats line terminating CRLF and the
empty line after header. It attempts to read bytes till it finds an empty
line.

This may be a reason for blocking.

Harmeet


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



Understanding the SMTPHandler Data method

2003-06-06 Thread Andrew C. Oliver
Hi all,

First of all, I'll be up front, I'm doing a different SMTP server.  Its kind
of a fork because I have totally different objectives from JAMES.

However, I'd like to work within the JAMES community.  In the work I'm doing
I'm gaining insight and places where I refactor thing, it may make sense to
just share the love in both places.  Anyhow I don't want to argue these
points or my motives or whatever, just be up front.

So I'm trying to understand how SMTPHandler: doData works.  I've tried to do
a little refactoring (I realize I have more to do):


InputStream in = request.getInputStream();
InputStream msgIn = new
CharTerminatedInputStream(in,SMTPTerminator);
msgIn = new SizeLimitedInputStream(msgIn,
smtpProtocol.getPropertyLong(MAX_MSG_SIZE));
msgIn = new DotStuffingInputStream(msgIn);
Mail mail = Mail.create(msgIn);

  public Mail(InputStream msgIn) {
   System.out.println("MAIL constructor called");
   try {
   ih = new InternetHeaders(msgIn);
// just for debugging
   byte[] b = new byte[4];
   msgIn.read(b);

  System.out.println(new String(b));
// just for debugging
   } catch (Exception e) {
 e.printStackTrace();
   }
   debugPrintHeaders(ih);

   }

   public static Mail create(InputStream msgIn) {
System.out.println("Mail CREATE called");
 Mail mail = new Mail(msgIn);
 return mail;
   }
=

Oddly, this just blocks when mozilla mail tries.  When I go at it with
telnet it returns on the first enter.

So I guess my curiosity is how does the doDATA and its collaborating streams
work?  What am I missing from this picture?

Thanks for any help you can provide.

-Andy

-- 
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?


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



RE: how hard is it to write a SMTP client?

2003-06-06 Thread Chris Means
Maybe an implementation of the Quota system, but in reverse would work well
here.

Instead of diskspace being reduced by email piling up...

A quota is paid for (cost computed by quantity and message size), and is
reduced for each message sent, and rejected once 0 is reached.

> -Original Message-
> From: Frank Herrmann [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 06, 2003 6:24 AM
> To: James Developers List
> Subject: RE: how hard is it to write a SMTP client?
>
>
> Richard and Noel,
>
> --- "Noel J. Bergman" <[EMAIL PROTECTED]> wrote:
> > Richard,
> > With respect to writing your own SMTP client, it is
> > simple for simple cases,
> > but the totality of SMTP isn't simple.
>
> Considering these facts about 1/2 year ago I chose
> James as an implementation basis for a very similiar
> project and found James very suitable. (which is a
> reliable solution capable of all those nice exception
> cases which I could never program myself) BTW. thanks
> to all james developers!
>
> >
> > However, I don't see why you can't use James for
> > your application.  What you
> > are proposing seems like a fairly straightforward
> > custom application of
>
> Understanding concepts of James ate up almost half of
> development time. :-)
>
> > James.  From what I read on your site, and from your
> > post, it is essentially
> > a variation on a TMDA (www.tmda.net/) scheme, but
> > requiring payment rather
> > than authentication.
> >
>
> The challenge-response-payment idea was IMHO first
> discussed in "Pricing via processing" (Cynthia Dwork,
> Moni Naor, 1991).
>
> You can find the paper here:
>
> http://www.wisdom.weizmann.ac.il/~naor/onpub.html
>
> TMDA is one implementation of that idea. At the moment
> the "beloved" company Microsoft is heavily researching
> in this field.
>
> URL:
>
> http://research.microsoft.com/research/sv/PennyBlack/
>
> However, my guess is next version of windows will
> contain this feature.
>
> Greetings,
> Frank
>
>
> __
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



RE: fix for bug 20370

2003-06-06 Thread Noel J. Bergman
Yes, it is obvious.  :-)  But I doubt that any major (or perhaps even minor)
clients will have an issue.  That sort of thing is usually violated only by
someone's hacked script or using telnet.

By the way, take a look at http://james.apache.org/weare.html. :-)

--- Noel


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



Re: fix for bug 20370

2003-06-06 Thread Richard O. Hammer
Perhaps this is obvious, but we should now be prepared to hear 
complaints from people with SMTP clients which could formerly succeed 
in sending non-conforming envelopes to James (envelopes containing 
lines terminated with either CR or LF alone).  These clients, assuming 
there are some, will suddenly start reporting errors when 
administrators update James to a version which includes this recent 
fix to conform with the RFC.  But maybe there are not any such 
clients.  In any case, we have certainly created a way to find out.

Rich

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


RE: Logging in the new DNSServer service

2003-06-06 Thread Noel J. Bergman
> If there is no MX record, A record represents mail host.
> It is not an error to have no MX Records and neither is
> it necessary to recieve mail.

Correct.  The code handles that.  The only issue was the log level.

> if ( collection.size() == 0 ) {
>try {
>InetAddress.getByName(hostname);
>} catch (UnknownHostException ex) {
>// there is no A record.
>collection.add(hostname);
>}
> }

That is almost what is in the code, except you have the add in the wrong
place. You are adding the host name if there is no A RR.  You want to add it
if there IS an A record.  :-)

--- Noel


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



cvs commit: jakarta-james/src/java/org/apache/james/dnsserver DNSServer.java

2003-06-06 Thread noel
noel2003/06/06 09:37:15

  Modified:src/java/org/apache/james/dnsserver Tag: branch_2_1_fcs
DNSServer.java
  Log:
  Changed log level for missing MX records
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.9.4.4   +1 -1  jakarta-james/src/java/org/apache/james/dnsserver/DNSServer.java
  
  Index: DNSServer.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/dnsserver/DNSServer.java,v
  retrieving revision 1.9.4.3
  retrieving revision 1.9.4.4
  diff -u -r1.9.4.3 -r1.9.4.4
  --- DNSServer.java29 May 2003 05:05:33 -  1.9.4.3
  +++ DNSServer.java6 Jun 2003 16:37:15 -   1.9.4.4
  @@ -236,7 +236,7 @@
   .append("Couldn't resolve MX records for domain ")
   .append(hostname)
   .append(".");
  -getLogger().error(logBuffer.toString());
  +getLogger().info(logBuffer.toString());
   try {
   InetAddress.getByName(hostname);
   servers.add(hostname);
  
  
  

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



cvs commit: jakarta-james/src/java/org/apache/james/dnsserver DNSServer.java

2003-06-06 Thread noel
noel2003/06/06 09:36:10

  Modified:src/java/org/apache/james/dnsserver DNSServer.java
  Log:
  Changed log level for missing MX records
  
  Revision  ChangesPath
  1.18  +1 -1  jakarta-james/src/java/org/apache/james/dnsserver/DNSServer.java
  
  Index: DNSServer.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/dnsserver/DNSServer.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DNSServer.java8 Mar 2003 21:14:02 -   1.17
  +++ DNSServer.java6 Jun 2003 16:36:08 -   1.18
  @@ -236,7 +236,7 @@
   .append("Couldn't resolve MX records for domain ")
   .append(hostname)
   .append(".");
  -getLogger().error(logBuffer.toString());
  +getLogger().info(logBuffer.toString());
   try {
   InetAddress.getByName(hostname);
   servers.add(hostname);
  
  
  

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



RE: Bug 18471 missing attributes on mail

2003-06-06 Thread Noel J. Bergman
> Just started working on the changes for the JdbcMailRepository
> (I hope late is better than never)

Absolutely.  :-)

> public String getSqlString(String name, boolean required)
>   String sql = getSqlString(name);
>   if ( sql == null ) {

Fixed.

> I have proposed a set of matchers/mailets which operates
> on mail attributes.

Probably one patch for existing matchers/mailets, and one for new ones.

--- Noel

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



cvs commit: jakarta-james/src/java/org/apache/james/util SqlResources.java XMLResources.java

2003-06-06 Thread noel
noel2003/06/06 09:19:57

  Modified:src/java/org/apache/james/util Tag: branch_2_1_fcs
SqlResources.java XMLResources.java
  Log:
  Fixed missing check for required value
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.5.4.4   +1 -1  jakarta-james/src/java/org/apache/james/util/SqlResources.java
  
  Index: SqlResources.java
  ===
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/util/SqlResources.java,v
  retrieving revision 1.5.4.3
  retrieving revision 1.5.4.4
  diff -u -r1.5.4.3 -r1.5.4.4
  --- SqlResources.java 31 May 2003 23:46:25 -  1.5.4.3
  +++ SqlResources.java 6 Jun 2003 16:19:57 -   1.5.4.4
  @@ -337,7 +337,7 @@
   {
   String sql = getSqlString(name);
   
  -if ( sql == null ) {
  +if (sql == null && required) {
   StringBuffer exceptionBuffer =
   new StringBuffer(64)
   .append("Required SQL resource: '")
  
  
  
  1.1.2.2   +1 -1  
jakarta-james/src/java/org/apache/james/util/Attic/XMLResources.java
  
  Index: XMLResources.java
  ===
  RCS file: 
/home/cvs/jakarta-james/src/java/org/apache/james/util/Attic/XMLResources.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- XMLResources.java 4 Jun 2003 18:27:46 -   1.1.2.1
  +++ XMLResources.java 6 Jun 2003 16:19:57 -   1.1.2.2
  @@ -357,7 +357,7 @@
   {
   String str = getString(name);
   
  -if ( str == null ) {
  +if (str == null && required) {
   StringBuffer exceptionBuffer =
   new StringBuffer(64)
   .append("Required String resource: '")
  
  
  

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



cvs commit: jakarta-james/src/java/org/apache/james/util SqlResources.java

2003-06-06 Thread noel
noel2003/06/06 09:19:39

  Modified:src/java/org/apache/james/util SqlResources.java
  Log:
  Fixed missing check for required value
  
  Revision  ChangesPath
  1.12  +1 -1  jakarta-james/src/java/org/apache/james/util/SqlResources.java
  
  Index: SqlResources.java
  ===
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/util/SqlResources.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SqlResources.java 1 Jun 2003 00:02:31 -   1.11
  +++ SqlResources.java 6 Jun 2003 16:19:38 -   1.12
  @@ -342,7 +342,7 @@
   {
   String sql = getSqlString(name);
   
  -if ( sql == null ) {
  +if (sql == null && required) {
   StringBuffer exceptionBuffer =
   new StringBuffer(64)
   .append("Required SQL resource: '")
  
  
  

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



cvs commit: jakarta-james/www index.html smtp_configuration_2_1.html weare.html

2003-06-06 Thread noel
noel2003/06/05 15:43:25

  Modified:www  index.html smtp_configuration_2_1.html weare.html
  Log:
  site updates.  see src/xdocs for details
  
  Revision  ChangesPath
  1.28  +1 -1  jakarta-james/www/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/jakarta-james/www/index.html,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- index.html12 May 2003 23:12:06 -  1.27
  +++ index.html5 Jun 2003 22:43:25 -   1.28
  @@ -236,7 +236,7 @@
   
   
   Item
  -Status (v2.0a3)
  +Status
   Since
   First released
 
  
  
  
  1.6   +1 -1  jakarta-james/www/smtp_configuration_2_1.html
  
  Index: smtp_configuration_2_1.html
  ===
  RCS file: /home/cvs/jakarta-james/www/smtp_configuration_2_1.html,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- smtp_configuration_2_1.html   11 May 2003 02:04:03 -  1.5
  +++ smtp_configuration_2_1.html   5 Jun 2003 22:43:25 -   1.6
  @@ -207,7 +207,7 @@
   
   
   maxmessagesize - This is an optional tag with a non-negative 
integer body.  It specifies the maximum 
  -size, in bytes, of any message that will be transmitted by this SMTP server.  It is 
a service-wide, as opposed to 
  +size, in kbytes, of any message that will be transmitted by this SMTP server.  It 
is a service-wide, as opposed to 
   a per user, limit.  If the value is zero then there is no limit.  If the tag isn't 
specified, the service will
   default to an unlimited message size.
   
  
  
  
  1.22  +4 -0  jakarta-james/www/weare.html
  
  Index: weare.html
  ===
  RCS file: /home/cvs/jakarta-james/www/weare.html,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- weare.html27 May 2003 20:59:37 -  1.21
  +++ weare.html5 Jun 2003 22:43:25 -   1.22
  @@ -330,6 +330,10 @@
   Tim Stephenson (tim at thestephensons.me.uk) [TS]
   
   
  +
  +Richard O. Hammer (rohammer at earthlink.net) [ROH]
  +
  +
   
   
   
  
  
  

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



cvs commit: jakarta-james/src/xdocs weare.xml

2003-06-06 Thread noel
noel2003/06/05 15:33:55

  Modified:src/xdocs weare.xml
  Log:
  Added Richard O. Hammer
  
  Revision  ChangesPath
  1.22  +1 -0  jakarta-james/src/xdocs/weare.xml
  
  Index: weare.xml
  ===
  RCS file: /home/cvs/jakarta-james/src/xdocs/weare.xml,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- weare.xml 27 May 2003 07:05:10 -  1.21
  +++ weare.xml 5 Jun 2003 22:33:55 -   1.22
  @@ -55,6 +55,7 @@
   Cesar Bonadio (bonadio at picture.com.br) [CB3]
   Marco Tedone (mtedone at jemos.org) [MT]
   Tim Stephenson (tim at thestephensons.me.uk) [TS]
  +Richard O. Hammer (rohammer at earthlink.net) [ROH]
   
   
   
  
  
  

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



cvs commit: jakarta-james/src/xdocs smtp_configuration_2_1.xml

2003-06-06 Thread noel
noel2003/06/05 15:33:48

  Modified:src/xdocs smtp_configuration_2_1.xml
  Log:
  Fixed  description
  
  Revision  ChangesPath
  1.4   +1 -1  jakarta-james/src/xdocs/smtp_configuration_2_1.xml
  
  Index: smtp_configuration_2_1.xml
  ===
  RCS file: /home/cvs/jakarta-james/src/xdocs/smtp_configuration_2_1.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- smtp_configuration_2_1.xml7 Dec 2002 20:38:20 -   1.3
  +++ smtp_configuration_2_1.xml5 Jun 2003 22:33:48 -   1.4
  @@ -43,7 +43,7 @@
   if SMTP authentication is required.  If the parameter is set to true then the 
sender address for the submitted message
   will be verified against the authenticated subject.
   maxmessagesize - This is an optional tag with a non-negative 
integer body.  It specifies the maximum 
  -size, in bytes, of any message that will be transmitted by this SMTP server.  It is 
a service-wide, as opposed to 
  +size, in kbytes, of any message that will be transmitted by this SMTP server.  It 
is a service-wide, as opposed to 
   a per user, limit.  If the value is zero then there is no limit.  If the tag isn't 
specified, the service will
   default to an unlimited message size.
   
  
  
  

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



cvs commit: jakarta-james/src/xdocs weare.xml

2003-06-06 Thread noel
noel2003/06/05 15:33:34

  Modified:src/xdocs Tag: branch_2_1_fcs weare.xml
  Log:
  Added Richard O. Hammer
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.12.4.9  +1 -0  jakarta-james/src/xdocs/weare.xml
  
  Index: weare.xml
  ===
  RCS file: /home/cvs/jakarta-james/src/xdocs/weare.xml,v
  retrieving revision 1.12.4.8
  retrieving revision 1.12.4.9
  diff -u -r1.12.4.8 -r1.12.4.9
  --- weare.xml 27 May 2003 06:27:12 -  1.12.4.8
  +++ weare.xml 5 Jun 2003 22:33:34 -   1.12.4.9
  @@ -55,6 +55,7 @@
   Cesar Bonadio (bonadio at picture.com.br) [CB3]
   Marco Tedone (mtedone at jemos.org) [MT]
   Tim Stephenson (tim at thestephensons.me.uk) [TS]
  +Richard O. Hammer (rohammer at earthlink.net) [ROH]
   
   
   
  
  
  

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



cvs commit: jakarta-james/src/xdocs smtp_configuration_2_1.xml

2003-06-06 Thread noel
noel2003/06/05 15:33:17

  Modified:src/xdocs Tag: branch_2_1_fcs smtp_configuration_2_1.xml
  Log:
  Fixed  description
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.3.4.1   +1 -1  jakarta-james/src/xdocs/smtp_configuration_2_1.xml
  
  Index: smtp_configuration_2_1.xml
  ===
  RCS file: /home/cvs/jakarta-james/src/xdocs/smtp_configuration_2_1.xml,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- smtp_configuration_2_1.xml7 Dec 2002 20:38:20 -   1.3
  +++ smtp_configuration_2_1.xml5 Jun 2003 22:33:17 -   1.3.4.1
  @@ -43,7 +43,7 @@
   if SMTP authentication is required.  If the parameter is set to true then the 
sender address for the submitted message
   will be verified against the authenticated subject.
   maxmessagesize - This is an optional tag with a non-negative 
integer body.  It specifies the maximum 
  -size, in bytes, of any message that will be transmitted by this SMTP server.  It is 
a service-wide, as opposed to 
  +size, in kbytes, of any message that will be transmitted by this SMTP server.  It 
is a service-wide, as opposed to 
   a per user, limit.  If the value is zero then there is no limit.  If the tag isn't 
specified, the service will
   default to an unlimited message size.
   
  
  
  

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



RE: james docs wrong?

2003-06-06 Thread Noel J. Bergman
Docs are clearly wrong:

maxMessageSize = handlerConfiguration.getChild(
"maxmessagesize" ).getValueAsLong( maxMessageSize ) * 1024;

I have had the max message size set to 3072 on my server.

--- Noel

> -Original Message-
> From: Adam Neilson [mailto:[EMAIL PROTECTED]
> Sent: 05 June 2003 15:17
> To: Danny Angus
> Subject: james docs wrong?
>
>
> james smtp documentation states:
>
> "maxmessagesize - This is an optional tag with a non-negative integer
> body.  It specifies the maximum  size, in bytes, of any message that
> will be transmitted by this SMTP server.  It is a service-wide, as
> opposed to  a per user, limit.  If the value is zero then there is no
> limit.  If the tag isn't specified, the service will default to an
> unlimited message size"
>
> so i set the max size to 12582900 (for 12 meg)
>
> but when starting james, the smtp log says:
>
> 05/06/03 15:10:02 INFO  smtpserver: The maximum allowed message size is
> 12884889600 bytes which is 12 gig!
>
> should the doc say KB instead?
>


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



RE: Logging in the new DNSServer service

2003-06-06 Thread Chris Means
Yes, I am getting email message from apache.org.

> -Original Message-
> From: Harmeet Bedi [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 06, 2003 10:20 AM
> To: James Developers List; [EMAIL PROTECTED]
> Subject: Re: Logging in the new DNSServer service
> 
> 
> You said eariler.
> > So suddenly, I'm worried that mail from apache.org isn't getting
> through...
> 
> And in last mail
> > The ERROR entries in the DNS log were for messages comming to 
> me, not ones
> > from me.
> 
> Question : Are you getting messages from apache.org or not ?
> 
> 
> FYI: It does look like the error log entries would at least be 
> for outgoing
> messages. Are you sure you are getting log entries for only incoming
> messages.
> 
> Harmeet
> 
> 


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



Re: Logging in the new DNSServer service

2003-06-06 Thread Harmeet Bedi
You said eariler.
> So suddenly, I'm worried that mail from apache.org isn't getting
through...

And in last mail
> The ERROR entries in the DNS log were for messages comming to me, not ones
> from me.

Question : Are you getting messages from apache.org or not ?


FYI: It does look like the error log entries would at least be for outgoing
messages. Are you sure you are getting log entries for only incoming
messages.

Harmeet


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



FW: james docs wrong?

2003-06-06 Thread Danny Angus


> -Original Message-
> From: Adam Neilson [mailto:[EMAIL PROTECTED]
> Sent: 05 June 2003 15:17
> To: Danny Angus
> Subject: james docs wrong?
> 
> 
> james smtp documentation states:
> 
> "maxmessagesize - This is an optional tag with a non-negative integer 
> body.  It specifies the maximum  size, in bytes, of any message that 
> will be transmitted by this SMTP server.  It is a service-wide, as 
> opposed to  a per user, limit.  If the value is zero then there is no 
> limit.  If the tag isn't specified, the service will default to an 
> unlimited message size"
> 
> so i set the max size to 12582900 (for 12 meg)
> 
> but when starting james, the smtp log says:
> 
> 05/06/03 15:10:02 INFO  smtpserver: The maximum allowed message size is 
> 12884889600 bytes which is 12 gig!
> 
> should the doc say KB instead?
> 

RE: Logging in the new DNSServer service

2003-06-06 Thread Chris Means
Harmeet,

> Chris, I expect your email would be going to apache.org. Log Error message
> is a bit misleading.

I'm not sure what you mean here.

The ERROR entries in the DNS log were for messages comming to me, not ones
from me.



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



Re: Logging in the new DNSServer service

2003-06-06 Thread Harmeet Bedi
- Original Message -
From: "Serge Knystautas" <[EMAIL PROTECTED]>
> I'm not sure what's getting logged right now, but here's what I might
> expect at each level:
>
> INFO: no MX records

This seems to be ERROR log level.



From: "Harmeet Bedi" <[EMAIL PROTECTED]>
> We could do something like attached snippet inside
DNSServer::findMXRecords.

I take this back. Adding A record is already there in finally clause of
findMXRecords, missed it.



From: "Chris Means" <[EMAIL PROTECTED]>
> So suddenly, I'm worried that mail from apache.org isn't getting
through...

Chris, I expect your email would be going to apache.org. Log Error message
is a bit misleading.


Harmeet


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



Re: Logging in the new DNSServer service

2003-06-06 Thread Serge Knystautas
Harmeet Bedi wrote:
- Original Message -
From: "Chris Means" <[EMAIL PROTECTED]>
So suddenly, I'm worried that mail from apache.org isn't getting
through...

If there is no MX record, A record represents mail host. It is not an error
to have no MX Records and neither is it necessary to recieve mail.
We could do something like attached snippet inside DNSServer::findMXRecords.
We should also change the logging to say INFO or WARN if not DEBUG for the
above message.
I'm not sure what's getting logged right now, but here's what I might 
expect at each level:

DEBUG: all lookups
INFO: no MX records
WARN: ?
ERROR: DNS server not responding
--
Serge Knystautas
President
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]


Re: Logging in the new DNSServer service

2003-06-06 Thread Harmeet Bedi
- Original Message -
From: "Chris Means" <[EMAIL PROTECTED]>
> 06/06/03 04:05:44 ERROR dnsserver: Couldn't resolve MX records for domain
> jakarta.apache.org.

> So suddenly, I'm worried that mail from apache.org isn't getting
through...

If there is no MX record, A record represents mail host. It is not an error
to have no MX Records and neither is it necessary to recieve mail.

We could do something like attached snippet inside DNSServer::findMXRecords.
We should also change the logging to say INFO or WARN if not DEBUG for the
above message.

---
String domainToSendMailTo = 
Collection collection =   // get mx record from DNSServer.
if ( collection.size() == 0 ) {
try {
InetAddress.getByName(hostname);
} catch (UnknownHostException ex) {
// there is no A record.
 collection.add(hostname);
}
 }

// use  to send mail
---

thoughts ?
Harmeet


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



DO NOT REPLY [Bug 18028] - Redirect mailet mishandles message.getContent()

2003-06-06 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18028

Redirect mailet mishandles message.getContent()

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|RESOLVED|VERIFIED

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



RE: Logging in the new DNSServer service

2003-06-06 Thread Chris Means
I just installed James 2.2.0a3 early this morning, everything looks like
it's working fine.

Then this morning I saw this in the DNSserver log:

06/06/03 01:48:23 INFO  dnsserver: Autodiscovery is enabled - trying to
discover your system's DNS Servers
06/06/03 01:48:24 INFO  dnsserver: Adding autodiscovered server 64.81.159.2
06/06/03 01:48:24 INFO  dnsserver: Adding autodiscovered server 216.231.41.2
06/06/03 01:48:24 INFO  dnsserver: DNS Server is: 64.81.159.2
06/06/03 01:48:24 INFO  dnsserver: DNS Server is: 216.231.41.2
06/06/03 01:48:24 INFO  dnsserver: DNS Server is: 64.81.159.2
06/06/03 01:48:24 INFO  dnsserver: DNS Server is: 216.231.41.2
06/06/03 04:05:44 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 04:17:30 ERROR dnsserver: Couldn't resolve MX records for domain
ws.apache.org.
06/06/03 04:47:31 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 04:52:09 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 05:07:05 ERROR dnsserver: Couldn't resolve MX records for domain
galamail.com.
06/06/03 05:17:50 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 05:35:14 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 05:46:09 ERROR dnsserver: Couldn't resolve MX records for domain
ws.apache.org.
06/06/03 05:49:12 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 06:06:08 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 06:17:35 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 06:20:42 ERROR dnsserver: Couldn't resolve MX records for domain
moh006.offershouse.com.
06/06/03 06:25:08 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 06:29:30 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 07:04:42 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 07:22:13 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 07:40:28 ERROR dnsserver: Couldn't resolve MX records for domain
jakarta.apache.org.
06/06/03 08:00:51 ERROR dnsserver: Couldn't resolve MX records for domain
ws.apache.org.


So suddenly, I'm worried that mail from apache.org isn't getting through...

Yes, if things are still working...please don't even bother mentioning it
 I don't even see the point of this being an INFO entry if there are no
actual problems/issues that need to be known about.

Thanks.

-Chris

> -Original Message-
> From: Noel J. Bergman [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 06, 2003 12:42 AM
> To: James-Dev Mailing List
> Subject: Logging in the new DNSServer service
>
>
> The new DNS service contains the following:
>
>   //If we found no results, we'll add the original domain name if
>   //it's a valid DNS entry
>   if (servers.size () == 0) {
>StringBuffer logBuffer =
>new StringBuffer(128)
>.append("Couldn't resolve MX records for domain ")
>.append(hostname)
>.append(".");
>getLogger().error(logBuffer.toString());
>try {
>InetAddress.getByName(hostname);
>servers.add(hostname);
>} catch (UnknownHostException uhe) { ... }
>
> I am thinking that should be at INFO level, not ERROR level.  Anyone
> disagree?  For example, we get that message for e-mail coming
> from the ASF,
> because there aren't any MX records.  The code goes ahead and
> does the right
> thing, using the A record.
>
>   --- Noel
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Bug 18471 missing attributes on mail

2003-06-06 Thread Soeren Hilmer
Hi,

Just started working on the changes for the JdbcMailRepository (I hope late is 
better than never), and I came accross the following in SqlResources.java

public String getSqlString(String name, boolean required)
{
String sql = getSqlString(name);
if ( sql == null ) {
StringBuffer exceptionBuffer =
new StringBuffer(64)
.append("Required SQL resource: '")
.append(name)
.append("' was not found.");
throw new RuntimeException(exceptionBuffer.toString());
}
return sql;
}
   

Note, that the required parameter is never checked.
Now as I would like to call this with required=false, I will change it to the 
obvious correct code. 
The question is now, does this qualify as a separate patch, or can it be 
bundled with the patch for JdbcMailRepository?

Also in the same line, I have proposed a set of matchers/mailets which 
operates on mail attributes. I guess they would be preferred in a separate 
patch, but is a patch preferred for each mailet/matcher or will it be 
preferred to submit them in one patch.

Regards
   Søren
-- 
Søren Hilmer, M.Sc.
R&D manager Phone:  +45 70 27 64 00
TietoEnator IT+ A/S Fax:+45 70 27 64 40
Ved Lunden 12   Direct: +45 87 46 64 57
DK-8230 Åbyhøj  Email:  [EMAIL PROTECTED]


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



RE: how hard is it to write a SMTP client?

2003-06-06 Thread Frank Herrmann
Richard and Noel,

--- "Noel J. Bergman" <[EMAIL PROTECTED]> wrote:
> Richard,
> With respect to writing your own SMTP client, it is
> simple for simple cases,
> but the totality of SMTP isn't simple.

Considering these facts about 1/2 year ago I chose
James as an implementation basis for a very similiar
project and found James very suitable. (which is a
reliable solution capable of all those nice exception
cases which I could never program myself) BTW. thanks
to all james developers!

> 
> However, I don't see why you can't use James for
> your application.  What you
> are proposing seems like a fairly straightforward
> custom application of

Understanding concepts of James ate up almost half of 
development time. :-)

> James.  From what I read on your site, and from your
> post, it is essentially
> a variation on a TMDA (www.tmda.net/) scheme, but
> requiring payment rather
> than authentication.
> 

The challenge-response-payment idea was IMHO first
discussed in "Pricing via processing" (Cynthia Dwork,
Moni Naor, 1991). 

You can find the paper here:

http://www.wisdom.weizmann.ac.il/~naor/onpub.html

TMDA is one implementation of that idea. At the moment
the "beloved" company Microsoft is heavily researching
in this field.

URL:

http://research.microsoft.com/research/sv/PennyBlack/

However, my guess is next version of windows will
contain this feature.

Greetings,
Frank


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



Re: [VOTE] New Committer, Mr. Vincenzo Gianferrari Pini

2003-06-06 Thread Serge Knystautas
Noel J. Bergman wrote:
> I did propose him.  Harmeet and Danny both wanted to vote.  You commented
> that I was being too nice by proposing first, so I posted it as a vote as
> you appeared to have requested.
Noel,

I'm sorry.  I must not be sleeping or something.  Here's what I think 
happened:

You did (effectively) propose Vincenzo, but I was looking for:
a) calling it a nomination.
b) a call for a vote.
So your email didn't set a flag off in me, and I didn't realize this 
from yesterday as the source of the confusion until just now.

In light of the confusion, let's start counting 48 hours as of your 
message today at 12:57:13 -0400 that mentions a call to vote.  With my 
+1, you've got 4 +1 and a passing nomination assuming nobody vetoes in 
the next 46 hours.

--
Serge Knystautas
President
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]


RE: Axis mailet / matcher

2003-06-06 Thread Noel J. Bergman
Guys,

This discussion is all good, but please review the archives:

http://archives.apache.org/eyebrowse/SearchList?listId=&listName=james-user@
jakarta.apache.org&searchText=soap&defaultField=body&Search=Search

Also, Jason Webb indicated interest in this area:
http://archives.apache.org/eyebrowse/[EMAIL PROTECTED]
he.org&msgId=589966

I would sugggest the SOAP over SMTP approach.  We don't want to be a
web-server, and the asynchronous properties of messaging protocols
differentiate them from HTTP.

I don't know if SOAP is best handled by a mailet or a processor, e.g.,

   
  SoapDispatch 
   

   
 ...
   

A mailet is portable, but more limited.  On the other hand, are those
limitations reasonable in the case of a SOAP Dispatcher?  A mailet can load
a class, marshall parameters, and invoke methods.  That may be sufficient.
The place where I think using a processor might work better is for something
like Sieve and possibly BSF.

Just thinking out loud ... I'd be happy to see people contribute a SOAP
support to James.

--- Noel

-Original Message-
From: Mark Imel [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 10:28
To: James Developers List
Subject: RE: Axis mailet / matcher


As far as James & SOAP:
I can think of two types of use cases for integrating James & Soap:
1) Exposing administrative functions of James
2) Exposing other applications via a SOAP over SMTP protocol.

Both of these are really, really cool.
What i like about #1 is that right now the telnet manager is the only
admistrative interface into James, not counting editing the config file.
(Hopefully JMX will be coming along soon as well.) But with a SOAP
interface, then the James doesn't have to invest any/much time in an
administrative interface.  With some RAD soap tools, you can quickly come up
with a UI.  There's still an investment in ensuring that the adminstrative
apis exist and work, but not the required GUI work.

Secondly, exposing other applications via SOAP over SMTP can be even cooler.
Since James is already deployed inside of Avalon, there's support for
application management that James wouldn't have to come up with on its own.
I think even more importantly, is the opprotunity to archive/audit SOAP
requests very naturally.

Moving forward with all/either SOAP/RMI/JMX, there's one thing that i would
recommend:  Make sure you're administrative apis are protocol independent.
That way you can plugin in adapaters and support any/all of the above
protocols.

-Original Message-
From: Vincenzo Gianferrari Pini
[mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 5:40 AM
To: James Developers List
Subject: RE: Axis mailet / matcher


Tim,

Just yesterday evening I started asking myself (dreaming) about that, and
downloaded a fresh copy of axis to have a look!

I think (dream) that there are two independent possibilities:

1) Have James deploy web services to respond to administrative requests
(whatever they may be) using SOAP over HTTP: I think that RMI support would
be enough and better, and much easier to implement.

2) Have James become a "native" SOAP over SMTP server, both (i) to respond
to administrative requests (mailets could be reconfigured runtime with
messages - something that can obviously be done also with plain messages,
but a protocol could be defined), and (ii) to deploy generic asynchronous
web service *applications*: a grand new world, and probably very unique
being James also a "general purpose" mail server. But this would be probably
a big project.
Unfortunately Axis seems to not have any SMTP support. There exists an
SMTP/HTTP bridge with Apache SOAP deployed on Tomcat
(http://ws.apache.org/soap/faq/faq_chawke_smtp.html), but I have just
started digging around, and know very little about.

IMHO option 2-ii above is ambitious but exciting too! And totaly independent
of option (1), that as I said I would attack, if interesting, using RMI.

Has anyone else ever thought about those topics?

Vincenzo

> -Original Message-
> From: Tim Stephenson [mailto:[EMAIL PROTECTED]
> Sent: giovedì 5 giugno 2003 13.49
> To: James Developers List
> Subject: Axis mailet / matcher
>
>
> hi
>
> anyone done anything to allow james to integrate an axis (or other soap)
> engine?
>
> any suggestions for how it should be done?
>
> cheers, tim
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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


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


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

RE: [VOTE] New Committer, Mr. Vincenzo Gianferrari Pini

2003-06-06 Thread Noel J. Bergman
> I must reset your expectations on this.  The procedure is this:
> 1. An existing committer nominates a contributor, or the contributor can
>ask for it themselves.

I did propose him.  Harmeet and Danny both wanted to vote.  You commented
that I was being too nice by proposing first, so I posted it as a vote as
you appeared to have requested.

> 2. Once nominated, all committers on the subproject will vote.  You need
>at least 3 positive votes and no negative votes.  Typically we give
>48-72 for everyone to vote if they're going to.

Right ... I didn't understand it any other way.  I simply indicated that I
expected the vote to carry.

> 3. If approved, we get them an account (if not already) and otherwise
>set them up as a committer.

As you said, first we vote.

> If you want to nominate Vincenzo, then great, we can have can start this
> process and take a vote.

I had done so.  At least I understood myself to have done so.

--- Noel


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



RE: [VOTE] New Committer, Mr. Vincenzo Gianferrari Pini

2003-06-06 Thread Danny Angus
I think the only problem was that harmeet & I jumped the gun and expressed our opinion 
with +1's

d.

> -Original Message-
> From: Serge Knystautas [mailto:[EMAIL PROTECTED]
> Sent: 05 June 2003 19:03
> To: James Developers List
> Subject: Re: [VOTE] New Committer, Mr. Vincenzo Gianferrari Pini
> 
> 
> Noel J. Bergman wrote:
>  > I did propose him.  Harmeet and Danny both wanted to vote.  
> You commented
>  > that I was being too nice by proposing first, so I posted it 
> as a vote as
>  > you appeared to have requested.
> 
> Noel,
> 
> I'm sorry.  I must not be sleeping or something.  Here's what I think 
> happened:
> 
> You did (effectively) propose Vincenzo, but I was looking for:
> a) calling it a nomination.
> b) a call for a vote.
> 
> So your email didn't set a flag off in me, and I didn't realize this 
> from yesterday as the source of the confusion until just now.
> 
> In light of the confusion, let's start counting 48 hours as of your 
> message today at 12:57:13 -0400 that mentions a call to vote.  With my 
> +1, you've got 4 +1 and a passing nomination assuming nobody vetoes in 
> the next 46 hours.
> 
> -- 
> Serge Knystautas
> President
> 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]
> 

Re: [VOTE] New Committer, Mr. Vincenzo Gianferrari Pini

2003-06-06 Thread Serge Knystautas
Noel J. Bergman wrote:
Moving ahead to the one-step process version ... :-)  So far we have:

Harmeet Bedi:+1
Danny Angus: +1
Noel J. Bergman: +1
I expect Serge will post an official +1, too.  I can't speak for Darrell,
Charles, Peter, et al, who haven't been around too much lately, but the
measure will carry unless someone vetoes, which I don't expect.
Noel,

I must reset your expectations on this.  The procedure is this:

1. An existing committer nominates a contributor, or the contributor can 
ask for it themselves.
2. Once nominated, all committers on the subproject will vote.  You need 
at least 3 positive votes and no negative votes.  Typically we give 
48-72 for everyone to vote if they're going to.
3. If approved, we get them an account (if not already) and otherwise 
set them up as a committer.

Right now we're at step 0, or rather, on some unofficial path that 
should be stopped in the interest of avoiding confusion.

If you want to nominate Vincenzo, then great, we can have can start this 
process and take a vote.

--
Serge Knystautas
President
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]


RE: [PATCH] 550 handling (WAS multiple gateways possible?)

2003-06-06 Thread Noel J. Bergman
Tim,

Have you tested it?

--- Noel

-Original Message-
From: Tim Stephenson [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 8:51
To: James Developers List
Subject: [PATCH] 550 handling (WAS multiple gateways possible?)


this patch still avoids reporting a perm error until all servers have been
tried UNLESS a partial send occurs in which case the error is processed as
previously


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



RE: channels in James?

2003-06-06 Thread Noel J. Bergman
Richard,

java.nio is certainly in the plans for James v3 (or later).  I've sketched
out what it will take.  Basically it involves completing an inversion inside
the handlers.  Each time data arrives, a dispatcher figures out for whom the
data is for, and dispatches it.  Switching over to 100% push processing,
instead of pull processing, is the key to java.nio.

I've devised a scheme were depending upon the state a Handler is in, a
Method is registered for handling the data.  In the command state, that
Method aggregates data until CRLF, then dispatches to the correct handling
method.  In the data state, the registered Method (a different one), keeps
feeding the data into a new method that will replace the pull-processing
inside of methods like doDATA.  The handler state has to be encapsulated in
its instance data.  The current code is not too bad, in terms of what it
will take to finish inverting it.  Most of the code is ready, but the
remaining portion epitomizes the 80%/20% rule.  :-)

It should be understood that java.nio is about the number of connections,
not about performance (although there are performance benefits).  Also,
java.nio doesn't support SSL.  I believe that Mark expects to support SSL in
Java 1.5.

So far we haven't had that much demand.  I say that based upon the fact that
we've had only one user raise the issue related to thread exhaustion, which
is controlled in v2.2.0aX.  So, as Serge says, this is not a high priority
right now, although I do believe that we'll want to deal with it in the
James v3 timeframe.

> 1) that blocked I/O operations on server Sockets can be interrupted
>gracefully

> 2) built in multi threading of connections

Not quite "built-in".  Yes, it is built-in, but that is because of how you
have to use it, not because they provide something for free.

> 3) fancy buffering, somehow more efficient for large traffic

Yes, nio provides much better buffering controls.

--- Noel


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



[VOTE] New Committer, Mr. Vincenzo Gianferrari Pini

2003-06-06 Thread Noel J. Bergman
Moving ahead to the one-step process version ... :-)  So far we have:

Harmeet Bedi:+1
Danny Angus: +1
Noel J. Bergman: +1

I expect Serge will post an official +1, too.  I can't speak for Darrell,
Charles, Peter, et al, who haven't been around too much lately, but the
measure will carry unless someone vetoes, which I don't expect.

--- Noel


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



Re: Axis mailet / matcher

2003-06-06 Thread Tim Stephenson
Vincenzo,

I had not worried about your option 1) for the time being as administative
requests can be configured prior to runtime - obviously this requires server
restart and is less than ideal so it would be great to have a means to do it
dynamically, but it is good enough for a few experiments. I had rather
assumed the obvious option would be to get your option 2 (i) in place and
then configure the server using a web service call.

2(ii) is really what i was looking into - I too believe it would be
incredibly powerful to have such loosely coupled processes requiring nothing
more than email access.

My first thought was simply to have a matcher to identify incoming messages
either by their address or because they contain a soap envelope (content
type seems to be unreliable since the client controls it, though
'application/soap+xml' may be used at some point). The mailet could then
handle them by simply handing off to an Axis engine. This much I have
trialed using the classes in org.apache.axis.transport.mail (basically the
commons-net pop3/smtp clients). This could simply be wrapped as a mailet.

Some questions before I get too carried away!

how should axis engine be started? i dont know avalon at all should it be
another app or would it be better off inside james 'proper'. What hooks
exist for starting the engine this way - is it simply a question of the
mailet holding an engine reference or is there a better option?

i look forward to all your views.

tim

BTW I have not looked into the SOAP2HTTP bridge at all but it seems to me
that Axis has moved beyond the SOAP project in this as in other areas. Axis
has a core engine that is abstracted from the transport. The current axis
mail transport class reads email in a specified mailbox after it is
delivered which is reasonable for supporting arbitrary mail servers, but
James could integrate it much more tightly avoiding the need for polling.


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



Re: channels in James?

2003-06-06 Thread Serge Knystautas
Richard O. Hammer wrote:
What is the status of the possibility of using java.nio.channels in James?

I have started to read about this package.  It looks like it might have 
benefits for James or a project like James.  In particular it seems to 
promise:
1) that blocked I/O operations on server Sockets can be interrupted 
gracefully
2) built in multi threading of connections
3) fancy buffering, somehow more efficient for large traffic

But I bet some people on this list have already studied it more than I, 
and formed valuable opinions.  I'd like to learn those opinions.
java.nio has very little use unless you have an application where 
connections are kept open but data isn't being sent.  HTTP, SMTP, and 
most common Internet protocols don't get much if any benefit from it. 
The biggest class of applications to benefit from java.nio is chat/IM 
where you have little data transfer and lots of open connections.

It would require a lot of rework to have the protocol handlers adjust to 
this, and this would only address the incoming connections, not the 
outgoing ones.  We use standard libs for the outgoing ones, so we'd have 
to start at ground zero with those.

Basically, it's not worth it... just a technology that was overhyped 
(something related to Java was overhyped?  impossible!) ;)

--
Serge Knystautas
President
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]


channels in James?

2003-06-06 Thread Richard O. Hammer
What is the status of the possibility of using java.nio.channels in James?

I have started to read about this package.  It looks like it might 
have benefits for James or a project like James.  In particular it 
seems to promise:
1) that blocked I/O operations on server Sockets can be interrupted 
gracefully
2) built in multi threading of connections
3) fancy buffering, somehow more efficient for large traffic

But I bet some people on this list have already studied it more than 
I, and formed valuable opinions.  I'd like to learn those opinions.

Thank you,
Rich Hammer
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Axis mailet / matcher

2003-06-06 Thread Mark Imel
As far as James & SOAP:
I can think of two types of use cases for integrating James & Soap:
1) Exposing administrative functions of James
2) Exposing other applications via a SOAP over SMTP protocol.

Both of these are really, really cool.
What i like about #1 is that right now the telnet manager is the only
admistrative interface into James, not counting editing the config file.
(Hopefully JMX will be coming along soon as well.) But with a SOAP
interface, then the James doesn't have to invest any/much time in an
administrative interface.  With some RAD soap tools, you can quickly come up
with a UI.  There's still an investment in ensuring that the adminstrative
apis exist and work, but not the required GUI work.

Secondly, exposing other applications via SOAP over SMTP can be even cooler.
Since James is already deployed inside of Avalon, there's support for
application management that James wouldn't have to come up with on its own.
I think even more importantly, is the opprotunity to archive/audit SOAP
requests very naturally.

Moving forward with all/either SOAP/RMI/JMX, there's one thing that i would
recommend:  Make sure you're administrative apis are protocol independent.
That way you can plugin in adapaters and support any/all of the above
protocols.

-Original Message-
From: Vincenzo Gianferrari Pini
[mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 5:40 AM
To: James Developers List
Subject: RE: Axis mailet / matcher


Tim,

Just yesterday evening I started asking myself (dreaming) about that, and
downloaded a fresh copy of axis to have a look!

I think (dream) that there are two independent possibilities:

1) Have James deploy web services to respond to administrative requests
(whatever they may be) using SOAP over HTTP: I think that RMI support would
be enough and better, and much easier to implement.

2) Have James become a "native" SOAP over SMTP server, both (i) to respond
to administrative requests (mailets could be reconfigured runtime with
messages - something that can obviously be done also with plain messages,
but a protocol could be defined), and (ii) to deploy generic asynchronous
web service *applications*: a grand new world, and probably very unique
being James also a "general purpose" mail server. But this would be probably
a big project.
Unfortunately Axis seems to not have any SMTP support. There exists an
SMTP/HTTP bridge with Apache SOAP deployed on Tomcat
(http://ws.apache.org/soap/faq/faq_chawke_smtp.html), but I have just
started digging around, and know very little about.

IMHO option 2-ii above is ambitious but exciting too! And totaly independent
of option (1), that as I said I would attack, if interesting, using RMI.

Has anyone else ever thought about those topics?

Vincenzo

> -Original Message-
> From: Tim Stephenson [mailto:[EMAIL PROTECTED]
> Sent: giovedì 5 giugno 2003 13.49
> To: James Developers List
> Subject: Axis mailet / matcher
>
>
> hi
>
> anyone done anything to allow james to integrate an axis (or other soap)
> engine?
>
> any suggestions for how it should be done?
>
> cheers, tim
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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


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