<!-- This config file is for organizational IM only (no server-to-server links).  
User accounts must be created by some means BESIDES client auto-registration. 
SSL/TLS client connections are enabled.
Plaintext logins are not allowed.
Non-SSL/TLS client connections to any address but 127.0.0.1 are not allowed. 
This config also enables multi-user conferencing and a local Jabber User Directory, or JUD.

Created by Van, July 2003
-->

<jabber> 

  <service id="sessions">

    <host><jabberd:cmdline flag="h">im.jabs.org</jabberd:cmdline></host>

    <!-- 
    This is the custom configuration section for the 
    Jabber session manager, a.k.a. "JSM". 
    -->

    <jsm xmlns="jabber:config:jsm">
      
      <filter>
          <default/>
          <max_size>100</max_size>
          <allow>
              <conditions>
                  <ns/>          <!-- Matches if the iq's xmlns is the same as the specified namespace -->
                  <unavailable/> <!-- Flag that matches when the reciever is unavailable (offline) -->
                  <from/>        <!-- Matches if the  sender's jid is the specified jid -->
                  <resource/>    <!-- Matches if the sender's resource (anything after the / in a jid) is the specified resource -->
                  <subject/>     <!-- Matches if the message's subject is the specified subject (no regex yet) -->
                  <body/>        <!-- Matches if the message body is the specified body (no regex yet) --> 
                  <show/>        <!-- Matches if the receiver's presence has a show tag that is the same as the specified text -->
                  <type/>        <!-- Matches if the type of the message is the same as the specified text ("normal" is okay) -->
                  <roster/>      <!-- Flag that matches when the sender is in the receiver's roster -->
                  <group/>       <!-- Matches when the sender is in the specified group -->
              </conditions>
              <actions>
                  <error/>       <!-- Sends back an error message to the sender, with the specified text -->
                  <offline/>     <!-- Flag that stores the message offline -->
                  <forward/>     <!-- forwards the message to the specified jid -->
                  <reply/>       <!-- Sends back a reply to the sender with the specified text in the body -->
                  <continue/>    <!-- Flag that continues rule matching, after a rule matches -->
                  <settype/>     <!-- Changes the type of message to the specified type, before delivery to the receiver -->
              </actions>
          </allow>
      </filter>

      <!-- The server vCard -->

      <vCard>
        <FN>Intranet Jabber Server</FN>
        <DESC>Jabberd 1.4.2</DESC>
        <URL>http://im.jabs.org/</URL>
      </vCard>
  
      <admin>
        <write>thor@im.jabs.org</write>
        <reply>
          <subject>Jabber Administrative Auto Reply</subject>
          <body>This is a special admin address. Your message was received and forwarded to server administrators.</body>
        </reply>
      </admin>

      
      <!--
      This enables the server to automatically update the 
      user directory when a vcard is edited.  The update is
      only sent to the private JUD service below.  It is
      safe to remove this flag if you do not want any users
      automatically added to the directory.
      -->

      <vcard2jud/>

   <browse>
        

    <service type="jud" jid="jud.im.jabs.org" name="Jabs.Org User Directory">
      <ns>jabber:iq:search</ns>
      <ns>jabber:iq:register</ns>
    </service>

    <item category="conference" type="public" jid="conference.im.jabs.org" name="Public Conferencing" version="0.5.2">
      <ns>jabber:iq:register</ns>
      <ns>gc-1.0</ns>
      <ns>http://jabber.org/protocol/muc</ns>
    </item>        

   </browse>

</jsm>

    <!--
    The following section dynamically loads the individual
    modules that make up the session manager. Remove or 
    comment out modules to disable them. Note that the order
    of modules is important, since packets are delivered 
    based on the following order!!
    -->

    <load main="jsm">
      <jsm>./jsm/jsm.so</jsm>
      <mod_echo>./jsm/jsm.so</mod_echo>
      <mod_roster>./jsm/jsm.so</mod_roster>
      <mod_time>./jsm/jsm.so</mod_time>
      <mod_vcard>./jsm/jsm.so</mod_vcard>
      <mod_last>./jsm/jsm.so</mod_last>
      <mod_version>./jsm/jsm.so</mod_version>
      <mod_announce>./jsm/jsm.so</mod_announce>
      <mod_agents>./jsm/jsm.so</mod_agents>
      <mod_browse>./jsm/jsm.so</mod_browse>
      <mod_admin>./jsm/jsm.so</mod_admin>
      <mod_filter>./jsm/jsm.so</mod_filter>
      <mod_offline>./jsm/jsm.so</mod_offline>
      <mod_presence>./jsm/jsm.so</mod_presence>
      <mod_auth_digest>./jsm/jsm.so</mod_auth_digest>
      <mod_auth_0k>./jsm/jsm.so</mod_auth_0k>
