That might actually do a bad service if for example file you're trying to attach is located in symlinked folder and in your mapping you have original folder.

Also this code needs to be in the `AbstractConfig` instead.