-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mod_mailscript: Make EXEC action always safe to execute.
Originally, EXEC always executed programs on the host system, which made the action, and the MailScript rule engine as a whole, unsafe to allow users to directly control. Now, EXEC only executes programs on the host for global rules (which can only be set by the sysop). If found in a mailbox rule, the program will be executed in an isolated execution environment (same as isoexec, so in the container and without networking). This allows users the flexibility to use the ACTION, while limiting what they can do to things they are already able to do anyways. Because this now makes MailScript safe for users to edit directly, the mailbox rules files are allowed to exist in both the maildir, as before, as well as ~/.config/.rules (within the user's home directory). The maildir location is retained since it is the only version for non-user associated mailboxes (e.g. shared mailboxes). The user version is useful since it is the only one the user can modify. Both versions are executed if they exist. Similarly, Sieve rules may exist either in the maildir or home directory, but not both, unlike with MailScript. This is to avoid complications within the ManageSieve protocol. For personal mailboxes, Sieve scripts always exist in the home directory, which allows them to now be edited within the user's container using a text editor. For non-user mailboxes, the Sieve script exists in the maildir as before, and although in theory can continue to be edited using ManageSieve, I don't think this scenario has ever been possible, and isn't now, since ManageSieve currently only facilitates editing of personal Sieve rules for the authenticated user. One caveat is that the symlink to the active Sieve script (or the actual script, if it exists and isn't a symlink) remains in the maildir. This is because symlinks contain the path of the target as a string, and don't actually point to the inode of the target. Thus, within the container, the symlink will not work if created in the host, and vice versa. Additionally, showing a path on the host within the container is undesirable, since this leaks information to the user. As such, the symlink remains in the maildir. This means users must use the ManageSieve script in order to change the active script. On the upside, users won't be confused by a "weird symlink" in the .configs directory, and they can still edit the scripts themselves directly in the .configs directory. Consequently, the MailScript changes are backwards-compatible, but the Sieve changes are not fully backwards-compatible. A few bugs from the previous commit (fef8df2) have also been fixed. There are a few edge cases currently: * Non-user mailboxes (e.g. public/shared mailboxes) do not have users associated with them, and by extension, container environments. Thus, EXEC cannot be used with these mailboxes, except in global rules. This limitation could be worked around in the future. * Environment variables like $HOME and shell shorthand like ~ are not evaluated prior to the program being launched, so full paths always need to be provided (BBS variables are okay). This isn't really specific to this change, but is important since it is intuitive to use such syntax in mailbox rules; currently, this doesn't work.
- Loading branch information
1 parent
fef8df2
commit a433d7e
Showing
15 changed files
with
294 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,10 @@ trashdays=7 ; Number of days messages can stay in Trash before being automat | |
;webmaster = sysop | ||
;hostmaster = sysop | ||
;postmaster = sysop | ||
;newsmaster = sysop | ||
;news = sysop | ||
;abuse = sysop | ||
;root = sysop | ||
|
||
;[email protected] = sysop | ||
;*@bbs.example.net = sysop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ | |
|
||
#define BBS_MAJOR_VERSION 0 | ||
#define BBS_MINOR_VERSION 7 | ||
#define BBS_PATCH_VERSION 0 | ||
#define BBS_PATCH_VERSION 1 |
Oops, something went wrong.