Sharing Other Users' Folders

[previous] [next] [table of contents] [index]

Previous sections explain how a user can access one set of MH folders from several different accounts. You can also do the opposite: access many other users' folders from your account.

NOTE: If you use xmh, you may not want to try this. Although xmh can share other users' folders, like MH does, it can get pretty confusing. See the Section MH Directory Path.

The other user can grant you permission to read and write the messages with a setup like Walt's, in previous sections. Or you can get permission only to read the messages -- maybe to read only one or a few folders.

If you access a folder that's not under the Path: listed in your MH profile, MH makes special arrangements to keep track of that folder. This is usually called a read-only folder.

(In this case, instead of keeping folder sequences in the .mh_sequences file of the folder being accessed, MH keeps folder information in the file named context in the user's own MH directory. This happens whenever a folder (directory) does not belong to the user who is scanning it. Even if a folder is writable, a user can't change its .mh_sequences file unless the folder belongs to that user.)

As long as the access permissions let you, you can make any folder your current folder. Just type its full pathname (starting with a slash (/)) and add a plus sign (+) before it. Here are two examples: one shows how to access another user's MH folder and the next shows how a person might be able to read the Usenet mysys.general newsgroup with MH commands.

% scan +/usr3/joe/Mail/share
   3  12/14 "Frank A. Man I'm going to a meeting<<In Pittsburgh
scan: unable to open message 4: Permission denied, continuing...
   5  12/17 Belinda Carli Plans for the holiday<<I'll be in Los
% show 3
(Message /usr3/joe/Mail/share:3)
    ...
% pick -from ehuser +/usr/spool/news/mysys/general
6 hits
% show picked
    ...
The other user can control which folders and/or messages you're allowed to read by setting the UNIX filesystem permissions. Joe did this to his message 4, above. The easiest way is with the mhpath command and backquotes (`) -- don't use single quotes ('). You can control access to whole folders, or only to some messages, by using commands like the following: If you're not familiar with the UNIX filesystem, explaining all the protection schemes you could use would take too much space here. If you need help, ask someone who understands the UNIX filesystem well.

By the way, any read-only folders you access will stay in your list of folders (the folders command) until you remove them with rmf. For example:

% rmf +/usr/spool/news/mysys/general
[+/usr/spool/news/mysys/general de-referenced]
[+inbox now current]

[Table of Contents] [Index] [Previous: Defining Alternate Mailboxes] [Next: Draft Message Template Files]


Last change $Date: 1996/06/06 15:14:19 $

This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.

Suggestions are welcome: Jerry Peek <jpeek@jpeek.com>