<!--  <mod_auth_plain>./jsm/jsm.so</mod_auth_plain>   (This disables plain-text logins) -->
      <mod_log>./jsm/jsm.so</mod_log>
<!--  <mod_register>./jsm/jsm.so</mod_register>       (This disables user registration) -->
      <mod_xml>./jsm/jsm.so</mod_xml>
    </load>

  </service>

  <!-- OK, we've finished defining the Jabber Session Manager. -->

  <!-- The <xdb/> component handles all data storage, using the filesystem. -->

  <xdb id="xdb">
    <host/>
    <load>
      <xdb_file>./xdb_file/xdb_file.so</xdb_file>
    </load>
    <xdb_file xmlns="jabber:config:xdb_file">
      <spool><jabberd:cmdline flag='s'>./spool</jabberd:cmdline></spool>
      <timeout>0</timeout>  <!-- This line allows script manipulation of user.xml files -->
    </xdb_file>
  </xdb>

  

  <service id="c2s">
    <load>
      <pthsock_client>./pthsock/pthsock_client.so</pthsock_client>
    </load>
    <pthcsock xmlns='jabber:config:pth-csock'>
      <authtime>60</authtime>
      <karma>
        <init>10</init>
        <max>10</max>
        <inc>1</inc>
        <dec>1</dec>
        <penalty>-6</penalty>
        <restore>10</restore>
      </karma>

      <ip port="5222">127.0.0.1</ip> <!-- This allows non-SSL connections on loopback only -->
      <ssl port="5223">172.17.77.2</ssl> <!-- This allows SSL connections to my eth0 port -->   
    
    </pthcsock>
  </service>
  
  <!-- 
  This is the default server error logging component, 
  which copies to a file and to STDERR. 
  -->

  <log id='elogger'>
    <host/>
    <logtype/>
    <format>%d: [%t] (%h): %s</format>
    <file>/var/log/jabberd/error.log</file>
    <stderr/>
  </log>

  <!-- 
  This is the default server record logging component, 
  which logs general statistical/tracking data. 
  -->

  <log id='rlogger'>
    <host/>
    <logtype>record</logtype>
    <format>%d %h %s</format>
    <file>/var/log/jabberd/record.log</file>
  </log>


  <service id='conference.im.jabs.org'>
    <load>
      <conference>./mu-conference-0.5.2/src/mu-conference.so</conference>
    </load>
    <conference xmlns="jabber:config:conference">
      <roomlock/>    <!-- This keeps non-admin users from creating chat rooms -->
      <persistent/>  <!-- This makes admin-created chat rooms permanent -->
      <public/>
      <vCard>
        <FN>Public Chatrooms</FN>
        <DESC>Public Chatrooms at Jabs.Org</DESC>
        <URL>http://conference.im.jabs.org/</URL>
      </vCard>
      <history>40</history>
      <logdir>/var/log/jabberd/</logdir>
      <sadmin>
	<user>thor@im.jabs.org</user>
      </sadmin>
      <notice>
        <join>has joined</join>
        <leave>has left</leave>
        <rename>is now known as</rename>
      </notice>
    </conference>
  </service>


  <service id="jud">
    <host>jud.im.jabs.org</host>
    <load><jud>./jud-0.5/jud.so</jud></load>
    <jud xmlns="jabber:config:jud">
    <vCard>
      <FN>User Directory on IM.Jabs.Org</FN>
      <DESC>This provides a simple user directory service.</DESC>
      <URL>http://jud.im.jabs.org/</URL>
    </vCard>
    </jud>
  </service>


  <!--
  The following <io/> config initializes the top-level
  I/O, otherwise known as MIO (Managed Input/Output).
  -->

  <io>

    <rate points="5" time="25"/>
   
    <ssl>
      <key ip='172.17.77.2'>/usr/local/jabber/key.pem</key>
    </ssl>
    
  </io>

  <!--
  This specifies the file to store the pid of the process in.
  -->

  <pidfile>/var/run/jabberd/jabberd.pid</pidfile>


</jabber>
