Mark,

Attached is a new class, XMLResources.java, a sample mailet, and a
miResources.xml file.  To test it, I added:

         <mailet match="[EMAIL PROTECTED]" class="XMLTest">

<resources>/opt/james/apps/james/conf/miResources.xml</resources>
            <LIST_NAME>The List</LIST_NAME>
            <DOMAIN_NAME>The Domain</DOMAIN_NAME>
            <ERROR_MESSAGE>Error Message</ERROR_MESSAGE>
            <MEMBER_LIST xml:space="preserve">
Frodo
Sam
Boromir
Gandalf
Gimli
Legolas
Merry
Pippin
Strider
            </MEMBER_LIST>
         </mailet>

to my config.xml.

As you can see from XMLTest.java, you can do replacement either at init time
or at service time, depending upon which is appropriate to a given
replacement field.  One thing that I had to do at the moment was use a full
path to the resources file because we don't yet expose a method to a mailet
that can do relative path translation.

Does this look like something you can work with?  I haven't gotten the
responses.properties table in there, yet, just the text files.  I can do
that, or you.  The real question is whether or not this works for you.

        --- Noel

Attachment: XMLTest.java
Description: Binary data

Attachment: XMLResources.java
Description: Binary data

<!-- XML resources for mailing lists -->
<resources>
  <matchers>
    <matcher for="custom" match="My Custom List"/>
  </matchers>

  <group name="subscribeConfirm">
    <resource name="text" xml:space="preserve"><![CDATA[
Acknowledgment: I have added the address

   ${SENDER_ADDR}

to the ${LIST_NAME} mailing list.

Welcome to [EMAIL PROTECTED]

Please save this message so that you know the address you are
subscribed under, in case you later want to unsubscribe or change your
subscription address.]]>
    </resource>
  </group>
  <group name="unsubscribeConfirm">
    <resource name="text" xml:space="preserve"><![CDATA[
Acknowledgment: I have removed the address

   ${SENDER_ADDR}

from the ${LIST_NAME} mailing list.

Goodbye from [EMAIL PROTECTED]

If you would like to subscribe in the future please send email to: [EMAIL PROTECTED]>
    </resource>
  </group>
  <group name="error">
    <resource name="text" xml:space="preserve"><![CDATA[
An error occurred while processing your request:
    ${ERROR_MESSAGE}]]>
    </resource>
  </group>
  <group name="unsubscribe">
    <resource name="text" xml:space="preserve"><![CDATA[
To confirm that you would like

    ${SENDER_ADDR}

removed from the ${LIST_NAME} mailing list, please send an empty reply to this address:


[EMAIL PROTECTED]

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into the "To:" field of a new message.

 or click here:

mailto:[EMAIL PROTECTED]>
    </resource>
  </group>
  <group name="subscribe">
    <resource name="text" xml:space="preserve"><![CDATA[
To confirm that you would like

   ${SENDER_ADDR}

added to the ${LIST_NAME} mailing list, please send an empty reply to this address:

   [EMAIL PROTECTED]

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into the "To:" field of a new message.

or click here:
    mailto:[EMAIL PROTECTED]

This confirmation serves two purposes. First, it verifies that I am able to get mail through to you. Second, it protects you in case someone forges a subscription request in your name.]]>
    </resource>
  </group>
  <group name="admincommands">
    <resource name="text" xml:space="preserve"><![CDATA[
--- Administrative commands for the ${LIST_NAME} list ---

I can handle administrative requests automatically. Please do not send them to the list address! Instead, send your message to the correct command address:

To subscribe to the list, send a message to:
   <[EMAIL PROTECTED]>

To remove your address from the list, send a message to:
   <[EMAIL PROTECTED]>

Send mail to the following for info and FAQ for this list:
   <[EMAIL PROTECTED]>

If despite following these instructions, you do not get the desired results, please contact my owner at [EMAIL PROTECTED] Please be patient, my owner is a lot slower than I am ;-)]]>
    </resource>
  </group>
  <group name="info">
    <resource name="text" xml:space="preserve"><![CDATA[
--- Information regarding the ${LIST_NAME} list ---

This is a public mailing list associated with the ${DOMAIN_NAME} server.
It is intended to be a convienent mechanism to share ideas, news and current events with like minded people.

--- Common practices ---
Sending email to the list:
    If you want to send email to the list, you can simply click on this link: [EMAIL PROTECTED] and then send what ever email you'd like to share with the other members of the ${LIST_NAME} mailing list.

Recieving email from the list:
    Every time someone sends email to the list, every member will recieve the email in their inbox.

Replying to list email:
    When you reply to email from the list, it will also go to every member on the list.

--- Current members ---
The list of current members are:
    ${MEMBER_LIST}]]>
    </resource>
  </group>
  <group name="footer">
    <resource name="text" xml:space="preserve"><![CDATA[
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]>
    </resource>
  </group>
  <group name="footer_html">
    <resource name="text" xml:space="preserve"><![CDATA[
---------------------------------------------------------------------
To unsubscribe, e-mail: <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
For additional commands, e-mail: <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>]]>
    </resource>
  </group>
  <group name="responses.properties">
    <resource name="text" xml:space="preserve"><![CDATA[We need to fill these in]]>
    </resource>
  </group>
  <group name="header">
    <resource name="text" xml:space="preserve"><![CDATA[
Hi! This is the list serv program. I'm managing the [EMAIL PROTECTED] mailing list.

I'm working for my owner, who can be reached at [EMAIL PROTECTED]>
    </resource>
    <resource name="text" for="custom">This is my custom HEADER resource</resource>
  </group>
</resources>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to