<!-- $Id$ -->
<chapter id="scripts">
    <title>Scripts</title>
       <sect1 id="scripts-install">
        <title>Installation</title>
        <para>Configuration of each Perl script should be enclosed in appropriate section of
<filename>lms.ini</filename> file. Scripts should be taken from <filename>lms/bin/</filename>
directory and placed in <filename>/usr/sbin</filename>. After the move, you have to include them in
your crontab, so that they will be executed automatically, which is probably what you want to
do.</para>
        <para>For example crontab entry which will execute lms-payments script each day one minute
after midnight should take a form of:</para>
        <screen>
1 0 * * *       /usr/sbin/lms-payments 1 &gt; /dev/null</screen>
        <para>You should read <command>man crontab</command> to learn how to exactly schedule your
scripts.</para>
	<para>Most LMS scripts have following command line options: </para>
	<screen>
-C file     location and name of alternative configuration, default: /etc/lms/lms.ini
-q          run script without any output
-h          help (usually list of valid command line options)
-v          information about script version</screen>
       </sect1>
       <sect1 id="scripts-list">
       <title>List of available scripts</title>
	    <table id="scripts-table">
		<title>Executable scripts list</title>
		<tgroup cols="2">
		<colspec ALIGN="center" COLWIDTH="200">
		<colspec ALIGN="center" COLWIDTH="300">
		    <thead>
			<row>
			<entry>Name</entry>
			<entry>Description</entry>
			</row>	
		    </thead>
		    <tbody>
			<row>
			<entry><xref linkend="lms-notify"></entry>
			<entry>Massive mailing for customer notification about debt, new invoice, etc.</entry>
			</row>
			<row>
			<entry><xref linkend="lms-notify-sms"></entry>
			<entry>SMS Notifications about customers deb, new invoice, etc.</entry>
			</row>
			<row>
			<entry><xref linkend="lms-cutoff"></entry>
			<entry>Cutoff of customers who are in debt</entry>
			</row>
			<row>
			<entry><xref linkend="lms-etherdesc"></entry>
			<entry>MAC address - hostname pair file creation for iptraf</entry>
			</row>
			<row>
			<entry><xref linkend="lms-payments"></entry>
			<entry>Accounting subscription fees (periodical) with invoice writeouts</entry>
			</row>
			<row>
			<entry><xref linkend="lms-traffic"></entry>
			<entry>Bandwidth consumption calculation</entry>
			</row>
			<row>
			<entry><xref linkend="lms-traffic-logiptables"></entry>
			<entry>Bandwidth probe with iptables</entry>
			</row>
			<row>
			<entry>lms-makearp</entry>
			<entry>ARP table (/etc/ethers) creation</entry>
			</row>
			<row>
			<entry><xref linkend="lms-makedhcpconf"></entry>
			<entry>DHCP server configuration (dhcpd.conf)</entry>
			</row>
			<row>
			<entry><xref linkend="lms-makeiptables"></entry>
			<entry>Configuration of iptables firewall rules</entry>
			</row>
			<row>
			<entry>lms-makeipchains</entry>
			<entry>Configuration of ipchains firewall rules</entry>
			</row>
			<row>
			<entry>lms-makeopenbsdpf</entry>
			<entry>Configuration of OpenBSD packet filter rules</entry>
			</row>
			<row>
			<entry>lms-makeoidentconf</entry>
			<entry>Configuration of oident</entry>
			</row>
			<row>
			<entry><xref linkend="lms-sendinvoices"></entry>
			<entry>Distribution of invoices to customers</entry>
			</row>
			<row>
			<entry><xref linkend="lms-makemacs"></entry>
			<entry>Firewalling with use of source MAC addresses</entry>
			</row>
			<row>
			<entry><xref linkend="lms-makehosts"></entry>
			<entry>/etc/hosts file creation</entry>
			</row>
			<row>
			<entry><xref linkend="lms-makewarnings"></entry>
			<entry>Redirect rules for customers in debt</entry>
			</row>
			<row>
			<entry><xref linkend="lms-makemessages"></entry>
			<entry>Redirect rules for customers in debt with warning message</entry>
			</row>
			<row>
			<entry><xref linkend="lms-fping"></entry>
			<entry>Online nodes scan</entry>
			</row>
			<row>
			<entry><xref linkend="lms-rtparser"></entry>
			<entry>Helpdesk backend for MUA</entry>
			</row>
		    </tbody>	
		</tgroup>
	    </table>
       </sect1>
       <sect1 id="scripts-config">
    	    <title>Description and configuration</title>
	<sect2 id="lms-notify" xreflabel="lms-notify">
	<title>lms-notify</title>
		<para>lms-notify it's a perfect tool to remind your customers that they are actually the ones who
    		cover all your network and WAN links costs. It makes you possible to create numerous text templates
		for various occasions and use them for mailing your customers. For SMTP connection Mail::Sender 
		module is used.</para>
		<sect3 id="lms-notify-templates">
		<title>Templates</title>
			<para>You can use following variables in your templates:</para>
			<itemizedlist>
			<listitem>
				<para>%date-m - will be substituted with current month in numerical form with leading zero, eg. 02</para>
			</listitem>
			<listitem>
				<para>%date-y - will be substituted with current year, eg. 2003</para>
			</listitem>
			<listitem>
				<para>%date_month_name - will be substituted with current month name, eg. March</para>
			</listitem>
			<listitem>
				<para>%saldo - will be substituted with current customer balance, eg. 535</para>
		        </listitem>
			<listitem>
				<para>%abonament - will be substituted with customer's subscription fee, eg. 107</para>
			</listitem>
			<listitem>
				<para>%b - customer balance with opposite sign, eg. 107</para>
			</listitem>
			<listitem>
				<para>%B - customer balance with real sign, eg. -107</para>
			</listitem>
			<listitem>
				<para>%pin - PIN code of the customer</para>
			</listitem>
			<listitem>
				<para>%cid - customer ID</para>
			</listitem>
			<listitem>
				<para>%number - document number (invoices, debit notes and deadline notifies only)</para>
			</listitem>
			<listitem>
				<para>%value - invoice value (invoices and deadline notifies only)</para>
			</listitem>
			<listitem>
	    			<para>%last_10_in_a_table - list of last 10 operations on customer's account, eg.</para>
			</listitem>
			</itemizedlist>
			<example id="notify-example">
			<title>Lms-notify: example of last 10 customer's operations</title>
