<!--%%INCLUDE "i_defaulthead.incl" ("PolluStop Learning access")-->
   <form action="learn" method="post">

   <fieldset><legend>Learning requests</legend>
      <p class="explain">Learning requests are messages re-sent to PolluStop, instructing it to re-classify them if they were originally incorrectly identified as either Spam or Good mail.</p>
      <p class="explain">Learning requests can be used by PolluStop to fine-tune the database and add whitelisting or blacklisting entries.</p>

      <fieldset><legend>Full learning request</legend>
      <p class="explain">Full learning request methods:</p>
      <ul class="explain">
         <li>Message dropped in one of the IMAP drop boxes</li>
         <li>Message sent as attachment to <span class="dyn">prefix</span>@%%domainname%%</li>
         <li>Message copied in one of the filesystem drop boxes (admin only)</li>
      </ul>
      <p class="explain">Using one of these methods will allow PolluStop to automatically determine the training destination based on the X-PolluStop-Diagnostic header of the message, and perform white/blacklisting if desired.</p>
      <p class="explain">Only messages which already passed through the filter can be used for re-classification and white/blacklisting.</p>
      <p class="explain">When a message is copied in a drop box, PolluStop will use the original recipients list (X-Orig-Recipients header) of the message to determine if the message can be used for training.</p>
      <p class="explain">Note that this function doesn't control who can <em>access</em> the drop box, you need to use the mailbox ACL in Communigate for that.</p>
      <p>When using IMAP drop mailboxes or Attachment forwarding:</p>
      <ul style="list-style:none; margin:0; padding:0">
         <li>Allow <select onchange="DispRightBox()" name="learn_db" class="lr"><!--%%ENUMMENU settings.learn_db DEFAULT defaultsettings.learn_db in learnrights DISPLAY learnrightnames--></select> to train the database</li>
         <li>Allow <select onchange="DispRightBox()" name="learn_gl" class="lr"><!--%%ENUMMENU settings.learn_gl DEFAULT defaultsettings.learn_gl in learnrights DISPLAY learnrightnames--></select> to populate the global whitelist/blacklist
             <div id="disp_global_sent_to" style="margin-left:200px; <!--%%IF EQUALS(settings.learn_gl AND "nobody")-->display:none<!--%%ENDIF-->"><label><input type="checkbox" name="learn_st" <!--%%IF NOT(EQUALS(settings.learn_gl AND "nobody"))-->%%CHECKED(settings.learn_st)%%<!--%%ENDIF--> value="1" /> include "sent-to" addresses</label></div>
         </li>
         <li>Allow <select onchange="DispRightBox()" name="learn_pl" class="lr"><!--%%ENUMMENU settings.learn_pl DEFAULT defaultsettings.learn_pl in learnrights DISPLAY learnrightnames--></select> to populate their personal whitelist/blacklist</li>
      </ul>
      </fieldset>

      <fieldset><legend>Partial learning request</legend>
         <p class="explain">Partial learning request methods:</p>
         <ul class="explain">
            <li>Message forwarded to <span class="dyn">prefix</span>-good@%%domainname%%</a> or <span class="dyn">prefix</span>-spam@%%domainname%%</li>
         </ul>
         <p class="explain">Using one of these methods will not allow PolluStop do perform white/blacklisting since it does not have access to the original message headers.</p>
         <p class="explain">Using the Full learning request methods will gives better results than the Partial learning request methods, because PolluStop have access to more original information with the Full methods.</p>
         <p>Allow <select onchange="DispRightBox()" name="learn_fw" class="lr"><!--%%ENUMMENU settings.learn_fw DEFAULT defaultsettings.learn_fw in learnrights DISPLAY learnrightnames--></select> to train the database using the simple forward method</p>
      </fieldset>

      <fieldset><legend>Prefix <input type="text" name="learn_prefix" value="%%HTML:SETTINGS("learn_prefix")%%" size="11" maxlength="20" /></legend>
         <p class="explain">The "Prefix" attribute represents the beginning of the "email address" of the filter.</p>
         <p class="explain">Setting it, for instance, to "pollustop", users will have to send their learning requests to "pollustop-good@%%domainname%%" and "pollustop-spam@%%domainname%%", or send them as an attachment to "pollustop@%%domainname%%".</p>
      </fieldset>
   </fieldset>

   <fieldset id="rights_box"><legend>Selected addresses with special learn rights</legend>
      <p class="explain">Addresses with special rights to send learning requests specified above ('selected addresses')</p>
      <fieldset><legend>Domains:</legend>
      <ul class="domainlist" style="margin:8px 0 8px 0; padding:0; list-style:none"><!--%%FORALL dom IN domains-->
         <li>
            <label><input type="checkbox" name="learn_accept" %%CHECKED(CONTAINS(dom[] in settings.learn_accept))%% value="%%HTML:dom[]%%" />
            <!--%%IF EQUALS(dom[] AND domainname)--><b><!--%%ENDIF-->%%dom[]%%<!--%%IF EQUALS(dom[] AND domainname)--></b><!--%%ENDIF--></label>
         </li><!--%%ENDFOR dom-->
      </ul>
      </fieldset>
      <fieldset><legend>Accounts:</legend>
         <p class="explain">FULL account names only (user@domain), no aliases</p>
         <ul style="list-style:none; margin:0; padding:0" id="learn_accept_list"><!--%%FORALL dom IN settings.learn_accept--><!--%%IF CONTAINS("@" IN dom[])-->
         <li><input type="text" size="40" name="learn_accept" value="%%HTML:dom[]%%" /></li><!--%%ENDIF--><!--%%ENDFOR dom-->
         <li><input type="text" size="40" name="learn_accept" value="" /></li>
         </ul>
         <div class="link" onclick="AddBox('learn_accept_list')">Add</div>
      </fieldset>
   </fieldset>

   <fieldset><legend>Error replies</legend>
      <p class="explain">If an unauthorized account copies a message in a Drop box, the message will be ignored and deleted. The message owner will not be notified, and a log line will be generated.</p>

      <fieldset><legend>&quot;Unauthorized&quot; Reply</legend>
         <p class="explain">If an unauthorized account sends a learning request, PolluStop will bounce the message with this error text (text only):</p>
         <p><textarea cols="60" rows="5" name="learn_unauthorizedmessage">%%SETTINGS("learn_unauthorizedmessage")%%</textarea></p>
         <select name="learn_ignoreunauthorized"><!--%%BOOLMENU settings.learn_ignoreunauthorized DEFAULT defaultsettings.learn_ignoreunauthorized DISPLAY yesno--></select> Ignore unauthorized messages, simply discard them instead of bouncing with an error.
      </fieldset>

      <fieldset><legend>&quot;Multiple recipients&quot; Reply</legend>
         <p class="explain">If an authorized account sends a learning request but specifies multiple recipients, PolluStop will bounce the message with this error text (text only):</p>
         <p><textarea cols="60" rows="5" name="learn_multiplerecipients">%%SETTINGS("learn_multiplerecipients")%%</textarea></p>
         <select name="learn_ignoremultiple"><!--%%BOOLMENU settings.learn_ignoremultiple DEFAULT defaultsettings.learn_ignoremultiple DISPLAY yesno--></select> Ignore messages with multiple recipients, simply discard them instead of bouncing.
      </fieldset>

      <fieldset><legend>&quot;Learn error&quot; Reply</legend>
         <p class="explain">If a message is not sent as an attachment to <span class="dyn">prefix</span>@%%domainname%%, if the message doesn't contain X-PolluStop-Diagnostic or Return-Path headers, PolluStop will bounce the message with this error text (text only):</p>
         <p class="explain">You can use the following macros in the reply message: %sender%, %learnaddress%, %learngoodaddress%, %learnspamaddress%</p>
         <p><textarea cols="60" rows="5" name="learn_errormessage">%%SETTINGS("learn_errormessage")%%</textarea></p>
         <p><select name="learn_ignoreallerrors"><!--%%BOOLMENU settings.learn_ignoreallerrors DEFAULT defaultsettings.learn_ignoreallerrors DISPLAY yesno--></select> Ignore all erroneous messages, simply discard them instead of bouncing with an error.</p>
         <p class="explain">If the message was initially considered as direct reply, blacklisted or whitelisted by PolluStop, the message is ignored.</p>
      </fieldset>
   </fieldset>

   <p><input type="hidden" name="Apply" value="" />
   <input type="submit" value="Save settings" /></p>
   <script type="text/javascript">
      var l_DynFields = [];
      var l_Field;
      for (var i = 0; (l_Field = document.getElementsByTagName("span")[i]); ++i)
      {
         if (l_Field.className == "dyn")
         {
            l_DynFields.push(l_Field);
         }
      }
      window.m_TextField = document.getElementsByName("learn_prefix")[0];
      m_TextField.onkeydown = TextOnKeyPress;
      RefreshDyn();

      function TextOnKeyPress()
      {
         setTimeout(RefreshDyn, 50);
      }
      function RefreshDyn()
      {
         var l_DynText = m_TextField.value;
         if (!l_DynText.length) l_DynText = "[prefix]";
         var l_Field;
         for (var i = 0; (l_Field = l_DynFields[i]); ++i)
         {
            l_Field.innerHTML = l_DynText;
         }
      }
      function DispRightBox()
      {
         var l_Form = document.forms[0];
         document.getElementById("rights_box").style.display =
            (  (l_Form.learn_db.selectedIndex == 1)
            || (l_Form.learn_gl.selectedIndex == 1)
            || (l_Form.learn_pl.selectedIndex == 1)
            || (l_Form.learn_fw.selectedIndex == 1))
         ? "" : "none";
         document.getElementById("disp_global_sent_to").style.display = l_Form.learn_gl.selectedIndex > 0 ? "" : "none";
      }
      DispRightBox();
   </script>
   </form>
<!--%%INCLUDE "i_defaultfoot.incl"-->

