MH & nmh: Email for Users & Programmers

May, 2006

Tk Send and Xauthority
by Brent Welch

The things that cause the most trouble with new exmh users is the Tk send facility and the Xauthority mechanism. This matters if you use the detached background process or the exmh-async editor wrapper.

The send facility is used for communication between Tk interpreters. The most recent releases of Tk require that you have your X environment set up to use Xauthority. This is a security feature that controls who can display windows on your display. Tk uses the same security mechanism to limit who can send Tcl commands to exmh. The details for setting up Xauthority vary from X server to X server. The basic idea is that before you start the X server, you create a file, ~/.Xauthority, that contains a random bit string. The file is only readable by your user account. You pass the name of this file to the X server when you start it up. Then, each time a window is created, the client programs read this file and pass the random bit string to the server. The idea is that only programs run from your account can read the file to get the right bit string. For the details, read about the -auth or -xauth arguments to your server.

You must also make sure that the old xhost security system is not used. That is, the xhost list must be empty. To do this, run the following command at a shell prompt:

    xhost -
    
The other alternative is to recompile the Tk library with the -DTK_NO_SECURITY compile flag. This is appropriate if your X server just cannot do the Xauthority protocol. You can also do this if your environment is safe enough -- that is, if you don't have to worry about other users popping up rogue windows on your display.