<screen>
-----------+------------------------------------------------------+---------
2003-02-02 | Subscription for month 2003/02                       |  107.00
2003-02-01 | Payment                                              | -107.00
2003-02-01 | Subscription for month 2003/02                       |  107.00
2003-02-01 | Payment                                              | -321.00
2003-01-31 | Subscription for month 2003/01                       |  107.00
2003-01-31 | Subscription for month 2003/01                       |  107.00
2003-01-31 | Subscription for month 2003/01                       |  107.00
-----------+------------------------------------------------------+---------
</screen></example>
			<example id="notify-template">
        		<title>Lms-notify: example of mailing template</title>
<screen>NOTE: This message has been generated automatically.

We kindly remind that you have debt on your internet service provide account 
for the amount of $ %B.

If you have already regulated your subscription fees for current month, that
is %date-m %date-y, please just skip this message.

If you think this message was sent to you in error, please contact our
customer service representative.

All information about payments could be also found at:
http://bigpro.com/myAccount/

If you want to regulate your account status, please contact our accountant:

Aldfert Rule
phone: 0-509031337
e-mail: alde@staff.bigpro.com

Garmund Cooper
phone: 0-606666666
e-mail: gcooper@free.bigpro.com

PS. Last 10 operations on your account has been attached below for your
convenience.

Date       | Description                                          | Amount
%last_10_in_a_table

--
Big and Professional Internet Provider, BigPro ISP
http://www.bigpro.com/</screen></example>
    		</sect3>
		<sect3 id="lms-notify-config">
		<title>Configuration</title>
        		<para>Configuration of lms-notify should be set in
			<filename>lms.ini</filename> file, <emphasis>[notify]</emphasis> section.
			Following parameters are valid (also in <xref linkend="lms-notify-sms">):</para>
			<itemizedlist>
				<listitem>
					<para>debtors_template</para>
					<para>Lets you setup message template which will be sent to debted customers. Default: none.</para>
					<para>Example:	<prompt>debtors_template = /etc/lms/debtors_template.txt</prompt></para>
        			</listitem>
    				<listitem>
					<para>debtors_subject</para>
					<para>Lets you set subject of message to debtors. Default: 'Debtors notification'.</para>
					<para>Example:	<prompt>debtors_subject = Debt information</prompt></para>
				</listitem>
				<listitem>
					<para>invoices_template</para>
					<para>The message template which will be sent to customers if new invoice is created
					(in last 24 hours). Default: none.</para>
					<para>Example:	<prompt>invoices_template = /etc/lms/invoices_template.txt</prompt></para>
        			</listitem>
    				<listitem>
					<para>invoices_subject</para>
					<para>Subject of 'invoices' message. Default: 'New invoice notification'.</para>
					<para>Example:	<prompt>invoices_subject = Invoice information</prompt></para>
				</listitem>
				<listitem>
					<para>notes_template</para>
					<para>The message template which will be sent to customers if new debit note is created
					(in last 24 hours). Default: none.</para>
					<para>Example:	<prompt>notes_template = /etc/lms/notes_template.txt</prompt></para>
        			</listitem>
    				<listitem>
					<para>notes_subject</para>
					<para>Subject of 'notes' message. Default: 'New debit note notification'.</para>
					<para>Example:	<prompt>notes_subject = Debit note information</prompt></para>
				</listitem>
				<listitem>
					<para>deadline_template</para>
					<para>Lets you setup message template which will be sent to debted customers
					when (not payed) invoice reaches paytime. Default: none.</para>
					<para>Example:	<prompt>deadline_template = /etc/lms/deadline_template.txt</prompt></para>
        			</listitem>
    				<listitem>
					<para>deadline_subject</para>
					<para>Subject of 'deadline' message. Default: 'Invoice deadline notification'.</para>
					<para>Example:	<prompt>deadline_subject = Deadline information</prompt></para>
				</listitem>
    				<listitem>
				        <para>limit</para>
					<para>Lets you setup limit of customer debt. The message will be sent if
					customer balance is below that value. Default: limit = 0</para>
					<para>Example:	<prompt>limit = -20</prompt></para>
				</listitem>
			</itemizedlist>
			<para>And list of options for mailing only:</para>
			<itemizedlist>
        			<listitem>
        				<para>mailfrom (mandatory)</para>
        				<para>Lets you setup email of the sender. Default: none.</para>
        				<para>Example:	<prompt>mailfrom = staff@bigpro.com</prompt></para>
        			</listitem>
        			<listitem>
            				<para>mailfname</para>
        				<para>Sender name. Default: none</para>
        				<para>Example:	<prompt>mailfname = Administrators</prompt></para>
        			</listitem>
        			<listitem>
        				<para>smtp_host</para>
        				<para>SMTP server to be used when sending emails. Default: localhost</para>
        				<para>Example:	<prompt>smtp_host = smtp.bigpro.com</prompt></para>
        			</listitem>
        			<listitem>
        				<para>smtp_auth</para>
        				<para>SMTP authorization type. Allowed values: 
					LOGIN, PLAIN, CRAM-MD5, NTLM. Default: none</para>
        				<para>Example:	<prompt>smtp_auth = LOGIN</prompt></para>
        			</listitem>
        			<listitem>
        				<para>smtp_user</para>
        				<para>Login for SMTP authorization. Default: none</para>
        				<para>Example:	<prompt>smtp_user = admin</prompt></para>
        			</listitem>
        			<listitem>
        				<para>smtp_pass</para>
        				<para>Password for SMTP authorization. Default: none</para>
            				<para>Example:	<prompt>smtp_pass = password</prompt></para>
        			</listitem>
        			<listitem>
        				<para>debug_email (optional)</para>
        				<para>Email address for debugging. All email will be sent to this address instead of sending to real customers. Default: not set.</para>
        				<para>Example:	<prompt>debug_email = lexx@domain.pl</prompt></para>
        			</listitem>
        		</itemizedlist>
    		</sect3>
	</sect2>
	<sect2 id="lms-notify-sms" xreflabel="lms-notify-sms">
	<title>lms-notify-sms</title>
		<para>lms-notify-sms it's a <xref linkend="lms-notify"> equivalent, but it's intended to
		send reminders via SMS. Actually it supports smstools and gnokii services.
		Use <emphasis>[sms]</emphasis> section for SMS Service configuration.</para>
        	<para>Configuration of lms-notify-sms should be set in
		<filename>lms.ini</filename> file, <emphasis>[notify-sms]</emphasis> section.
		Here you can use all <xref linkend="lms-notify"> options plus:</para>
		<itemizedlist>
    			<listitem>
				<para>service</para>
				<para>Allows you to overwrite SMS service option from <emphasis>[sms]</emphasis> section.
				Default: empty</para>
				<para>Example:	<prompt>service = smstools</prompt></para>
			</listitem>
		</itemizedlist>
	</sect2> 
	<sect2 id="lms-cutoff" xreflabel="lms-cutoff">
	 <title>lms-cutoff</title>
	 <para>This script allows to cutoff (actually mark as cutoff in
	database and cutting off should be performed by one of firewall rules creation
	script) customers whose debt is below some defined value.</para>
         <para>Configuration of lms-cutoff should be set in
	<filename>lms.ini</filename> file, <emphasis>[cutoff]</emphasis> section.
	Following parameters are valid:</para>
	 <itemizedlist>
          <listitem>
	   <para>limit (optional)</para>
	   <para>Lets you setup limit of customer debt. Customer will be marked as disconnected below that value. Default: 0</para>
	   <para>Example:	<prompt>limit = -20</prompt></para>
	  </listitem>
	  <listitem>
	   <para>message (optional)</para>
	   <para>If not empty, that message will be written to warning message field in customer record 
	   after cutting him off.  You can use %now variable - it will be replaced by current date, and 
	   %b and %B like in lms-notify script.
	   Default: 'Automatic cutoff caused by exceeding of liabilities limit on %now'</para>
	   <para>Example:	<prompt>message = ''</prompt></para>
	  </listitem>
	 </itemizedlist>
	</sect2>
	<sect2 id="lms-payments" xreflabel="lms-payments">
	 <title>lms-payments</title>
	 <para>This script is being used to calculate and account subscription
