source: vendor/current/docs-xml/smbdotconf/misc/messagecommand.xml

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

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