I've applied my patch to the CVS tree to add Mail.getRemoteAddr (ip) and
Mail.getRemoteHost (host name), and the necessary changes to other parts
(MailServer most notably) because of this.  I'm not sure about the
change to MailServer... I exposed getId and sendMail(Mail) rather than
create a 5 argument sendMail.  I'm not sure the best way to do this, so
Federico could give his opinion on how he wants this to work in the
avalon framework.

I also added some header checking, so it sets From and Date headers.  It
also adds the long Received header line for JAMES part of the relay,
e.g., 

Received: from localhost ([127.0.0.1])
          by glissando (JAMES SMTP Server 1.0b4) with SMTP ID 466
          for <[EMAIL PROTECTED]>;
          Thu, 15 Jun 2000 11:27:53 -0500

And with the new CharTerminatedInputStream, no more "."s!!!  However, I
found a very strange bug during some of my testing... I created a sample
input file when connecting to the SMTP server that looked like this...

MAIL FROM: <[EMAIL PROTECTED]>
RCPT TO: <[EMAIL PROTECTED]>
DATA
Subject: Testing

This is a test you realize?
.
MAIL FROM: <[EMAIL PROTECTED]>
RCPT TO: <[EMAIL PROTECTED]>
DATA
Subject: Testing

This is a test you realize?
.
QUIT

I was trying to test that state was reset properly with my new fields in
the SMTPHandler.  Well, if I do this line by line, it works just fine. 
But, if you send all of this at once, the stream gets majorly confused. 
I'm not sure what exactly the problem is... I did this several times and
was actually getting the headers (the ones generated by JAMES!!!) in the
message body of one of the other servers.  I'm not sure if it's a
multithreaded problem with the MailRepository, or if the
CharTerminatedInputStream was having trouble.  Since the
CharTerminatedInputStream is the most recent change, I'd suspect it's
not properly sending an EOF when there is still more data, even if it
has reached the terminator.  Anyway, very weird stream behavior... maybe
you can test it out.  I didn't see the latest CharTerminatedInputStream
commited to the framework CVS project, so I couldn't take a look at the
new code.

Once you change the Matcher API (assuming you are), we can write the
simple matchers for IP address or host name.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/>
Problems?:           [EMAIL PROTECTED]

Reply via email to