james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject VirtualUserTable updates
Date Sun, 21 Mar 2004 07:18:16 GMT
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>morgoth@middle-earth=sauron@mordor</mapping>
     <!-- 1:n mapping -->

<mapping>istari@middle-earth=saruman@isengard;radigast;gandalf</mapping>
     <!-- DSN mapping -->
     <mapping>boromir@osgilliath=error:550 Requested action not taken: no
such user here</mapping>
     <!-- regex based mapping -->
     <mapping>*@osgilliath=regex:(.*)@osgilliath:${1}@minas-tirith</mapping>
     <!-- both standard and regex mapping -->
     <mapping>ring@*=onering@mordor;regex:ring@(.*):ring@${1}</mapping>
     <!-- conditional regex mapping example -->

<mapping>*@listserver=regex:(.*)-on@listserver:${1}-subscribe@listserver;

regex:(.*)-off@listserver:${1}-unsubscribe@listserver
     </mapping>
  </mailet>

A JDBC representation of the same mapping would be:

  insert ignore into VirtualUserTable values("morgoth", "middle-earth",
"sauron@mordor");
  insert ignore into VirtualUserTable values("istari", "middle-earth",
"saruman@isengard;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:${1}@minas-tirith");
  insert ignore into VirtualUserTable values("ring", "%",
"onering@mordor;regex:ring@(.*):ring@${1}");
  insert ignore into VirtualUserTable values("%", "listserver",
"regex:(.*)-on@listserver:${1}-subscribe@listserver;regex:(.*)-off@listserve
r:${1}-unsubscribe@listserver");

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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message