Mail.cfg possibly truncating password that contains hash symbol

You can try escaping the # using \# or you can’t have a # in your password.

is the comment symbol and everything after that will be treated as a comment.