and solid (fixed) fees. It also accounts your company liabilities and makes
invoices. You should allow it to run daily if you want it to make it work done
well.</para>
	 <para>This scripts may be configured with two options related to
invoices in <emphasis>[payments]</emphasis> section of
<filename>lms.ini</filename> file:</para>
	  <itemizedlist>
          <listitem>
	   <para>deadline (optional)</para>
	   <para>Payment deadline in days. Default: 14</para>
	   <para>Example:	<prompt>deadline = 7</prompt></para>
	  </listitem>
	  <listitem>
	   <para>paytype (optional)</para>
	   <para>Payment type identifier (1-cash, 2-transfer, 3-transfer/cash,
	        4-card, 5-compensation, 6-barter, 7-contract). Default: 2</para>
	   <para>Example:	<prompt>paytype = 1</prompt></para>
	  </listitem>
	  <listitem>
	   <para>suspension_description (optional)</para>
	   <para>Suspension description for suspended liabilities added at the end of comment. 
	   Default: ''</para>
	   <para>Example:	<prompt>suspension_description = '(suspension)'</prompt></para>
	  </listitem>
	  <listitem>
	   <para>comment (optional)</para>
	   <para>Description on invoice attached to every periodical assigment</para>
	   <para>Default: '%tariff subscription for period %period'</para>
	   <para>Some keywords are substitiuted:</para>
	   <para>%tariff - subscription name</para>
	   <para>%period - period (counted from current day to the last in cycle, in YYYY/MM/DD format)</para>
	   <para>%current_month - period form 1st day of current month to the last day</para>
	   <para>%current_period - current month in MM/YYYY format</para>
	   <para>%next_period - next month in MM/YYYY format</para>
	   <para>%prev_period - previous month in MM/YYYY format</para>
	   <para>%desc - tariff description</para>
	   <para>Example:	<prompt>comment = 'Subscription for %current_month'</prompt></para>
	  </listitem>
	  <listitem>
	   <para>settlement_comment (optional)</para>
	   <para>Description of settlement.</para>
	   <para>Default set to <prompt>comment</prompt> option contents.</para>
	   <para>Example:	<prompt>settlement_comment = 'Settlement for %period'</prompt></para>
	  </listitem>
	 </itemizedlist>
         <para>Script has also one useful command line parameter: <prompt>--fakedate</prompt>
         (<prompt>-f</prompt>). With this option you can make that script will execute
         with system date (in format YYYY/MM/DD) other that current, eg.
         <prompt>--fakedate=2004/10/10</prompt>.</para>
        </sect2>
    <sect2 id="lms-traffic" xreflabel="lms-traffic">
    <title>lms-traffic</title>
    <para>This script is an interface between your application and LMS
database and is intended to gather bandwidth usage statistics. You should
provide number of bytes received and sent by each computer, which will be
stored in LMS DB next to computer id and current timestamp. It's up to you how
often this configuration will be refreshed, just remember to set your
application to refresh its data in similar interval. Best sources of data are
iptables or ipchains. You can also use external program, eg. ipfm.</para>
    <para>Browsing gathered statistics with several filtering capabilities is
available in LMS-UI in main menu, menu 'Statistics'.
    </para>
    	<sect3 id="lms-traffic-config">
	    <title>Installation</title>
	    <para>Before you can run lms-traffic you need to create data file
which will be read in. Format of the file should be as follows:</para>
	    <screen>
&lt;IP_address&gt; &lt;n_of_spaces&gt; &lt;upload_bytes&gt; &lt;n_of_spaces&gt; &lt;download_bytes&gt;
&lt;IP_address&gt; &lt;n_of_spaces&gt; &lt;upload_bytes&gt; &lt;n_of_spaces&gt; &lt;download_bytes&gt;
...</screen>
	    <para><note><para>Example script utilizing iptables might be found
in <filename>sample/traffic_ipt.pl</filename> file.</para></note></para>
	    <para>Next you should install lms-traffic script and your custom
script into crontab. Among standard options you can use define location with
created data file.
	    <screen>
-f=/file 	location and name of data file, default: /var/log/traffic.log</screen>
	    <warning><para>Frequency checks should be set not higher than 10
minutes, due that each execution will write new database record for each
computer. Thus, statistics database might grow fast and it might take longer
to generate desired statistics.</para></warning>
	    </para>
	</sect3>
    </sect2>
    <sect2 id="lms-traffic-logiptables" xreflabel="lms-traffic-logiptables">
	<title>lms-traffic-logiptables</title>
	<para>This script uses iptables to gather received and sent data
statistics for each computer. Data is being read from firewall rules, which
are created on-the-fly. Thus, you are not responsible for setting appropriate
rules or running custom statistics collector (eg.
<filename>lms-traffic</filename>).
	</para>
        <para>Configuration of lms-traffic-logiptables should be set in
