I have set up a postfix mailserver, and now I can send emails connecting to the smtp server through 'localhost', port 25.

But I don't know how to check as which user the mail has been sent. I can send without authenticating myself, though it's not an open relay: it seems to work only for localhost.

I would like to be forced to authenticate, or at least know which user is sending the mail, so I can set a quota for him, and a permitted 'from' (right now I can pick any of the available domains as the sender, when sending through a php script)

I couldn't find anything other than the mail 'from' and 'to' in /var/log/maillog.

Any ideas?