SMTP - open for authentication

How do I configure the server to be open for SMTP (kind of relay) if the user authenticate them self? Meaning, - it should word as before, sending email and accepting emails from the configured domains, but it should also be able to accept requests, if clients are authenticated with username and password.

Rune