<filename>lms.ini</filename> file, <emphasis>[traffic-logiptables]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
           	<listitem>
		    <para>outfile</para>
		    <para>Location of file with iptables rules. Default: /etc/rc.d/rc.stat</para>
		    <para>Example:	<prompt>outfile = /etc/rc.d/rc.stat</prompt></para>
		</listitem>
           	<listitem>
		    <para>iptables_binary</para>
		    <para>Location of iptables binary. Default: /usr/sbin/iptables</para>
		    <para>Example:	<prompt>iptables_binary = /usr/local/sbin/iptables</prompt></para>
		</listitem>		
           	<listitem>
		    <para>wan_interfaces</para>
		    <para>Interface(s) name(s) that should be considered.  Default: not defined.</para>
		    <para>Example:	<prompt>wan_interfaces = eth0</prompt></para>
		</listitem>
           	<listitem>
		    <para>local_ports</para>
		    <para>List of source/destination ports for packet counting. Default: not defined.</para>
		    <para>Example:	<prompt>local_ports = 80</prompt></para>
		</listitem>
           	<listitem>
		    <para>script_owneruid</para>
		    <para>UID of 'outfile' script owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>script_owneruid = 0</prompt></para>
		</listitem>
        	<listitem>
		    <para>script_ownergid</para>
		    <para>GID of 'outfile' script owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>script_ownergid = 0</prompt></para>
		</listitem>
	    	<listitem>
		    <para>script_permission</para>
		    <para>Permissions of 'outfile' script. Default: 700 (rwx------).</para>
		    <para>Example:	<prompt>script_permission = 700</prompt></para>
		</listitem>
    		<listitem>
		    <para>networks</para>
		    <para>List of (space separated) networks, that should be
		    considered while creating configuration file. If unset, configuration will
		    include all networks.</para>
		    <para>Example:	<prompt>networks = public-custa public-custb</prompt></para>
		</listitem>
	    </itemizedlist>
    </sect2>
    <sect2 id="lms-makedhcpconf" xreflabel="lms-makedhcpconf">
	<title>lms-makedhcpconf</title>
	<para>This module creates DHCP configuration script - dhcpd.conf.</para> 
        <para>Configuration of lms-makedhcpconf should be set in
<filename>lms.ini</filename> file, <emphasis>[dhcp]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
           	<listitem>
		    <para>config_file</para>
		    <para>Output file location. Default: /etc/dhcpd.conf</para>
		    <para>Example:	<prompt>config_file = /tmp/dhcpd.conf</prompt></para>
		</listitem>
    		<listitem>
		    <para>networks </para>
		    <para>List of (space separated) networks, that should be
considered while creating configuration file. If unset, configuration will
include all networks.</para>
		    <para>Example:	<prompt>networks = public-custa public-custb</prompt></para>
		</listitem>
    		<listitem>
		    <para>customergroups</para>
		    <para>List of (space separated) customer groups, that should be
considered while creating configuration file. If unset, configuration will
include all customer groups.</para>
		    <para>Example:	<prompt>customergroups = group1 group2</prompt></para>
		</listitem>
    		<listitem>
		    <para>default_lease_time</para>
		    <para>Default lease time. Default: 86400.</para>
		    <para>Example:	<prompt>default_lease_time = 43200</prompt></para>
		</listitem>
    		<listitem>
		    <para>max_lease_time</para>
		    <para>Maximal lease time. Default: 86400.</para>
		    <para>Example:	<prompt>max_lease_time = 43200</prompt></para>
		</listitem>
    		<listitem>
		    <para>ignore_ddns</para>
		    <para>Don't put 'ddns-update-style none;' at the beginning of
		    file. Useful for older (2.2) versions of DHCP. Default: Off.</para>
		    <para>Example:	<prompt>ignore_ddns = 1</prompt></para>
		</listitem>
    		<listitem>
		    <para>log_facility</para>
		    <para>Logging options for DHCP daemon. Default is applied
		    if not specified.</para>
		    <para>Example:	<prompt>log_facility = 7</prompt></para>
		</listitem>
    		<listitem>
		    <para>authoritative</para>
		    <para>Add 'authoritative;' entry at the beginning of
		    file. Default: Off.</para>
		    <para>Example:	<prompt>authoritative = 1</prompt></para>
		</listitem>
           	<listitem>
		    <para>script_owneruid</para>
		    <para>UID of 'config_file' config owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>script_owneruid = 0</prompt></para>
		</listitem>
        	<listitem>
		    <para>script_ownergid</para>
		    <para>GID of 'config_file' config owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>script_ownergid = 0</prompt></para>
		</listitem>
	    	<listitem>
		    <para>script_permission</para>
		    <para>Permissions of 'config_file' file. Default: 600 (rwx------).</para>
		    <para>Example:	<prompt>script_permission = 700</prompt></para>
		</listitem>
	    </itemizedlist>
	<para>You can setup leases time on per-host basis by creating
<prompt>[dhcp:network_name]</prompt> section (in lowercase), eg.
<screen>
[dhcp:public-custa] # network name, must be lowercase!!!
default_lease_time = 3600
max_lease_time     = 3600</screen>

You can also specify gateway, dns servers, domains name and wins server for
individual host by creating <prompt>[dhcp:ip_address]</prompt> section, eg.
<screen>
[dhcp:213.25.209.216]
domain  = anotherdomain.com
gateway = 213.25.209.251
dns     = 213.25.209.8
wins    = 213.25.209.10</screen>
	</para>
    </sect2>
    <sect2 id="lms-makeiptables" xreflabel="lms-makeiptables">
	<title>lms-makeiptables, lms-makeipchains</title>
	    <para>This pair of script is being used to generate files with firewall 
rules inside. You can prepend this file with previously written header (ie.
containing network-wide rules or NAT rules) and set some fixed permissions to
it. Those scripts does not run generated files.</para>
            <para>Configuration of those scripts should be set in
<filename>lms.ini</filename> file, <emphasis>[iptables]</emphasis> or
<emphasis>[ipchains]</emphasis> section.  Following parameters are valid:</para>
	    <itemizedlist>
        	<listitem>
		    <para>networks </para>
		    <para>List of (space separated) networks, that should be
considered while creating configuration file. If unset, configuration will
include all networks.</para>
		    <para>Example:	<prompt>networks = public-custa public-custb</prompt></para>
		</listitem>
           	<listitem>
		    <para>iptables_binary (ipchains_binary)</para>
		    <para>Location of iptables (ipchains) binary. Default: /usr/sbin/iptables (/usr/sbin/ipchains)</para>
		    <para>Example:	<prompt>iptables_binary = /usr/local/sbin/iptables</prompt></para>
		</listitem>
           	<listitem>
		    <para>script_file</para>
		    <para>Output file with rules. Default: /etc/rc.d/rc.masq</para>
		    <para>Example:	<prompt>script_file = /etc/rc.d/rc.firewall</prompt></para>
		</listitem>		
           	<listitem>
		    <para>pre_script</para>
		    <para>File appended after cleaning existing rules and before
