You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Jm Seigneur <Je...@cs.tcd.ie> on 2003/02/04 23:04:13 UTC

mailet position in config.xml

Hello,

I've create a mailet which takes all incoming mails to preprocess them.
This mailet works fine and is placed just before the end of the root
processor. 
In this java mailet, when I finish to process the current mail, I set
the mail to GHOST state (I've also tried without). 
However, I want to continue the standard flow in my config.xml after
ending this custom mailet,  that is, to store the emails in the standard
repositories. By the way, this process works fine without my mailet
included. 

Could you tell me what I need to modify in my config.xml?

Thanks,

Jm

PS: Below is the current state of my config.xml:

...

<mailet match="All" class="JmMailet">
         </mailet>

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

<processor name="transport">
<mailet match="RecipientIsLocal" class="LocalDelivery"/>
<mailet match="HostIsLocal" class="ToProcessor">
            <processor>error</processor>
         </mailet>
<mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
            <processor> spam </processor>
         </mailet>
   </processor>

<processor name="error">
<mailet match="All" class="ToRepository">
<repositoryPath> db://maildb/deadletter/error/ </repositoryPath>
            <passThrough> true </passThrough>
         </mailet>

<mailet match="All" class="NotifyPostmaster"/>
                 <attachStackTrace />
      </processor>

<processor name="spam">
<mailet match="All" class="NotifyPostmaster"/>
<mailet match="All" class="ToRepository">
<repositoryPath> db://maildb/deadletter/spam/ </repositoryPath>

         </mailet>
      </processor>

...
 


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


RE: mailet position in config.xml

Posted by Jm Seigneur <Je...@cs.tcd.ie>.
Hello,

Actually, now it works without this tag <passThrough>true</passThrough>
and I'm not sure it is a standard tag available when the mailet extends
GenericMailet. Is it?

To make it working, I simply removed the set to GHOST at the end of my
mailet. For the spam processor, I put the <mailet match="All"
class="NotifyPostmaster"/> after the <mailet match="All"
class="ToRepository"> for which I added the
<passThrough>true</passThrough> tag.

Thanks,

Jm

> -----Original Message-----
> From: Paul Bothma [mailto:paul@xtracker.co.za]
> Sent: 06 February 2003 08:43
> To: James Users List; Jean-Marc.Seigneur@cs.tcd.ie
> Subject: RE: mailet position in config.xml
> 
> I think you should add the following:
> 
> <passThrough>true</passThrough> to your <mailet> tag, so that you
have:
> 
> <mailet match="All" class="JmMailet">
> 	<passThrough>true</passThrough>
> </mailet>
> 
> -----Original Message-----
> From: Jm Seigneur [mailto:Jean-Marc.Seigneur@cs.tcd.ie]
> Sent: 05 February 2003 00:04
> To: 'James Users List'
> Subject: mailet position in config.xml
> 
> 
> Hello,
> 
> I've create a mailet which takes all incoming mails to preprocess
them.
> This mailet works fine and is placed just before the end of the root
> processor.
> In this java mailet, when I finish to process the current mail, I set
> the mail to GHOST state (I've also tried without).
> However, I want to continue the standard flow in my config.xml after
> ending this custom mailet,  that is, to store the emails in the
standard
> repositories. By the way, this process works fine without my mailet
> included.
> 
> Could you tell me what I need to modify in my config.xml?
> 
> Thanks,
> 
> Jm
> 
> PS: Below is the current state of my config.xml:
> 
> ...
> 
> <mailet match="All" class="JmMailet">
>          </mailet>
> 
> <mailet match="All" class="ToProcessor">
>             <processor> transport </processor>
>          </mailet>
>       </processor>
> 
> <processor name="transport">
> <mailet match="RecipientIsLocal" class="LocalDelivery"/>
> <mailet match="HostIsLocal" class="ToProcessor">
>             <processor>error</processor>
>          </mailet>
> <mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
>             <processor> spam </processor>
>          </mailet>
>    </processor>
> 
> <processor name="error">
> <mailet match="All" class="ToRepository">
> <repositoryPath> db://maildb/deadletter/error/ </repositoryPath>
>             <passThrough> true </passThrough>
>          </mailet>
> 
> <mailet match="All" class="NotifyPostmaster"/>
>                  <attachStackTrace />
>       </processor>
> 
> <processor name="spam">
> <mailet match="All" class="NotifyPostmaster"/>
> <mailet match="All" class="ToRepository">
> <repositoryPath> db://maildb/deadletter/spam/ </repositoryPath>
> 
>          </mailet>
>       </processor>
> 
> ...
> 
> 
> 
> ---------------------------------------------------------------------
> 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


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


RE: mailet position in config.xml

Posted by Paul Bothma <pa...@xtracker.co.za>.
I think you should add the following:

<passThrough>true</passThrough> to your <mailet> tag, so that you have:

<mailet match="All" class="JmMailet">
	<passThrough>true</passThrough>
</mailet>

-----Original Message-----
From: Jm Seigneur [mailto:Jean-Marc.Seigneur@cs.tcd.ie]
Sent: 05 February 2003 00:04
To: 'James Users List'
Subject: mailet position in config.xml


Hello,

I've create a mailet which takes all incoming mails to preprocess them.
This mailet works fine and is placed just before the end of the root
processor. 
In this java mailet, when I finish to process the current mail, I set
the mail to GHOST state (I've also tried without). 
However, I want to continue the standard flow in my config.xml after
ending this custom mailet,  that is, to store the emails in the standard
repositories. By the way, this process works fine without my mailet
included. 

Could you tell me what I need to modify in my config.xml?

Thanks,

Jm

PS: Below is the current state of my config.xml:

...

<mailet match="All" class="JmMailet">
         </mailet>

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

<processor name="transport">
<mailet match="RecipientIsLocal" class="LocalDelivery"/>
<mailet match="HostIsLocal" class="ToProcessor">
            <processor>error</processor>
         </mailet>
<mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
            <processor> spam </processor>
         </mailet>
   </processor>

<processor name="error">
<mailet match="All" class="ToRepository">
<repositoryPath> db://maildb/deadletter/error/ </repositoryPath>
            <passThrough> true </passThrough>
         </mailet>

<mailet match="All" class="NotifyPostmaster"/>
                 <attachStackTrace />
      </processor>

<processor name="spam">
<mailet match="All" class="NotifyPostmaster"/>
<mailet match="All" class="ToRepository">
<repositoryPath> db://maildb/deadletter/spam/ </repositoryPath>

         </mailet>
      </processor>

...
 


---------------------------------------------------------------------
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


PB with MimeMultipart multipart = (MimeMultipart) message.getContent();

Posted by Jm Seigneur <Je...@cs.tcd.ie>.
Hello,

I've seen in the archive that it is possible to get the MimeMultipart of
a new Mail like that:

MimeMultipart multipart = (MimeMultipart)
mail.getMessage().getContent();

When I send an email with some binary file attached, I get a
java.lang.ClassCastException: java.lang.String.

The reason I'd like to get the multipart is to discard the attachment. 

My question is:
Why do I get this exception?

Thanks,

Jm





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


RE: mailet position in config.xml

Posted by "Noel J. Bergman" <no...@devtech.com>.
> In this java mailet, when I finish to process the current mail, I set
> the mail to GHOST state (I've also tried without).

If you set the state to GHOST, that tells James to delete the message.

I assume from the lack of a question in your message, that the mail is
dispearing, and you do not know to where or why?  If you turn on DEBUG for
the spoolmanager log, you should see each matcher and mailet being passed
each message, and see where the message is going.

	--- Noel


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