11.4 Windows Messenger Service

   

One of the odd features of SMB protocol is its ability to send text messages between computers. Although both the name and functionality are similar to that of Windows Messenger, the two are not the same. Windows Messenger (also called MSN Messenger) is an Internet-oriented instant messenging service, while Windows Messenger Service is an older and simpler LAN-oriented service. Using the Windows Messenger Service, messages can be addressed to users, individual computers, or entire workgroups on the network.

The WinPopup tool ( Winpopup.exe ), shown in Figure 11-1, can be used on Windows 95/98/Me to send or receive messages. WinPopup is a handy tool for sending messages. However, to receive messages, it must already be running when the message is sent from the remote system.

Figure 11-1. Sending a message from a Windows 95/98/Me system (left); receiving a message (right)
figs/sam2_1101.gif

On Windows NT/2000/XP, the messenger service lets you receive messages without having an application already running; messages will automatically appear in a small dialog box on the screen when received, as shown in Figure 11-2.

Figure 11-2. Receiving a message on a Windows 2000 system
figs/sam2_1102.gif

To send messages, it is necessary to use the net send command from a command-prompt window, like this:

 C:\>  net send maya "Who's There?"  The message was successfully sent to MAYA. 

11.4.1 Windows Messenger Service Configuration Option

Samba has a single option to handle Windows Messenger Service, message command , as shown in Table 11-7.

Table 11-7. Windows Messenger Service configuration option

Option

Parameter

Function

Default

Scope

message command

string (shell command)

Sets a command to run on Unix when a WinPopup message is received

None

Global

11.4.1.1 message command

Samba's message command option defines the command that will run on the server when a Windows Messenger Service message arrives. The command will be executed as the guest account user . What to do with messages is questionable because most Samba hosts run as unattended servers. One solution is to mail the messages to root like this:

 [global]     message command = /bin/mail -s "SMB Message From %f on %m" root <%s; rm %s 

Note the use of variables here. The %s variable will be replaced by the name of the file in which the message resides. This file should be deleted when the command is finished with it; otherwise , a buildup of message files will collect on the Samba server. In addition, the command must either exit quickly or fork its own process (using an & after the command); otherwise, the client might suspend and wait for notification that the command was sent successfully before continuing.

In addition to the standard variables, Table 11-8 shows the three unique variables that you can use in a message command .

Table 11-8. message command variables

Variable

Definition

%s

The name of the file in which the message resides

%f

The name of the system that sent the message

%t

The name of the system that is the destination of the message

   


Using Samba
Using Samba: A File and Print Server for Linux, Unix & Mac OS X, 3rd Edition
ISBN: 0596007698
EAN: 2147483647
Year: 2003
Pages: 475

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net