I've been able to tackle this problem in my environment using current James
code, though it requires maintaining the config.xml file when you add/remove
users. It's not a code-only solution, but it seems to work.
I picked one domain as the "primary domain" that will hold all the
mailboxes. I then wrote rules into config.xml to handle the other domains,
and forward e-mail to this one domain. For me, this works really well
because my primary domain is only used locally, and is not advertised for
public e-mail addresses. Assuming I picked "a.com" as the main domain and
also host domains "b.com" and "c.com," here are the interesting parts of
config.xml:
<servernames autodetect="FALSE">
<!-- Note: Only the primary domain is needed -->
<servername>a.com</servername>
</servernames>
<processor name="transport">
<mailet match="HostIs=b.com" class="ToProcessor">
<processor>b.com</processor>
</mailet>
<mailet match="HostIs=c.com" class="ToProcessor">
<processor>c.com</processor>
</mailet>
<mailet match="RecipientIsLocal" class="LocalDelivery"/>
<mailet match="HostIsLocal" class="ToProcessor">
<processor>error</processor>
</mailet>
<mailet match="All" class="RemoteDelivery">
<!-- Wherever you normally put outgoing messages -->
</mailet>
</processor>
<processor name="b.com">
<mailet match="UserIs=User1" class="Forward">
<forwardto>[EMAIL PROTECTED]</forwardto>
</mailet>
<!-- Add one entry per user in domain -->
<mailet match="All" class="ToProcessor">
<processor>error</processor>
</mailet>
</processor>
<processor name="c.com">
<mailet match="UserIs=User2" class="Forward">
<forwardto>[EMAIL PROTECTED]</forwardto>
</mailet>
<!-- Add one entry per user in domain -->
<mailet match="All" class="ToProcessor">
<processor>error</processor>
</mailet>
</processor>
Maybe this will work for your environment, but if it doesn't, hopefully
it'll spark a similar idea.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>