The server can provide remote access to files contained in one or more directories. Depending on how servedat is configured, users may be limited to a single directory, several directories, or they may have access to the entire filesystem.
A Home Directory is the base folder that a user accesses when only a relative pathname is given (one that doesn't start with a '/'). Users can generally access all the files and sub-directories in their Home Directory. Whether or not a user can access files outside their Home Directory depends on the type of user, the server's RestrictHome setting, the user's AuthFile options, and whether AllowPath is set.
System User Homes
System Users (SysAuth) will be given access to their normal home directory as specified by the operating system. If RestrictHome is disabled, System Users can also access the entire file system by using absolute pathnames (paths starting with a '/').
If no home directory is given by the operating system, then the Default Home will be used as described below.
Alternatively, the SysHome option may be used to redirect system users to a different collection of home directories. When a SysHome path is specified, the home directory of each system user will be a subfolder of the given path with the same name as the user. The subfolder must have the exact username and its permissions must be set to allow the user access. You can also use symbolic links on systems which support them.
If SysHome is set, but a directory matching the username cannot be found, then the Default Home described below will be used. As a special case, you may set SysHome to "1" to direct all system users to the Default Home.
Users listed in an AuthFile are placed in the home directory specified there. If no home directory is specified, they revert to the Default Home, described below.
Normally, AuthFile users are given full access to the file system, just like System Users. This can be restricted by using the RestrictHome option in the AuthFile or server configuration file. An exception exists for the username "ANONYMOUS" which is always restricted to its home directory.
The AllowPath option creates an exception to the RestrictHome setting for both SysAuth and AuthFile users. An AllowPath is an absolute folder path which any user can access, provided their filesystem privileges otherwise allow it.
For example, with "AllowPath D:\downloads" a user with a Home Directory of "C:\Users\me" could download both "C:\Users\me\file1" and "D:\downloads\file2" as follows:
movedat email@example.com:file1 . movedat firstname.lastname@example.org:D:/downloads/file2/ .
Note that files in the home directory are accessed using relative paths, while files in an AllowPath require the full absolute path. You may declare multiple AllowPath statements in servedat.cf.
The default home directory is used when a user's home directory is unspecified or unavailable. This may occur when AuthFile user (including "ANONYMOUS") has no home directory , or when the operating system does not specify a home directory for a SysAuth user. On Windows servers, this may occur if a user account has been created but the user has not yet logged on to the desktop.
The Default Home is determined as follows:
List the Default Home as the last argument of the servedat command line. For example, typing "servedat /home/me/mysubdir" will set /home/me/subdir as the Default Home.
You can also set the Home Directory by using the HomeDir variable in a configuration file. The command line setting will override the configuration file setting.
Command Line Default
When running servedat on the command line with no home directory specified on the command line and no HomeDir set, the current working directory "." will be used.
When running servedat by double clicking the executable in Windows, with no HomeDir set, the folder containing servedat will be used. In Mac OS X, the home directory of the user double clicking servedat will be used.
Windows Service Default
When installed as a Windows service and HomeDir is not set, the "common documents folder" will be used. In Windows XP this is usually "C:\Documents and Settings\All Users\Documents. In Vista or Windows 7 this is usually "C:\Users\Public\Documents"
It is best to specify the home directory by using SysAuth, or an AuthFile. If all users in SysAuth and AuthFile have valid home directories specified, then the Default Home will never be used.