Move mail path out of params. Added basename param to base.