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 Serge Knystautas <se...@lokitech.com> on 2001/08/27 20:57:29 UTC

Re: JAMES as NT service

I'd like to consider including this code in a James distribution.

Here is a copy of the license:

      JavaService - License
      By downloading and/or using this software you agree to abide by the
following license:

      Copyright (c) 2000, Alexandria Software Consulting

      All rights reserved. Redistribution and use in source and binary
forms, with or without modification, are permitted provided that the
following conditions are met:

        a.. Redistributions of source code must retain the above copyright
notice, this list of conditions, and the following disclaimer.
        b.. Neither name of Alexandria Software Consulting nor the names of
the contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



Who should I talk to about reviewing this license, whether it meshes with
the Apache license, and if it could be bundled with a JAMES distribution?

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: <ha...@kodemuse.com>
To: <ja...@jakarta.apache.org>
Sent: Monday, August 13, 2001 3:00 PM
Subject: Re: JAMES as NT service


> I use this.
> > http://www.alexandriasc.com/software/JavaService/index.html
>
> Works very well.
> Take a look at run.bat and the NT Service documentation at
http://www.alexandriasc.com/software/JavaService/documentation.html
> Should be straight foward.
>
> Harmeet
>
> PS. This mail is sent through James, running as NT Service.





---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: JAMES as NT service

Posted by Jon Stevens <jo...@latchkey.com>.
on 8/27/01 11:57 AM, "Serge Knystautas" <se...@lokitech.com> wrote:

> Who should I talk to about reviewing this license, whether it meshes with
> the Apache license, and if it could be bundled with a JAMES distribution?

Try: pmc@jakarta.apache.org

-jon


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: Invalid user writing to himself

Posted by Serge Knystautas <se...@lokitech.com>.
Hmmm.  that's quite an interesting predicament.  Normally if a message
enters a loop like that, you get many received headers created, and mail
servers (including james) will kill the message after a suitably large
number.

In this case, I guess it's NotifySender that's creating the problem.  This
is kind of hard to catch, as while it'd be easy to check if the sender and
recipient are the same, it might not be that easy if there is address
forwarding or something else.

Really want we should do is have those notify mailets now send the message
with the 'null' sender (MAIL FROM: <>).  This is to create a message that
does not bounce.  The code in CVS now supports the null sender, but I don't
think the mailets have been changed to do this (although they will not
notify sender if the sender is null).

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Jacques Lema" <ja...@link-u.com>
To: <ja...@jakarta.apache.org>
Sent: Wednesday, September 05, 2001 10:30 AM
Subject: Invalid user writing to himself


>
>
> I have a page on my site (http://maplante.meet-u.com/) that allows (in
> order to offer a virtual plant) sending email to another person.
>
> Apparently if both the TO and the FROM user name are invalid
> for example: sending from "bob@meeeeeeet-u.com" to "bob@meeeeeeet-u.com "
>
> The mail enter an infinite loop... as it is refused and sent to bob.. who
> doesnt exist, who doesnt exist and sends it to bob... and so on?
>
> How should I filter this? (Using James 1.2.1)
>
> -----------------------------------------------------------
> Jacques Lema, Designer at Link-u.com
> ++41 21 634 80 88
> jacques@link-u.com
> visit our flagship site: http://www.meet-u.com/
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Invalid user writing to himself

Posted by Oki DZ <ok...@pindad.com>.
On Wed, 5 Sep 2001, Jacques Lema wrote:
> I have a page on my site (http://maplante.meet-u.com/) that allows (in 
> order to offer a virtual plant) sending email to another person.
> 
> Apparently if both the TO and the FROM user name are invalid
> for example: sending from "bob@meeeeeeet-u.com" to "bob@meeeeeeet-u.com "
> 
> The mail enter an infinite loop... as it is refused and sent to bob.. who 
> doesnt exist, who doesnt exist and sends it to bob... and so on?
> 
> How should I filter this? (Using James 1.2.1)

