From mailetnelsonheather@example.com Sat Jul 14 18:11:01 2007
Return-Path: <mailetnelsonheather@example.com>
Delivered-To: nelsonheather@example.com
Received: (qmail 39970 invoked from network); 14 Jul 2007 18:11:00 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 14 Jul 2007 18:11:00 -0000
Received: (qmail 74407 invoked by uid 500); 14 Jul 2007 18:11:03 -0000
Delivered-To: nelsonheather@example.com
Received: (qmail 74371 invoked by uid 500); 14 Jul 2007 18:11:03 -0000
Mailing-List: contact nelsonheather@example.com; run by ezmlm
Precedence: bulk
List-Help: <mailto:nelsonheather@example.com>
List-Unsubscribe: <mailto:nelsonheather@example.com>
List-Post: <mailto:nelsonheather@example.com>
List-Id: <mailet-api.james.apache.org>
Reply-To: nelsonheather@example.com
Delivered-To: mailing list nelsonheather@example.com
Received: (qmail 74360 invoked by uid 99); 14 Jul 2007 18:11:02 -0000
Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jul 2007 11:11:02 -0700
X-ASF-Spam-Status: No, hits=-0.0 required=10.0
	tests=SPF_PASS
X-Spam-Check-By: apache.org
Received-SPF: pass (herse.apache.org: domain of nelsonheather@example.com designates 83.161.120.155 as permitted sender)
Received: from [83.161.120.155] (HELO wa-out-1112.google.com) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jul 2007 11:10:59 -0700
Received: by wa-out-1112.google.com with SMTP id v27so1015087wah
        for <nelsonheather@example.com>; Sat, 14 Jul 2007 11:10:39 -0700 (PDT)
DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=Foebo19oTJTONseYRye65/DGmBvrT82itIJLCAoS+0V025dokOAbovcbsMxPGwzKx3rHK28mx0UhRQIWqY+90vU7/UwL1zC67ETyeLhXZQBgO9rd/6wY2OpcAlFNtHO4RB23OAMYHse7GPsUa6JrYB8IVenpQbYev2Gj77azzNw=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=WSBTyJiLsUW66asNIPcYzmDuuQB5hcMy+uutev5/Yqzxft3Q0sCky8OVjN76NlgbnOUgDWAmM0EhNfMRIF66mS+Nd6rWR+Bnvj3Fh3eZhUXjkBFovUYnsWc4rS5ePJ3rJzjMs2euXz+lv/z5YIWwU/bcqz4Yg75NQ/d3FjrSRJ0=
Received: by 83.161.120.155 with SMTP id t1mr2704621wai.1184436639418;
        Sat, 14 Jul 2007 11:10:39 -0700 (PDT)
Received: by 83.161.120.155 with HTTP; Sat, 14 Jul 2007 11:10:39 -0700 (PDT)
Message-ID: <nelsonheather@example.com>
Date: Sat, 14 Jul 2007 11:10:39 -0700
From: "fat suze" <nelsonheather@example.com>
To: nelsonheather@example.com
Subject: Proper way to bounce/reject a message, proper way to stop processing message
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-Virus-Checked: Checked by ClamAV on apache.org

Two questions -- thank you very much for your help:

1) In my mailet, I'm not sure how to bounce/reject the message and
ensure no further processing is done.  I want the sender to get a
bounce back and James to then ignore the message.  Does this look
right?.

public void service(Mail mail) throws MessagingException void
service(Mail mail) throws MessagingException
{
  getMailetContext().bounce(mail, "I don't like your message");
  return;
}

2) If I'm done doing something with a message that I'm not rejecting
(let's say I just wanted to retrieve some information from the message
then behave as though it was accepted, but I don't want any other
mailets or James to deliver it anywhere) -- would this be right:

public void service(Mail mail) throws MessagingException void
service(Mail mail) throws MessagingException
{
 doWhateverIWantToDoWithThisMessage();
 mail.setState(Mail.GHOST);
}


Thanx!!

