Differences between revisions 4 and 5
Revision 4 as of 2009-09-20 22:58:20
Size: 844
Editor: localhost
Comment: converted to 1.6 markup
Revision 5 as of 2011-06-05 06:15:02
Size: 1560
Editor: Dong Liang
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
Line 8: Line 7:
    <forwardto>catchall@mydomain.com</forwardto>
. <forwardto> catchall@mydomain.com </forwardto>
Line 14: Line 15:
    <forwardto>catchall@mydomain.com</forwardto>
. <forwardto> catchall@mydomain.com </forwardto>
Line 16: Line 19:

WARNING: as the message (or a copy of it) is reinjected in the spool without any modification, the preceding example is very likely to cause a "configuration loop" in your system, unless some other mailet has previously modified something (a header for instance) that could force the resent message follow a different path so that it does not return here unchanged ([[http://james.apache.org/server/2/apidocs/org/apache/james/transport/mailets/Resend.html|Refer to]]).

The following mailet is an example which can be put before the "Forward" mailet to avoid "configuration loop":

<mailet match="RecipientIs=catchall@mydomain.com" class="ToProcessor">
 . <processor>transport</processor>
</mailet>

This page describes how to configure James to catch every single email you throw at it and place each email into a single POP account. This allows you to connect an email client to the POP account and view every email that you are producing. This setup is very useful for testing a program that you are developing which generates dynamic emails. It's a great way to fine tune the results you're getting.

Configuring James as a catchall

For catching all locally-originated messages you can do this (tested and working):

<mailet match="HostIsLocal" class="Forward">

</mailet>

For catching ALL messages sent to this server, this should work (you'll need to turn relaying on):

<mailet match="All" class="Forward">

</mailet>

WARNING: as the message (or a copy of it) is reinjected in the spool without any modification, the preceding example is very likely to cause a "configuration loop" in your system, unless some other mailet has previously modified something (a header for instance) that could force the resent message follow a different path so that it does not return here unchanged (Refer to).

The following mailet is an example which can be put before the "Forward" mailet to avoid "configuration loop":

<mailet match="RecipientIs=catchall@mydomain.com" class="ToProcessor">

  • <processor>transport</processor>

</mailet>

ConfigureJamesAsCatchAll (last edited 2011-06-05 06:15:02 by Dong Liang)