adding new. Default: undefined.</para>
		    <para>Example:	<prompt>pre_script = /etc/rc.d/rc.masq-pre</prompt></para>
		</listitem>
           	<listitem>
		    <para>post_script</para>
		    <para>File appended after adding rules. Default: undefined.</para>
		    <para>Example:	<prompt>post_script = /etc/rc.d/rc.masq-post</prompt></para>
		</listitem>
           	<listitem>
		    <para>forward_to</para>
		    <para>List of networks for which NAT should be set. Possible
values: "" - full forward, "any string" - forward off, "net1 net2" - forward
active for selected networks. Default: full forward.</para>
		    <para>Example:	<prompt>forward_to = public-custa public-custb</prompt></para>
		</listitem>
           	<listitem>
		    <para>script_owneruid</para>
		    <para>UID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>script_owneruid = 0</prompt></para>
		</listitem>
        	<listitem>
		    <para>script_ownergid</para>
		    <para>GID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>script_ownergid = 0</prompt></para>
		</listitem>
	    	<listitem>
		    <para>script_permission</para>
		    <para>Permissions for the file. Default: 700 (rwx------).</para>
		    <para>Example:	<prompt>script_permission = 700</prompt></para>
		</listitem>
	    	<listitem>
		    <para>snat_address</para>
		    <para>SNAT public address. If unset, for hosts with private
addresses assigned "-j MASQUERADE" rule will be used. If set "-j SNAT --to
123.123.123.123" (with your IP here) will be used. Only with lms-makeiptables.
Default: not set.</para>
		    <para>Example:	<prompt>snat_address = 123.123.123.123</prompt></para>
		</listitem>
	    	<listitem>
		    <para>tcp_redirect_ports (udp_redirect_ports)</para>
		    <para>List of port forwardings in source_port:dest_port
format. Can be used to map ports of your firewalled machines to the ones on your
router. Only with lms-makeipchains. Default: not set.</para>
		    <para>Example:	<prompt>tcp_redirect_ports = 80:3128 25:25</prompt></para>
		</listitem>
	 </itemizedlist>
    </sect2>
    <sect2 id="lms-etherdesc" xreflabel="lms-etherdesc">
	<title>lms-etherdesc</title>
	    <para>This script is intended to create file including MAC and IP
address pairs from LMS DB. MACs are being fetched in 'stripped' format, such is,
without colon separators. This type of file might be used with
<emphasis>iptraf</emphasis> tools.</para>
            <para>Configuration of lms-etherdesc should be set in
<filename>lms.ini</filename> file, <emphasis>[ether]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
        	<listitem>
		    <para>networks </para>
		    <para>List of (space separated) networks, that should be
considered while creating configuration file. If unset, configuration will
include all networks.</para>
		    <para>Example:	<prompt>networks = public-custa public-custb</prompt></para>
		</listitem>
		<listitem>
		    <para>etherdesc_owneruid</para>
		    <para>UID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>etherdesc_owneruid = 0</prompt></para>
		</listitem>
		<listitem>
		    <para>etherdesc_file</para>
		    <para>File location. Default: /var/lib/iptraf/ethernet.desc.</para>
		    <para>Example:	<prompt>etherdesc_file = /etc/ethernet.desc</prompt></para>
		</listitem>
        	<listitem>
		    <para>etherdesc_ownergid</para>
		    <para>GID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>etherdesc_ownergid = 0</prompt></para>
		</listitem>
	    	<listitem>
		    <para>etherdesc_permission</para>
		    <para>Permissions for the file. Default: 600 (rw-------).</para>
		    <para>Example:	<prompt>etherdesc_permission = 600</prompt></para>
		</listitem>
	    </itemizedlist>
    </sect2>
    <sect2 id="lms-sendinvoices" xreflabel="lms-sendinvoices">
	<title>lms-sendinvoices</title>
	<para>This script make you possible to automatically send invoices by
email, as email attachments. Invoices are being created in accordance to
template used in LMS-UI, thus, you need to provide username and password to
interface for this module to work.</para>
	<para>This module, unlike the others, needs some extra Perl modules to
work: LWP::UserAgent, MIME::QuotedPrint and Mail::Sender.</para>
        <para>Configuration of lms-sendinvoices should be set in
<filename>lms.ini</filename> file, <emphasis>[sendinvoices]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
        	<listitem>
		    <para>lms_url</para>
		    <para>URL for your LMS installation. Default: http://localhost/lms/</para>
		    <para>Example:	<prompt>lms_url = http://lms.mynet.pl</prompt></para>
		</listitem>
           	<listitem>
		    <para>lms_user</para>
		    <para>LMS user login name. Default: empty</para>
		    <para>Example:	<prompt>lms_user = admin</prompt></para>
		</listitem>
           	<listitem>
		    <para>lms_password</para>
		    <para>LMS user password. Default: empty</para>
		    <para>Example:	<prompt>lms_password = my_secret</prompt></para>
		</listitem>		
           	<listitem>
		    <para>debug_email</para>
		    <para>Email address to test (mail will be redirected here).
		    Default: undefined.</para>
		    <para>Example:	<prompt>debug_email = admin@mynet.pl</prompt></para>
		</listitem>
           	<listitem>
		    <para>sender_name</para>
		    <para>Email sender name. Default: undefined.</para>
		    <para>Example:	<prompt>sender_name = ASK MyNet</prompt></para>
		</listitem>
           	<listitem>
		    <para>sender_email</para>
		    <para>Email sender address. Default: undefined.</para>
		    <para>Example:	<prompt>sender_email = admin@mynet.pl</prompt></para>
		</listitem>
           	<listitem>
		    <para>mail_subject</para>
		    <para>Email subject. %invoice variable will be replaced by invoice number. 
		    Default: 'Invoice No. %invoice'.</para>
		    <para>Example:	<prompt>mail_subject = 'New invoice'</prompt></para>
		</listitem>
           	<listitem>
		    <para>mail_body</para>
		    <para>Email body. %invoice variable will be replaced by invoice number. 
		    Default: 'Attached file with Invoice No. %invoice'.</para>
		    <para>Example:	<prompt>mail_body = ''</prompt></para>
		</listitem>
		<listitem>
		    <para>customergroups</para>
		    <para>List of (space separated) customer groups, that should be
		    considered while sending invoices. Default: unset - all customers.</para>
		    <para>Example:	<prompt>customergroups = group1 group2</prompt></para>
		</listitem>
		<listitem>
            	    <para>smtp_host</para>
	            <para>SMTP server to be used when sending emails. Default: localhost</para>
            	    <para>Example:	<prompt>smtp_host = smtp.bigpro.com</prompt></para>
        	</listitem>
        	<listitem>
            	    <para>smtp_auth</para>
            	    <para>SMTP authorization type. Allowed values: 
	    	    LOGIN, PLAIN, CRAM-MD5, NTLM. Default: none</para>
            	    <para>Example:	<prompt>smtp_auth = LOGIN</prompt></para>
        	</listitem>
        	<listitem>
            	    <para>smtp_user</para>
            	    <para>Login for SMTP authorization. Default: none</para>
            	    <para>Example:	<prompt>smtp_user = admin</prompt></para>
        	</listitem>
        	<listitem>
            	    <para>smtp_pass</para>
            	    <para>Password for SMTP authorization. Default: none</para>
            	    <para>Example:	<prompt>smtp_pass = password</prompt></para>
        	</listitem>
	    </itemizedlist>
	 <para>Script has also one useful command line parameter: <prompt>--fakedate</prompt> 
	 (<prompt>-f</prompt>). With this option you can make that script will execute 
	 with system date (in format YYYY/MM/DD) other that current, eg. 
	 <prompt>--fakedate=2004/10/10</prompt>.</para>
    </sect2>
    <sect2 id="lms-makemacs" xreflabel="lms-makemacs">
	<title>lms-makemacs</title>
	    <para>This script is capable of making netfilter rules to filter
