Formatting and other fixes to man pages.
[tprouty/samba.git] / docs / smbdotconf / misc / messagecommand.xml
1 <samba:parameter name="message command"
2                  context="G"
3                          type="string"
4                  advanced="1" developer="1"
5                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
6 <description>
7         <para>This specifies what command to run when the 
8         server receives a WinPopup style message.</para>
9
10         <para>This would normally be a command that would 
11         deliver the message somehow. How this is to be done is 
12         up to your imagination.</para>
13
14         <para>An example is:
15 <programlisting>
16 <command moreinfo="none">message command = csh -c 'xedit %s;rm %s' &amp;</command>
17 </programlisting>
18         </para>
19
20         <para>This delivers the message using <command moreinfo="none">xedit</command>, then 
21         removes it afterwards. <emphasis>NOTE THAT IT IS VERY IMPORTANT 
22         THAT THIS COMMAND RETURN IMMEDIATELY</emphasis>. That's why I 
23         have the '&amp;' on the end. If it doesn't return immediately then 
24         your PCs may freeze when sending messages (they should recover 
25         after 30 seconds, hopefully).</para>
26
27         <para>All messages are delivered as the global guest user. 
28         The command takes the standard substitutions, although <parameter moreinfo="none">
29         %u</parameter> won't work (<parameter moreinfo="none">%U</parameter> may be better 
30         in this case).</para>
31
32         <para>Apart from the standard substitutions, some additional 
33         ones apply. In particular:</para>
34
35         <itemizedlist>
36                 <listitem>
37                         <para><parameter moreinfo="none">%s</parameter> = the filename containing 
38                                 the message.</para>
39                 </listitem>
40                         
41                 <listitem>
42                         <para><parameter moreinfo="none">%t</parameter> = the destination that 
43                                 the message was sent to (probably the server name).</para>
44                 </listitem>
45
46                 <listitem>
47                         <para><parameter moreinfo="none">%f</parameter> = who the message 
48                                 is from.</para>
49                 </listitem>
50         </itemizedlist>
51
52         <para>You could make this command send mail, or whatever else 
53         takes your fancy. Please let us know of any really interesting 
54         ideas you have.</para>
55
56         <para>
57         Here's a way of sending the messages as mail to root:
58 <programlisting>
59 <command moreinfo="none">message command = /bin/mail -s 'message from %f on %m' root &lt; %s; rm %s</command>
60 </programlisting>
61         </para>
62
63         <para>If you don't have a message command then the message 
64         won't be delivered and Samba will tell the sender there was 
65         an error. Unfortunately WfWg totally ignores the error code 
66         and carries on regardless, saying that the message was delivered.
67         </para>
68
69         <para>
70         If you want to silently delete it then try:
71 <programlisting>
72 <command moreinfo="none">message command = rm %s</command>
73 </programlisting>
74         </para>
75         
76 </description>
77 <value type="default"></value>
78 <value type="example">csh -c 'xedit %s; rm %s' &amp;</value>
79 </samba:parameter>