From mailetnelsonheather@example.com Wed Jul 18 09:06:55 2007
Return-Path: <mailetnelsonheather@example.com>
Delivered-To: nelsonheather@example.com
Received: (qmail 75086 invoked from network); 18 Jul 2007 09:06:51 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 18 Jul 2007 09:06:51 -0000
Received: (qmail 38759 invoked by uid 500); 18 Jul 2007 09:06:39 -0000
Delivered-To: nelsonheather@example.com
Received: (qmail 38709 invoked by uid 500); 18 Jul 2007 09:06:38 -0000
Mailing-List: contact nelsonheather@example.com; run by ezmlm
Precedence: bulk
List-Help: <mailto:nelsonheather@example.com>
List-Unsubscribe: <mailto:nelsonheather@example.com>
List-Post: <mailto:nelsonheather@example.com>
List-Id: <mailet-api.james.apache.org>
Reply-To: nelsonheather@example.com
Delivered-To: mailing list nelsonheather@example.com
Received: (qmail 38649 invoked by uid 99); 18 Jul 2007 09:06:38 -0000
Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jul 2007 02:06:38 -0700
X-ASF-Spam-Status: No, hits=-0.0 required=10.0
	tests=SPF_PASS
X-Spam-Check-By: apache.org
Received-SPF: pass (herse.apache.org: domain of nelsonheather@example.com designates 83.161.120.155 as permitted sender)
Received: from [83.161.120.155] (HELO py-out-1112.google.com) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jul 2007 02:06:34 -0700
Received: by py-out-1112.google.com with SMTP id a25so253185pyi
        for <nelsonheather@example.com>; Wed, 18 Jul 2007 02:06:13 -0700 (PDT)
DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth;
        b=CHD7soi4UowRBHVbyAkPhDVZ7DCfx9rcjqGWhfjoWgaIXjUM+iXsVz1L04nLznwoee1SYWQk04Ume7+sjRK9+6CsbQvnuDKQwilzNW9IMKQW952h/lcmmxpi2cbiK7bQlQg6rGIKsRulLMoAO3Z5qT/APNhrFGe22W/lHoKiOLI=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth;
        b=Q7i0cuIn3qgKfuO0Tw4nF4Bc74YMwUJHtmmKEblJZh1voc8gNh1ibkitU0WEK/kb3S5rCVXfNbrRCu9G46CJyROO3uBQerYlcsNOK7kUSzGPWSED2FB6PnNVOqkOe0WvsPKPoGWklWpuOjRRGXV47y+CE7Lu73lkP4dRuSRM5qY=
Received: by 83.161.120.155 with SMTP id x8mr2343473qbq.1184749573505;
        Wed, 18 Jul 2007 02:06:13 -0700 (PDT)
Received: by 83.161.120.155 with HTTP; Wed, 18 Jul 2007 02:06:13 -0700 (PDT)
Message-ID: <nelsonheather@example.com>
Date: Wed, 18 Jul 2007 10:06:13 +0100
From: "Danny Angus" <nelsonheather@example.com>
Sender: nelsonheather@example.com
To: nelsonheather@example.com
Subject: Re: Proper way to bounce/reject a message, proper way to stop processing message
In-Reply-To: <nelsonheather@example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <nelsonheather@example.com>
X-Google-Sender-Auth: 2a377955aa0d39ad
X-Virus-Checked: Checked by ClamAV on apache.org

they both look right to me

On 7/14/07, fat suze <nelsonheather@example.com> wrote:
> Two questions -- thank you very much for your help:
>
> 1) In my mailet, I'm not sure how to bounce/reject the message and
> ensure no further processing is done.  I want the sender to get a
> bounce back and James to then ignore the message.  Does this look
> right?.
>
> public void service(Mail mail) throws MessagingException void
> service(Mail mail) throws MessagingException
> {
>   getMailetContext().bounce(mail, "I don't like your message");
>   return;
> }
>
> 2) If I'm done doing something with a message that I'm not rejecting
> (let's say I just wanted to retrieve some information from the message
> then behave as though it was accepted, but I don't want any other
> mailets or James to deliver it anywhere) -- would this be right:
>
> public void service(Mail mail) throws MessagingException void
> service(Mail mail) throws MessagingException
> {
>  doWhateverIWantToDoWithThisMessage();
>  mail.setState(Mail.GHOST);
> }
>
>
> Thanx!!
>


{'source': 'Apache Software Foundation Public Mail Archives'}