<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE lire:dlf-schema PUBLIC
  "-//LogReport.ORG//DTD Lire DLF Schema Markup Language V1.1//EN"
  "http://www.logreport.org/LDSML/1.1/ldsml.dtd">
<lire:dlf-schema superservice="email" timestamp="time"
 xmlns:lire="http://www.logreport.org/LDSML/">

 <lire:title>DLF Schema for Email service</lire:title>

 <lire:description>
  <para>The <type>email</type> DLF schema represents delivery done by
   an mail transfer agent between one <emphasis>one</emphasis>
   recipient. Each DLF record contains the information related to the
   process of delivering between one sender and one recipient. Each
   exchange between one sender and one recipient will results in
   <emphasis>one and only one</emphasis> DLF record. If one sender is
   sending to multiple recipients, the DLF file should contains one
   record for each recipient.
  </para>

  <warning>
   <para>This DLF schema is different from the other ones because it
   contains pre-analysed data. It is currently in redesign and will
   become something that will more closely resemble what you can
   usually find in an email log file. Different information for each
   phase of the mail delivery process.</para>
   <para>That schema will probably become a derived schema from the
    new base schema. 
   </para>
  </warning>
 </lire:description>

 <lire:field name="time" type="timestamp" label="Timestamp">
  <lire:description>
   <para>The time of the first event regarding that delivery. That
    should be the time the email enter the delivery process.
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="logrelay" type="hostname" label="Server">
  <lire:description>
   <para>The hostname on which the MTA is running.</para>
   <warning>
    <para>That original intent of that field was to analyse email
     servers' farm which used syslog to centralize their logs. This
     method of analysis for multiple servers was never actually used
     and is considerd obsolete.
    </para>
   </warning>
  </lire:description>
 </lire:field>

 <lire:field name="queueid" type="string" label="Queue ID">
  <lire:description>
   <para>The queue identifier. This should be the identifier that can
    be used to reconstitute the delivery process from the native log
    file regarding the delivery that this DLF record represents.
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="msgid" type="string" label="Message ID">
  <lire:description>
   <para>The content of the <type>Message-ID</type> header of the
    delivered message.
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="from_user" type="string" label="Sender's User">
  <lire:description>
   <para>The local part of the sender's email address.</para>
  </lire:description>
 </lire:field>

 <lire:field name="from_domain"	type="hostname" label="Sender's Domain">
  <lire:description>
   <para>The hostname of the sender's email address.</para>
  </lire:description>
 </lire:field>

 <lire:field name="from_relay_host" type="hostname" label="Sending Relay">
  <lire:description>
   <para>The hostname from which the email was received. For email
    submitted via the <command>sendmail</command> interface or other
    similar mechanism, this should be <literal>localhost</literal>.
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="from_relay_ip" type="ip" default="Sending Relay IP">
  <lire:description>
   <para>The ip address from which the email was received. For email
    submitted via the <command>sendmail</command> interface or other
    similar mechanism, this should be <literal>127.0.0.1</literal>.
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="size" type="bytes" label="Size">
  <lire:description>
   <para>The size of the message.</para>
  </lire:description>
 </lire:field>

 <lire:field name="delay" type="duration" label="Delivery Time">
  <lire:description>
   <para>The time that it took to deliver the message. This should be
    equivalent to the time of the delivery event minus the value of
    the <structfield>time</structfield> field.
    </para>
   </lire:description>
 </lire:field>

 <lire:field name="xdelay" type="duration" label="Delivery Time">
  <lire:description>
   <warning>
    <para>This field was never actually used and is obsolete.</para>
   </warning>
  </lire:description>
 </lire:field>

 <lire:field name="to_user" type="string" label="Recipient's User">
  <lire:description>
   <para>The local part of the recipient's email address.</para>
  </lire:description>
 </lire:field>

 <lire:field name="to_domain" type="hostname" label="Recipient's Domain">
  <lire:description>
   <para>The hostname of the recipient's email address.</para>
  </lire:description>
 </lire:field>

 <lire:field name="to_relay_host" type="hostname" label="Receiving Relay">
  <lire:description>
   <para>The hostname to which the email was delivered. If the
    recipient is a local user and this was the "final" delivery, this
    should be <literal>localhost</literal>.
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="to_relay_ip"	type="ip" label="Receiving Relay IP">
  <lire:description>
   <para>The ip address to which the email was delivered. If the
    recipient is a local user and this was the "final" delivery, this
    should be <literal>127.0.0.1</literal>.
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="stat" type="string" label="Status">
  <lire:description>
   <para>The status code of the delivery. Only standardized code are
    <literal>sent</literal> which is used when the delivery succeeded
    without error and <literal>deferred</literal> for when the email
    still wasn't delivered at the end of the log file. Other values
    are specific to each service.
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="xstat" type="string" default="Status">
  <lire:description>
   <para>The complete native status message related to the email's
    delivery. 
   </para>
  </lire:description>
 </lire:field>

</lire:dlf-schema>
