Add new framework for smb.conf(5). Please read README before trying to compile.
[Samba/gebeck_regimport.git] / docs / docbook / smbdotconf / misc / messagecommand.xml
blob199fab56106ad8b45b0e17d5be6c79cd05425066
1 <samba:parameter xmlns:samba="http://samba.org/common">
2                 <term><anchor id="MESSAGECOMMAND"/>message command (G)</term>
3                 <listitem><para>This specifies what command to run when the 
4                 server receives a WinPopup style message.</para>
6                 <para>This would normally be a command that would 
7                 deliver the message somehow. How this is to be done is 
8                 up to your imagination.</para>
10                 <para>An example is:</para>
12                 <para><command moreinfo="none">message command = csh -c 'xedit %s;rm %s' &amp;</command>
13                 </para>
15                 <para>This delivers the message using <command moreinfo="none">xedit</command>, then 
16                 removes it afterwards. <emphasis>NOTE THAT IT IS VERY IMPORTANT 
17                 THAT THIS COMMAND RETURN IMMEDIATELY</emphasis>. That's why I 
18                 have the '&amp;' on the end. If it doesn't return immediately then 
19                 your PCs may freeze when sending messages (they should recover 
20                 after 30 seconds, hopefully).</para>
22                 <para>All messages are delivered as the global guest user. 
23                 The command takes the standard substitutions, although <parameter moreinfo="none">
24                 %u</parameter> won't work (<parameter moreinfo="none">%U</parameter> may be better 
25                 in this case).</para>
27                 <para>Apart from the standard substitutions, some additional 
28                 ones apply. In particular:</para>
30                 <itemizedlist>
31                         <listitem><para><parameter moreinfo="none">%s</parameter> = the filename containing 
32                         the message.</para></listitem>
33                         
34                         <listitem><para><parameter moreinfo="none">%t</parameter> = the destination that 
35                         the message was sent to (probably the server name).</para></listitem>
37                         <listitem><para><parameter moreinfo="none">%f</parameter> = who the message 
38                         is from.</para></listitem>
39                 </itemizedlist>
41                 <para>You could make this command send mail, or whatever else 
42                 takes your fancy. Please let us know of any really interesting 
43                 ideas you have.</para>
46                 <para>Here's a way of sending the messages as mail to root:</para>
48                 <para><command moreinfo="none">message command = /bin/mail -s 'message from %f on 
49                 %m' root &lt; %s; rm %s</command></para>
51                 <para>If you don't have a message command then the message 
52                 won't be delivered and Samba will tell the sender there was 
53                 an error. Unfortunately WfWg totally ignores the error code 
54                 and carries on regardless, saying that the message was delivered.
55                 </para>
57                 <para>If you want to silently delete it then try:</para>
59                 <para><command moreinfo="none">message command = rm %s</command></para>
61                 <para>Default: <emphasis>no message command</emphasis></para>
62                 <para>Example: <command moreinfo="none">message command = csh -c 'xedit %s;
63                 rm %s' &amp;</command></para>
64                 </listitem>
65                 </samba:parameter>