the problem is with the function static bool matchdirparam(const char **dir_exclude_list, char *path) in modules/vfs_recycle.c this function processes the parameter recycle:exclude_dir in a way that it is used only to check single path element at a time. So on one side, pattern like "data/mail" will never match, on the other side, pattern like "mail" will match "/mail", "/data/mail", as well as "/data/john/important/mail" etc. This is not described in the doc as well as it is not intuitive and may result in data loss. I suggest to change semantics to allow control over what part of the path is matched and if the pattern is anchored, e.g. pattern like /mail should be anchored and match only start of the path (under the share or absolute). Most important - the semantics needs to be described in the docs.