Hi,
I have just written a mailet for handling virtual domains. Basically, it
stores the messages in the user mailboxes for the messages that are
destined for certain domains. I have tested it for a while. To
differentiate users, the usernames become [EMAIL PROTECTED] (it's not
just the username); so you can have the same usernames in the different
domains. This can be done in the JDBC users repository. I have
tried to retrieve the messages via fetchmail, it was fine. Although you
couldn't do it via the command line; the username must be defined in the
~/.fetchmailrc.
I have the following in my config.xml:
<processor name="transport">
<mailet match="HostIs=[pP][iI][nN][dD][aA][dD]\.[cC][oO]\.[iI][dD]$"
class="ToProcessor">
<processor>intranet</processor>
</mailet>
</processor>
<processor name="intranet">
<mailet match="All" class="ToVirtualDomain">
<domain>pindad.co.id</domain>
</mailet>
</processor>
The mailet filters the recipient addresses which have the domain defined
in the "domain" element in the mailet config, and then store them in the
mail repository. Any messages destined for other domains would get resend.
I don't think that the HostIs matcher above is needed; having the mailet
defined in the transport processor would be all right.
I'm still testing it, so use it with care. I haven't tried it for more
than two domains; one is served by the LocalDelivery mailet as usual, and
the domain above with ToVirtualDomain. Having more domains would be
done by repeating the mailet config:
<processor name="transport">
<!-- other mailets here -->
<mailet match="All" class="ToVirtualDomain">
<domain>yourdomain.com</domain>
</mailet>
<mailet match="All" class="ToVirtualDomain">
<domain>anotherdomain.com</domain>
</mailet>
</processor>
But I guess, it would be faster if you have a processor for each virtual
domain. Any comments would be appreciated.
BTW, I believe the concept of processor+matchers+mailets is really
great.
Oki
virtdomain.jar
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]