I know this is a very old post, but just wanted to let you know that it helped me sort out my problems sending email from nullmailer via gmail.I think your code blocks have lost a few line breaks over time though!