traffic based on MAC address of the sender. For each computer one rule for
configured chain is created, which makes test on sender IP and MAC addresses. If
it returns success, it returns to parent chain with RETURN target. On the end of
tests two rules are appended, which redirects all http and webcache traffic to
given host and port. This is intended to inform customer about his debt, by running
specialized server on this host:port which returns administration message to
each request. At last, the rule which blocks all traffic is added.
	    </para>
            <para>Configuration of lms-makemacs should be set in
<filename>lms.ini</filename> file, <emphasis>[macs]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
        	<listitem>
		    <para>networks </para>
		    <para>List of (space separated) networks, that should be
considered while creating configuration file. If unset, configuration will
include all networks.</para>
		    <para>Example:	<prompt>networks = public-custa public-custb</prompt></para>
		</listitem>
        	<listitem>
		    <para>customergroups </para>
		    <para>List of (space separated) customer groups, that should be
considered while creating configuration file. If unset, configuration will
include all groups.</para>
		    <para>Example:	<prompt>customergroups = settlement1 settlement2</prompt></para>
		</listitem>
           	<listitem>
		    <para>iptables_binary</para>
		    <para>Location of iptables binary. Default: /sbin/iptables</para>
		    <para>Example:	<prompt>iptables_binary = /usr/local/sbin/iptables</prompt></para>
		</listitem>
		<listitem>
		    <para>config_owneruid</para>
		    <para>UID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>config_owneruid = 0</prompt></para>
		</listitem>
		<listitem>
		    <para>config_file</para>
		    <para>Location of the output file. Default: /etc/rc.d/rc.macs</para>
		    <para>Example:	<prompt>config_file = /etc/conf.d/rc.macs</prompt></para>
		</listitem>
        	<listitem>
		    <para>config_ownergid</para>
		    <para>GID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>config_ownergid = 0</prompt></para>
		</listitem>
	    	<listitem>
		    <para>config_permission</para>
		    <para>Permissions of the file. Default: 700 (rwx------).</para>
		    <para>Example:	<prompt>config_permission = 700</prompt></para>
		</listitem>
	    	<listitem>
		    <para>chain</para>
		    <para>Chain name to use (if non-standard, it will be
created). Default: MACS.</para>
		    <para>Example:	<prompt>chain = CHECKMAC</prompt></para>
		</listitem>
	    	<listitem>
		    <para>redirect_address</para>
		    <para>Address and port, where unmatched traffic for http and
webcache will be redirected, in address:port format. Default: 127.0.0.1:80.</para>
		    <para>Example:	<prompt>redirect_address = 192.168.1.1:3000</prompt></para>
		</listitem>
	    	<listitem>
		    <para>lock_noaccess</para>
		    <para>Should RETURN rule be used for disconnected (cutoff)
nodes. Default: 0 (rules are being generated)</para>
		    <para>Example:	<prompt>lock_noaccess = 1</prompt></para>
		</listitem>
	    </itemizedlist>
    </sect2>
    <sect2 id="lms-makehosts" xreflabel="lms-makehosts">
	<title>lms-makehosts</title>
	    <para>This script generates /etc/hosts file, with IP address to name
mappings.
	    </para>
            <para>Configuration of lms-makehosts should be set in
<filename>lms.ini</filename> file, <emphasis>[hosts]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
        	<listitem>
		    <para>networks </para>
		    <para>List of (space separated) networks, that should be
considered while creating configuration file. If unset, configuration will
include all networks.</para>
		    <para>Example:	<prompt>networks = public-custa public-custb</prompt></para>
		</listitem>
        	<listitem>
		    <para>customergroups </para>
		    <para>List of (space separated) customer groups, that should be
considered while creating configuration file. If unset, configuration will
include all groups.</para>
		    <para>Example:	<prompt>customergroups = settlement1 settlement2</prompt></para>
		</listitem>
		<listitem>
		    <para>config_owneruid</para>
		    <para>UID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>config_owneruid = 0</prompt></para>
		</listitem>
		<listitem>
		    <para>config_file</para>
		    <para>Location of the file. Default: /etc/hosts.</para>
		    <para>Example:	<prompt>config_file = /etc/hosts</prompt></para>
		</listitem>
        	<listitem>
		    <para>config_ownergid</para>
		    <para>GID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>config_ownergid = 0</prompt></para>
		</listitem>
	    	<listitem>
		    <para>config_permission</para>
		    <para>Permissions of the file. Default: 644 (rw-r--r--).</para>
		    <para>Example:	<prompt>config_permission = 600</prompt></para>
		</listitem>
	    	<listitem>
		    <para>config_header</para>
		    <para>First line in /etc/hosts. Default: 127.0.0.1 localhost localhost.localdomain.</para>
		    <para>Example:	<prompt>config_header = 192.168.1.1 ourserver ourserver.ournetwork</prompt></para>
		</listitem>
	    </itemizedlist>
    </sect2>
    <sect2 id="lms-makewarnings" xreflabel="lms-makewarnings">
	<title>lms-makewarnings</title>
	    <para>This script may be used to create file including netfiler
rules redirecting http and webcache traffic to configured IP and port, for customers
in debt. It uses nat table, tests source IPs and makes use of DNAT target.
	    </para>
            <para>Configuration of lms-makewarnings should be set in
<filename>lms.ini</filename> file, <emphasis>[warnings]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
        	<listitem>
		    <para>networks </para>
		    <para>List of (space separated) networks, that should be
considered while creating configuration file. If unset, configuration will
include all networks.</para>
		    <para>Example:	<prompt>networks = public-custa public-custb</prompt></para>
		</listitem>
        	<listitem>
		    <para>customergroups </para>
		    <para>List of (space separated) customer groups, that should be
