Catch-all handling - current best practices

Wojtek <[email protected]> Wed, 21 Aug 2024 11:12:08 +0200
Newsgroups gmane.comp.jakarta.james.user
Message-ID <[email protected]>
Hi all,
what is the current best practices to add handling of "catch all" use case (i.e. redirect all 
messages that do not match - and only those that doesn't match! - existing mailbox to "catch all" 
mailbox)?

I found https://cwiki.apache.org/confluence/display/JAMES2/ConfigureJamesAsCatchAll but it's from 5 
years ago and doesn't even mention version. From the looking at it, it would redirect all messages 
to "catch-all".

OTOH I found https://github.com/foilen/james-extra-components but it hasn't been update since 5 
years as well.

Currently we have:
```xml
<processor state="transport" enableJmx="true">
…
     <mailet match="HostIsLocal" class="ToProcessor">
         <processor>local-address-error</processor>
         <notice>550 - Requested action not taken: no such user here</notice>
     </mailet>
…
</processor>

<processor state="local-address-error" enableJmx="true">
     <mailet match="All" class="MetricsMailet">
         <metricName>mailetContainerLocalAddressError</metricName>
     </mailet>
     <mailet match="All" class="Bounce">
         <attachment>none</attachment>
     </mailet>
     <mailet match="All" class="ToRepository">
         <repositoryPath>file://var/mail/address-error/</repositoryPath>
     </mailet>
</processor>
```

I would assume that changing last mailet (ToRepository with error repository) to some mailet. I 
looked a the list and mailets in the sources but none of them seems to fit it.

Any suggestion how to configure it?

-- 
Wojtek