I use the following inside the <spoolmanager> element in
config.xml (which was james-config.xml):
    <processor name="transport">
      <mailet match="RemoteAddrNotInNetwork=<your networks>"
        class="ToProcessor">
	<processor> spam </processor>
      </mailet>

      <!-- local filter -->
      <mailet match="HostIs=<your domain>"
	class="ToProcessor">
	<processor>localproc</processor>
      </mailet>

      <mailet match="All" class="ToProcessor">
	<processor>internet</processor>
      </mailet>
    </processor>

   <processor name="localproc">
      <!-- local delivery -->
      <mailet match="RecipientIsLocal" class="LocalDelivery">
      </mailet>
      <!-- nice feature; but could lead to a "ping of death" of your
           mail server; the choice is yours -->
      <mailet match="All" class="NotifySender">
	<notice>We're sorry. Your email could not be delivered; no such
user(s).</notice>
      </mailet>
    </processor>

    <processor name="internet">
      <mailet match="SenderHostIsNot=<your domain>" class="ToRepository">
	<repositoryPath>db://Message2/wrongsender</repositoryPath>
	<passThrough>false</passThrough>
      </mailet>
      <mailet match="All" class="RemoteDelivery">
        <!-- the setting is as usual -->
      </mailet>
    </processor>

Basically, the above setting is to have a "localproc" processor and an
"internet" processor which handle locally destined messages and remote
destined ones. The local processor has the RecipientIsLocal matcher to see
whether the messages are indeed locally destined (make sure that the
elements in <servernames> block (in <James> block) represent the local
domain(s)). 

The "internet" processor has a SenderHostIsNot matcher, which sees whether
the sender is not from your domain; meaning, messages that sent via your
James and not from the local domain will be stored in the repository; in
which you could check them out later from which IP numbers the messages
were sent out. This would restrict your James to deliver (out) the
messages that originate from your domain only. The originating IP numbers
(network numbers) have been filtered by the RemoteAddrNotInNetwork
matcher, and the sender domain is by the above matcher. I think, ideally
the matcher should be SenderIsLocal (so it does check whether the users are
from your domain).

Oki

ps: matchers in the following (feel free to change the package names):

package com.pindad.james.transport.matchers;
/**
 * SenderHostIs.java
 *
 *
 * Created: Wed Aug 29 16:12:59 2001
 *
 * @author <a href="mailto:okidz@pindad.com">Oki DZ</a>
 * @version
 */
import java.util.*;

import org.apache.mailet.*;
import org.apache.james.transport.matchers.*;

public class SenderHostIs extends GenericMatcher {
    protected Collection senderHosts;

    public void init() {
	StringTokenizer tokenizer = new StringTokenizer(getCondition(), ",
",false);
	senderHosts = new Vector();
	while (tokenizer.hasMoreTokens()) {
	    senderHosts.add(tokenizer.nextToken());
	} 
    }

    public Collection match(Mail mail) {
	if (senderHosts.contains(mail.getSender().getHost())) {
	    return mail.getRecipients();
	} else {
	    return null;
	} 
    }
} 

package com.pindad.james.transport.matchers;
/**
 * SenderHostIsNot.java
 *
 *
 * Created: Wed Aug 29 16:31:04 2001
 *
 * @author <a href="mailto:okidz@pindad.com">Oki DZ</a>
 * @version
 */
import java.util.*;

import javax.mail.*;
import javax.mail.internet.*;

import org.apache.mailet.*;
import org.apache.james.transport.matchers.*;

public class SenderHostIsNot extends SenderHostIs {
    
    public Collection match(Mail mail) { // Fixme: use regex
	MailAddress sender = mail.getSender();
	if (sender == null) return null;
	if (senderHosts.contains(sender.getHost())) {
	    return null;
	} else {
	    return mail.getRecipients();
	} 
    }

    public String getMailetInfo() {
	return "SenderHostIsNot";
    }
} 



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Invalid user writing to himself

Posted by Jacques Lema <ja...@link-u.com>.

I have a page on my site (http://maplante.meet-u.com/) that allows (in 
order to offer a virtual plant) sending email to another person.

Apparently if both the TO and the FROM user name are invalid
for example: sending from "bob@meeeeeeet-u.com" to "bob@meeeeeeet-u.com "

The mail enter an infinite loop... as it is refused and sent to bob.. who 
doesnt exist, who doesnt exist and sends it to bob... and so on?

How should I filter this? (Using James 1.2.1)

-----------------------------------------------------------
Jacques Lema, Designer at Link-u.com
++41 21 634 80 88
jacques@link-u.com
visit our flagship site: http://www.meet-u.com/





---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org