considered while creating configuration file. If unset, configuration will
include all groups.</para>
		    <para>Example:	<prompt>customergroups = settlement1 settlement2</prompt></para>
		</listitem>
           	<listitem>
		    <para>iptables_binary</para>
		    <para>Location of iptables binary. Default: /sbin/iptables</para>
		    <para>Example:	<prompt>iptables_binary = /usr/local/sbin/iptables</prompt></para>
		</listitem>
		<listitem>
		    <para>config_owneruid</para>
		    <para>UID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>config_owneruid = 0</prompt></para>
		</listitem>
		<listitem>
		    <para>config_file</para>
		    <para>Location of the file. Default: /etc/rc.d/rc.warnings.</para>
		    <para>Example:	<prompt>config_file = /etc/conf.d/rc.warnings</prompt></para>
		</listitem>
        	<listitem>
		    <para>config_ownergid</para>
		    <para>GID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>config_ownergid = 0</prompt></para>
		</listitem>
	    	<listitem>
		    <para>config_permission</para>
		    <para>Permissions of the file. Default: 700 (rwx------).</para>
		    <para>Example:	<prompt>config_permission = 700</prompt></para>
		</listitem>
	    	<listitem>
		    <para>chain</para>
		    <para>Custom chain to which rules will be added. Default:
WARNINGS.</para>
		    <para>Example:	<prompt>chain = WARN</prompt></para>
		</listitem>
	    	<listitem>
		    <para>redirect_address</para>
		    <para>IP address and port, to which all http and webcache
traffic will be redirected, for hosts to which warning was enabled in LMS-UI.
Default: 127.0.0.1:80.</para>
		    <para>Example:	<prompt>redirect_address = 192.168.1.1:3001</prompt></para>
		</listitem>
	    	<listitem>
		    <para>limit</para>
		    <para>Rules are being triggered if customer balance is below
this limit. Default: 0 </para>
		    <para>Example:	<prompt>limit = -85</prompt></para>
		</listitem>
	    </itemizedlist>
    </sect2>
    <sect2 id="lms-makemessages" xreflabel="lms-makemessages">
	<title>lms-makemessages</title>
	    <para>This script is being used to create file with netfilter rules
to redirect all http and webcache traffic for customers, who has administration
messages enabled (aka warnings) to configured IP address and port. It uses nat
table, tests source IPs and makes use of DNAT target.
	    </para>
            <para>Configuration of lms-makemessages should be set in
<filename>lms.ini</filename> file, <emphasis>[messages]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
        	<listitem>
		    <para>networks </para>
		    <para>List of (space separated) networks, that should be
considered while creating configuration file. If unset, configuration will
include all networks.</para>
		    <para>Example:	<prompt>networks = public-custa public-custb</prompt></para>
		</listitem>
        	<listitem>
		    <para>customergroups </para>
		    <para>List of (space separated) customer groups, that should be
considered while creating configuration file. If unset, configuration will
include all groups.</para>
		    <para>Example:	<prompt>customergroups = settlement1 settlement2</prompt></para>
		</listitem>
           	<listitem>
		    <para>iptables_binary</para>
		    <para>Location of iptables binary. Default: /sbin/iptables</para>
		    <para>Example:	<prompt>iptables_binary = /usr/local/sbin/iptables</prompt></para>
		</listitem>
		<listitem>
		    <para>config_owneruid</para>
		    <para>UID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>config_owneruid = 0</prompt></para>
		</listitem>
		<listitem>
		    <para>config_file</para>
		    <para>Location of the file. Default: /etc/rc.d/rc.messages.</para>
		    <para>Example:	<prompt>config_file = /etc/conf.d/rc.messages</prompt></para>
		</listitem>
        	<listitem>
		    <para>config_ownergid</para>
		    <para>GID of file owner. Default: 0 (root).</para>
		    <para>Example:	<prompt>config_ownergid = 0</prompt></para>
		</listitem>
	    	<listitem>
		    <para>config_permission</para>
		    <para>Permissions of the file. Default: 700 (rwx------).</para>
		    <para>Example:	<prompt>config_permission = 700</prompt></para>
		</listitem>
	    	<listitem>
		    <para>chain</para>
		    <para>Custom chain to which rules will be added. Default: MESSAGES.</para>
		    <para>Example:	<prompt>chain = MESG</prompt></para>
		</listitem>
	    	<listitem>
		    <para>redirect_address</para>
		    <para>IP address and port, to which all http and webcache
traffic will be redirected, for hosts to which warning was enabled in LMS-UI.
Default: 127.0.0.1:80.</para>
		    <para>Example:	<prompt>redirect_address = 192.168.1.1:3002</prompt></para>
		</listitem>
	    </itemizedlist>
    </sect2>
    <sect2 id="lms-fping" xreflabel="lms-fping">
	<title>lms-fping</title>
	    <para>This script probes nodes activity and writes its status to
database. Fast program fping is being used to scan, with "-ar1" parameters.
First, list of nodes is prepares, and then fping is executed. For returned hosts
date and time will be stored into DB, so availability can be visualized in
interface.</para>
            <para>Configuration of lms-fping should be set in
<filename>lms.ini</filename> file, <emphasis>[fping]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
        	<listitem>
		    <para>networks </para>
		    <para>List of (space separated) networks, that should be
considered while creating configuration file. If unset, configuration will
include all networks.</para>
		    <para>Example:	<prompt>networks = public-custa public-custb</prompt></para>
		</listitem>
           	<listitem>
		    <para>fping_binary</para>
		    <para>Location of fping binary. Default: /usr/sbin/fping</para>
		    <para>Example:	<prompt>fping_binary = /usr/local/sbin/fping</prompt></para>
		</listitem>
		<listitem>
		    <para>temp_file</para>
		    <para>Location of temporary file, where list of hosts for
fping will be stored. After script execution, this file is removed. Default: /tmp/fping_hosts.</para>
		    <para>Example:	<prompt>temp_file = /tmp/hosts</prompt></para>
		</listitem>
	    </itemizedlist>
    </sect2>
    <sect2 id="lms-rtparser" xreflabel="lms-rtparser">
	<title>lms-rtparser</title>
	    <para>This script is a backend to Helpdesk system, which should be
integrated into your mail server configuration. It intercepts emails sent to
queue (as defined in email address field of queue configuration), parses its
content and puts ticket into database, confirming this operation in email to
reporter. In subject of confirmation ticket ID will be placed. If email with
this ID is received again, it will be placed in existing ticket history,
otherwise new ticket number will be created. Any files in the message will be
detached and stored in directory defined with <filename>mail_dir</filename>
option.</para>
	    <para>Unlike other Perl modules, this one additionally requires:
