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

</mailet>

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