With help from Craig Raw, we now have massively improved Virtual User Table
functionality.
The new code moves the core Virtual User Table behavior into a base class,
with specialized mapping classes. XML and JDBC mappers are currently
supported.
An example of the XML format would be:
<mailet match="All" class="XMLVirtualUserTable">
<!-- 1:1 mapping -->
<mapping>[EMAIL PROTECTED]@mordor</mapping>
<!-- 1:n mapping -->
<mapping>[EMAIL PROTECTED]@isengard;radigast;gandalf</mapping>
<!-- DSN mapping -->
<mapping>[EMAIL PROTECTED]:550 Requested action not taken: no
such user here</mapping>
<!-- regex based mapping -->
<mapping>[EMAIL PROTECTED]:(.*)@osgilliath:[EMAIL PROTECTED]</mapping>
<!-- both standard and regex mapping -->
<mapping>[EMAIL PROTECTED]@mordor;regex:ring@(.*):[EMAIL PROTECTED]</mapping>
<!-- conditional regex mapping example -->
<mapping>[EMAIL PROTECTED]:(.*)[EMAIL PROTECTED]:[EMAIL PROTECTED];
regex:(.*)[EMAIL PROTECTED]:[EMAIL PROTECTED]
</mapping>
</mailet>
A JDBC representation of the same mapping would be:
insert ignore into VirtualUserTable values("morgoth", "middle-earth",
"[EMAIL PROTECTED]");
insert ignore into VirtualUserTable values("istari", "middle-earth",
"[EMAIL PROTECTED];radigast;gandalf");
insert ignore into VirtualUserTable values("boromir", "osgilliath",
"error:550 Requested action not taken: no such user here");
insert ignore into VirtualUserTable values("%", "osgilliath",
"regex:(.*)@osgilliath:[EMAIL PROTECTED]");
insert ignore into VirtualUserTable values("ring", "%",
"[EMAIL PROTECTED];regex:ring@(.*):[EMAIL PROTECTED]");
insert ignore into VirtualUserTable values("%", "listserver",
"regex:(.*)[EMAIL PROTECTED]:[EMAIL PROTECTED];regex:(.*)[EMAIL PROTECTED]
r:[EMAIL PROTECTED]");
These examples demonstrate a forwarding address, a simple list, an error
reply, a regex mapping for bulk forwarding, a regex mapping that essentially
adds a CC to an existing message, and conversion from -on/-off
to -subscribe/-unsubscribe.
I've tested all of these samples with both the XML and JDBC implementations.
--- Noel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]