<filename>MIME::Parser</filename> and <filename>MIME::Words</filename> from
MIME-Tools package along with <filename>Mail::Sender</filename> and
<filename>Text::Iconv</filename>.</para>
	    <para>This script might be installed in several ways. One way is to
create shell script which reads content of users' mailboxes and calls
lms-rtparser for each mail (can be done with formail). But more elegant, faster
and convenient method is to integrate it with your mail server. Below you can
find example on how to setup Postfix using header_checks.
<screen>
# main.cf file:
header_checks = regexp:/etc/postfix/header_checks

# header_checks file:
/^To:.*address@domain.*/ FILTER filter:dummy

# master.cf file:
filter unix - n n - 10 pipe
      -flags=Rq user=nobody argv=/path/to/lms-rtparser
</screen>
            Above method is valid for Postfix version equal or newer than 2.0.
Earlier versions doesn't support FILTER in header_checks. You can work around
this by using procmail:
<screen>
# main.cf file:
mailbox_command = /usr/bin/procmail

# in user directory (for whom mails should be routed via helpdesk);
# .forward file:
"|IFS=' ' && exec /usr/bin/procmail -f - || exit 75 #YOUR_USERNAME"

# .procmailrc file:
:0 c
   * ^To.*address@domain
   | /bin/lms-rtparser

:0 A
$DEFAULT
</screen></para>
	    <para>Next example shows how to connect parser to Exim, using system
filter:
<screen>
# exim.conf file:

system_filter_pipe_transport = address_pipe

# system_filter.txt file:

if $recipients is "queue_email@domena.pl"
then 
     pipe "/path/to/lms-rtparser -q queue id"
endif
</screen></para>
	    <para><note><para>Messages create in <emphasis>lms-ui</emphasis> may
be directed to parser, instead of just being written to database. If you prefer
this behavior turn on <filename>helpdesk_backend_mode</filename> option in
<emphasis>[phpui]</emphasis> section of <filename>lms.ini</filename>
file.</para></note></para>
            <para>Configuration of lms-rtparser should be set in
<filename>lms.ini</filename> file, <emphasis>[rt]</emphasis> section.
Following parameters are valid:</para>
	    <itemizedlist>
        	<listitem>
		    <para>default_queue</para>
		    <para>ID of the queue, to which requests should be sent if
		    not specified on command line. If not set queue will be guessed according to
		    recipient address. Command line -q will override this option. Default:
		    undefined.</para>
		    <para>Example:	<prompt>default_queue = </prompt></para>
		</listitem>
		<listitem>
		    <para>mail_from</para>
		    <para>Sender address for confirmations. If undefined, queue
		    address will be used, to which ticket was assigned. Default: empty.</para>
		    <para>Example:	<prompt>mail_from = rt@net.pl</prompt></para>
		</listitem>
		<listitem>
		    <para>mail_from_name</para>
		    <para>Sender name for confirmations. Default:
		    undefined.</para>
		    <para>Example:	<prompt>mail_from_name = 'BOK SuperLAN'</prompt></para>
		</listitem>
		<listitem>
		    <para>autoreply_subject</para>
		    <para>Confirmation subject. You can use replacement variables here: %tid - 
		    ticket id and %subject - request subject.
		    Default: "[RT#%tid] Receipt of request '%subject'".</para>
		    <para>Example:	<prompt>autoreply_subject = '[RT#%tid] Helpdesk confirmation'</prompt></para>
		</listitem>
		<listitem>
		    <para>autoreply_body</para>
		    <para>Confirmation body. You can use replacement variables here; %tid - 
		    ticket id and %subject - request subject.
		    Default: 'Your request was registered in our system.\nTicket identifier RT#%tid has been assigned to this request.\nPlease, place string [RT#%tid] in subject field of any\nfurther mail relating to this request.\n.'</para>
		    <para>Example:	<prompt>autoreply_body = ''</prompt></para>
		</listitem>
		<listitem>
            	    <para>smtp_host</para>
            	    <para>SMTP server to be used when sending emails. Default: localhost</para>
            	    <para>Example:	<prompt>smtp_host = smtp.bigpro.com</prompt></para>
        	</listitem>
        	<listitem>
        	    <para>smtp_auth</para>
            	    <para>SMTP authorization type. Allowed values: 
	    	    LOGIN, PLAIN, CRAM-MD5, NTLM. Default: none</para>
            	    <para>Example:	<prompt>smtp_auth = LOGIN</prompt></para>
        	</listitem>
        	<listitem>
            	    <para>smtp_user</para>
            	    <para>Login for SMTP authorization. Default: none</para>
            	    <para>Example:	<prompt>smtp_user = admin</prompt></para>
        	</listitem>
        	<listitem>
            	    <para>smtp_pass</para>
            	    <para>Password for SMTP authorization. Default: none</para>
            	    <para>Example:	<prompt>smtp_pass = password</prompt></para>
        	</listitem>
		<listitem>
		    <para>mail_dir</para>
		    <para>Directory where attachments should be saved. This
		    directory will be accessed for read/write both by rtparser user and your Web
		    Server user. If undefined attachments won't be recorded. Default:
		    undefined.</para>
		    <para>Example:	<prompt>mail_dir = /usr/local/lms/mail</prompt></para>
		</listitem>
		<listitem>
		    <para>tmp_dir</para>
		    <para>Temp directory. By default it will be taken from
		    environment or set to <filename>/tmp</filename>.</para>
		    <para>Example:	<prompt>tmp_dir = /home/user/tmp</prompt></para>
		</listitem>
		<listitem>
		    <para>auto_open</para>
		    <para>This will force reopening closed/dead ticket if
		    request is sent to it's ID. Default: Off.</para>
		    <para>Example:	<prompt>auto_open = 1</prompt></para>
		</listitem>
		<listitem>
		    <para>newticket_notify</para>
		    <para>If enabled script will send notification about new ticket
		    to all users with rights for current queue. Default: Off.</para>
		    <para>Example:	<prompt>newticket_notify = 1</prompt></para>
		</listitem>
		<listitem>
		    <para>lms_url</para>
		    <para>This link, pointing to corresponding ticket page in UI is appended 
		    to the notification about new ticket. Default: http://localhost/lms/.</para>
		    <para>Example:	<prompt>lms_url = https://lms.domain.pl/</prompt></para>
		</listitem>
		<listitem>
		    <para>include_customerinfo</para>
		    <para>Adds basic customer information in new ticket notification footnote.
		    Default: On.</para>
		    <para>Example:	<prompt>include_customerinfo = 0</prompt></para>
		</listitem>
	    </itemizedlist>
    </sect2>
    </sect1>
</chapter>
