Thanks mark54g, but the problem is also that i want to execute scripts that exist on the remote host but the scripts use local variables that exist on the remote host.
Might be that the MAIL variable is set by login(1) and later changed by a line in /etc/profile or ~/.profile (for ksh/bash/sh). Try sourcing your profile ahead of the command, eg.