If a file of user details is uploaded, and the option is taken for moodle to create the passwords, and email them to the users, the emails are sent out to totally the wrong addresses. Instead of being sent to the address in the user record, it ends up being sent to something like: firstname.lastname@example.org (from a test on one of our sites - this is also affecting a client site, also 1.9.7 =, on a different server). This address of course is not recognised, and so the mail bounces.
So, why is the address in the user record not being used?
All of the settings are standard - the server is using an instance of postfix, locally, to sent smtp mail, via the standard default mail mechanism.
Emails sent via forums, or in bulk user actions, work OK. It just seems to be the code that initially sends out the passwords that has this problem.