Serge Knystautas wrote:
> 
> I've added a very simple servlet that returns the current time on the
> server, back to the sender.  Shows how to create a very simple response
> type message.  Possibly some of the code in this could be added to the
> Mail object as a "respond()" method so it's easier to write this kind of
> servlet (see for yourself... the code isn't complicated, but is a little
> ugly).

It doesn't seems very ugly to me... anyway I agree with you: MimeMessage
reply() sucks and so I'd like to see a reply() method in the Mail object
being a bit more juicy. 
+1 

> 
> Also, I looked in JamesSpoolManager, and it seems we don't conveniently
> support using servlets from multiple packages.  For instance, most of my
> servlets might be in the default org.apache.james.transport.servlet
> package, but a particular listserv I write might pull it's member list
> from an internal relational database, so I would want to put that in a
> com.lokitech.something package.  I thought about supporting multiple
> servlets rootpath="...", but the order of servlets is significant, so
> this doesn't seem to work.  Is the rootpath really helping things that
> much?  I think anybody using this beyond initial testing will want to
> write their own servlets and end up removing the rootpath prefix.
> What's even worse is that if I altogether remove the rootpath attribute,
> JAMES crashes upon startup.  Should we move to an aliasing approach
> where we define what classes map to what names and parameters, and then
> use aliases as we're defining routing information.  As we start adding
> numerous servlets to a mail server, it might be nice to keep servlet
> configuration and ordering/matching separate.  Any opinions?

I knew of this limitation but I was thinking to a more generic
"repository" model.
you define as many repositoryes as you wish:
<repositroy name="system"> org.apache.james.servlets</repository>
<repositroy name="myservlets"> com.mycompany.mypackage</repository>
...

and then access them like: 
<servlet match="All" class="system.ToRepository">
<servlet match="All" class="myservlets.MyServlet">
...

Right now an ugly turn around is to set rootpath="" and call servlets
like:
<servlet match="All" class="com.mycompany.mypackage.MyServlet">

I agree that's sound really dirt so... 

<
> 
> One final note... I realized with the advent of these response servlets,
> we'll need to develop the ability to block a clever DOS... This servlet
> finds the sender and generates a message back to that sender.  If I had
> sneakly done MAIL FROM: <time@localhost>, RCPT TO: <time@localhost>, the
> message would repeatedly deliver back on itself I suspect.  Not sure the
> best way to prevent this...

There are many and many situations where a loop can be generated:
let's say I'm going to holydays ans a set my "ImOnVacation" servlet to
reply any message saying I'll be back next week. Just before leaving I
send a message to a friend which is going on holydays too and has set up
the same servlet. The message will continue bouncing from my servlet to
his...

This is pretty nasty since it's not a bug the administrator can handle. 

I think it should be up to the servlet to be smart enought to avaid such
loops, checking the recipient to be different from the sender or not to
send the "ImOnVacation" message more than once to the same address. 

Not sure of it... I'll think a bit more...

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


Federico


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

Reply via email to