You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Oki DZ <ok...@pindad.com> on 2001/09/04 11:27:22 UTC
Mailets
Hi,
I've been fiddling around with mailets for a while, and I get some of them
working. I'm interested in having a mailet that can do simple attachment
file names detection, so that any mail which has some dubious names in the
attachment could be sent back to the senders.
BTW, I'm trying to set James to have two remote delivery mailets; one is
for messages destined to the Internet, and another to an email server
in inside network (both in two different mail processors). But I don't
think that I could get the setup working.
TIA,
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
RE: Mailets
Posted by Oki DZ <ok...@pindad.com>.
On Wed, 26 Sep 2001, Danny Angus wrote:
> Is there a noticable performance hit from using regex in the mailets?
Well, my site serves no more than 200 email users, so I don't think I can
measure the performance hit. But I believe that the ORO matcher is pretty
fast. (FYI, the regex is not in the mailets, but in the matchers.)
> I know we avoided regex in a high demand situation some wee while ago
> because of the overhead, if this is the case here can I suggest we use the
> non-regex versions by default and specify FQN's for the regex version?
I think having o.a.j.transport.matchers.regex would be better; as
suggested by Serge. So that James can be configured using non-regex
matchers, but the regex ones can still be used by using their FQN's.
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
RE: Mailets
Posted by Danny Angus <da...@thought.co.uk>.
Is there a noticable performance hit from using regex in the mailets?
I know we avoided regex in a high demand situation some wee while ago
because of the overhead, if this is the case here can I suggest we use the
non-regex versions by default and specify FQN's for the regex version?
Or have I missed the point completely..!
d.
-----Original Message-----
From: Serge Knystautas [mailto:sergek@lokitech.com]
Sent: 26 September 2001 12:16
To: james-dev@jakarta.apache.org
Subject: Re: Mailets
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
> On Tue, 25 Sep 2001, Serge Knystautas wrote:
> > Actually, I think I have a better idea than renaming all the classes...
why
> > not put them into the org.apache.james.transport.matchers.regex package?
We
> > can move the non-regex ones to a "text" or something... then we can
leave
> > the import as text by default, and if the admin wants to use regex,
he/she
> > can change the import. Comments?
>
> This would be better.
> Problem is, what if the admin wants to use both kinds? Would it be
> possible to have FQNs in the match or class attribute of a mailet config?
Yes, FQN's are allowed (if not, this is a bug I'll fix).
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Serge Knystautas <se...@lokitech.com>.
I like this, or rather, let it support either having a dot or not.
Actually, I just checked, and it already does this. :)
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
To: <ja...@jakarta.apache.org>
Sent: Wednesday, September 26, 2001 11:45 PM
Subject: Re: Mailets
> On Wed, 26 Sep 2001, Serge Knystautas wrote:
> > Yes, FQN's are allowed (if not, this is a bug I'll fix).
>
> I havent' tried it.
> BTW, could the trailing dot in the following entry be removed?
> <mailetpackages>
> <mailetpackage>org.apache.james.transport.mailets.</mailetpackage>
> </mailetpackages>
>
> I just think that it would be nicer without the dot.
>
> Oki
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Oki DZ <ok...@pindad.com>.
On Wed, 26 Sep 2001, Serge Knystautas wrote:
> Yes, FQN's are allowed (if not, this is a bug I'll fix).
I havent' tried it.
BTW, could the trailing dot in the following entry be removed?
<mailetpackages>
<mailetpackage>org.apache.james.transport.mailets.</mailetpackage>
</mailetpackages>
I just think that it would be nicer without the dot.
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Serge Knystautas <se...@lokitech.com>.
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
> On Tue, 25 Sep 2001, Serge Knystautas wrote:
> > Actually, I think I have a better idea than renaming all the classes...
why
> > not put them into the org.apache.james.transport.matchers.regex package?
We
> > can move the non-regex ones to a "text" or something... then we can
leave
> > the import as text by default, and if the admin wants to use regex,
he/she
> > can change the import. Comments?
>
> This would be better.
> Problem is, what if the admin wants to use both kinds? Would it be
> possible to have FQNs in the match or class attribute of a mailet config?
Yes, FQN's are allowed (if not, this is a bug I'll fix).
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Oki DZ <ok...@pindad.com>.
On Tue, 25 Sep 2001, Serge Knystautas wrote:
> Glad that you've written them. You can send them to me once you've renamed
> them and I'll commit them. I kind of prefer "RecipientsMoreThan" over
> "RecipientsAreMoreThan". Besides, I've got a SizeGreaterThan. Maybe I'll
> change that to SizeGreaterThan.
I see. That would be easier in the eye too...
> Actually, I think I have a better idea than renaming all the classes... why
> not put them into the org.apache.james.transport.matchers.regex package? We
> can move the non-regex ones to a "text" or something... then we can leave
> the import as text by default, and if the admin wants to use regex, he/she
> can change the import. Comments?
This would be better.
Problem is, what if the admin wants to use both kinds? Would it be
possible to have FQNs in the match or class attribute of a mailet config?
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Serge Knystautas <se...@lokitech.com>.
Glad that you've written them. You can send them to me once you've renamed
them and I'll commit them. I kind of prefer "RecipientsMoreThan" over
"RecipientsAreMoreThan". Besides, I've got a SizeGreaterThan. Maybe I'll
change that to SizeGreaterThan.
Actually, I think I have a better idea than renaming all the classes... why
not put them into the org.apache.james.transport.matchers.regex package? We
can move the non-regex ones to a "text" or something... then we can leave
the import as text by default, and if the admin wants to use regex, he/she
can change the import. Comments?
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, September 25, 2001 5:07 AM
Subject: Re: Mailets
> Hi,
>
> On Mon, 24 Sep 2001, Serge Knystautas wrote:
> > Have you made any progress with the regex matchers?
>
> Yes, I have written some of them.
> CcNumbersMoreThan.java
> DestinationIsValid.java
> DestinationNotValid.java
> NotifySenderIfRecipientIs.java
> RecipientsAreMoreThan.java
> SenderHostIs.java
> SenderHostIsNot.java
> SenderIsLocal.java
> SenderIsNot.java
> SenderIsNotLocal.java
> UnknownLocalUser.java
> But only one of them uses regex (SenderHostIs).
> If anybody interested in those matchers, please say so. So that I can
> change the package names.
>
> BTW, regarding the class names, should we have proper English on them? I
> think "RecipientsAreMoreThan" is a bit too much. "RecipientsMoreThan"
> would be sufficient. Would it? (At least, in my language, the direct
> translation would be understandable.)
>
> > As for your point of
> > newbie, we could just create 2 versions of matchers in the appropriate
> > places... so RemoteAddrInNetwork=10.0.0.*,192.168.* like before, but
then
> > you could also have RemoteAddrInNetworkRegex=(whatever you want).
>
> This would be nicer. Besides, I don't have to update the original clases
> (eg: HostIs). I think I'm going to rename the classes.
>
> > If you want to send me any matchers you have done, I'll integrate them
into
> > CVS. If you have made progress, I think it'd be good to stick it in
towards
> > a 2.0 release.
>
> When are you going to release it?
>
> Oki
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Oki DZ <ok...@pindad.com>.
Hi,
On Mon, 24 Sep 2001, Serge Knystautas wrote:
> Have you made any progress with the regex matchers?
Yes, I have written some of them.
CcNumbersMoreThan.java
DestinationIsValid.java
DestinationNotValid.java
NotifySenderIfRecipientIs.java
RecipientsAreMoreThan.java
SenderHostIs.java
SenderHostIsNot.java
SenderIsLocal.java
SenderIsNot.java
SenderIsNotLocal.java
UnknownLocalUser.java
But only one of them uses regex (SenderHostIs).
If anybody interested in those matchers, please say so. So that I can
change the package names.
BTW, regarding the class names, should we have proper English on them? I
think "RecipientsAreMoreThan" is a bit too much. "RecipientsMoreThan"
would be sufficient. Would it? (At least, in my language, the direct
translation would be understandable.)
> As for your point of
> newbie, we could just create 2 versions of matchers in the appropriate
> places... so RemoteAddrInNetwork=10.0.0.*,192.168.* like before, but then
> you could also have RemoteAddrInNetworkRegex=(whatever you want).
This would be nicer. Besides, I don't have to update the original clases
(eg: HostIs). I think I'm going to rename the classes.
> If you want to send me any matchers you have done, I'll integrate them into
> CVS. If you have made progress, I think it'd be good to stick it in towards
> a 2.0 release.
When are you going to release it?
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Serge Knystautas <se...@lokitech.com>.
Oki,
Have you made any progress with the regex matchers? As for your point of
newbie, we could just create 2 versions of matchers in the appropriate
places... so RemoteAddrInNetwork=10.0.0.*,192.168.* like before, but then
you could also have RemoteAddrInNetworkRegex=(whatever you want).
If you want to send me any matchers you have done, I'll integrate them into
CVS. If you have made progress, I think it'd be good to stick it in towards
a 2.0 release.
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
To: <ja...@jakarta.apache.org>
Sent: Thursday, September 06, 2001 9:13 PM
Subject: Re: Mailets
> On Thu, 6 Sep 2001, Serge Knystautas wrote:
> > Sounds great. Since it's not that difficult, it'd be nice to have the
> > matchers modified to support regex. If you've got time to send me some
new
> > versions, I'll patch them into CVS.
>
> I'm currently testing the matchers. There would be little changes in the
> matchers to have them support regex. My only concern is, do all people
> have to understand regex in order to use the matchers? What if some of
> them would like to just entering a list (comma separated values)? I think
> regex (yes, I have to learn more) would match myhost.com and yourhost.com
> easily; eg: "myhost.com|yourhost.com".
>
> Anyway, I think regex is the way.
>
> public class SenderHostIs extends GenericMatcher {
> protected RE r;
>
> public void init() {
> try {
> r = new RE(getCondition());
> } catch(RESyntaxException rs) {
> //getMailetContext().getLogger().error(rs.getMessage());
> System.out.println(rs.getMessage());
> }
> }
>
> BTW, how do you get the logger from the matcher? I'd like to have the
> above exception in the log, but the getLogger() above doesn't seem to
> work.
>
> Oki
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Oki DZ <ok...@pindad.com>.
On Thu, 6 Sep 2001, Serge Knystautas wrote:
> Sounds great. Since it's not that difficult, it'd be nice to have the
> matchers modified to support regex. If you've got time to send me some new
> versions, I'll patch them into CVS.
I'm currently testing the matchers. There would be little changes in the
matchers to have them support regex. My only concern is, do all people
have to understand regex in order to use the matchers? What if some of
them would like to just entering a list (comma separated values)? I think
regex (yes, I have to learn more) would match myhost.com and yourhost.com
easily; eg: "myhost.com|yourhost.com".
Anyway, I think regex is the way.
public class SenderHostIs extends GenericMatcher {
protected RE r;
public void init() {
try {
r = new RE(getCondition());
} catch(RESyntaxException rs) {
//getMailetContext().getLogger().error(rs.getMessage());
System.out.println(rs.getMessage());
}
}
BTW, how do you get the logger from the matcher? I'd like to have the
above exception in the log, but the getLogger() above doesn't seem to
work.
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Serge Knystautas <se...@lokitech.com>.
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
> On Wed, 5 Sep 2001, Serge Knystautas wrote:
> > I think that'd be rather useful given the standard ways that these
Outlook
> > viruses propagate. I would write it as a matcher actually, something
like
> > "HasAttachmentNamed=blah.virus.pil".
>
> I see, matchers.
> Yes I think the (attachment) file name detection would be the first step
> in email virus protection in James. But Ideally, the matcher should work
> by reading a regex, so that anything that has, say, ".pif" would get a
> match. It would be easy to define, something like "*pif", or
> "*[pP][iI][iF]"; well, I might be wrong. BTW, I'm currently downloading
> jakarta-regexp from the CVS; maybe I'd have some time to implement regex
> in HostIs, SenderHostIs, or the HasAttachmentNamed matcher.
Sounds great. Since it's not that difficult, it'd be nice to have the
matchers modified to support regex. If you've got time to send me some new
versions, I'll patch them into CVS.
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Oki DZ <ok...@pindad.com>.
On Sat, 8 Sep 2001, Harmeet wrote:
> Would it be better to try with oro instead of regexp ?
I see, I can switch later... I mean, after I can get James run on Avalon
4.0.
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Harmeet <ha...@kodemuse.com>.
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
> "*[pP][iI][iF]"; well, I might be wrong. BTW, I'm currently downloading
> jakarta-regexp from the CVS; maybe I'd have some time to implement regex
> in HostIs, SenderHostIs, or the HasAttachmentNamed matcher.
Would it be better to try with oro instead of regexp ?
James already bundles the ORO libraries. It is used in NNTP to do wildcard
match for group selection.
Harmeet
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Oki DZ <ok...@pindad.com>.
On Wed, 5 Sep 2001, Serge Knystautas wrote:
> I think that'd be rather useful given the standard ways that these Outlook
> viruses propagate. I would write it as a matcher actually, something like
> "HasAttachmentNamed=blah.virus.pil".
I see, matchers.
Yes I think the (attachment) file name detection would be the first step
in email virus protection in James. But Ideally, the matcher should work
by reading a regex, so that anything that has, say, ".pif" would get a
match. It would be easy to define, something like "*pif", or
"*[pP][iI][iF]"; well, I might be wrong. BTW, I'm currently downloading
jakarta-regexp from the CVS; maybe I'd have some time to implement regex
in HostIs, SenderHostIs, or the HasAttachmentNamed matcher.
> (I really want to get a release out soon, but I'm hoping for a next release
> we start incorporating regex logic in these matchers so the matchers can be
> more flexible.)
Sure, we really need regex support in the matchers.
> I hope there aren't any issues running 2 instances of the remote delivery
> mailet (shouldn't be)... just so long as they have different repositories
> for the outgoing spool, I would think things would be ok.
I see, I'll try that.
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org
Re: Mailets
Posted by Serge Knystautas <se...@lokitech.com>.
I think that'd be rather useful given the standard ways that these Outlook
viruses propagate. I would write it as a matcher actually, something like
"HasAttachmentNamed=blah.virus.pil".
(I really want to get a release out soon, but I'm hoping for a next release
we start incorporating regex logic in these matchers so the matchers can be
more flexible.)
I hope there aren't any issues running 2 instances of the remote delivery
mailet (shouldn't be)... just so long as they have different repositories
for the outgoing spool, I would think things would be ok.
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Oki DZ" <ok...@pindad.com>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, September 04, 2001 5:27 AM
Subject: Mailets
> Hi,
>
> I've been fiddling around with mailets for a while, and I get some of them
> working. I'm interested in having a mailet that can do simple attachment
> file names detection, so that any mail which has some dubious names in the
> attachment could be sent back to the senders.
>
> BTW, I'm trying to set James to have two remote delivery mailets; one is
> for messages destined to the Internet, and another to an email server
> in inside network (both in two different mail processors). But I don't
> think that I could get the setup working.
>
> TIA,
> Oki
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org