Configure postfix with inbound authentication

Viewed 63

I want to configure postfix with inbound authentication. For example, if this is my list of clients:

user             |    password

alice@alice.com          1234
bob@bob.com              5678

I want to serve only them and accept connections only from them.

The use-case is: Alice wants to send a mail to someone@gmail.com and pass through my MTA. Alice opens a connection to my postfix (MAIL FROM: alice@alice.com, RCPT TO: someone@gmail.com), and somewhere in the middle I want Alice to identify with her password 1234.

How can I force it using postfix configurations?

1 Answers

You need to define smtpd_recipient_restrictions

master.cf:

smtpd     pass  -       -       -       -       -       smtpd
  -o smtpd_recipient_restrictions=auth

main.cf

smtpd_restriction_classes = auth
auth = permit_sasl_authenticated,reject

These snippets are just very basic examples. Please read the Postfix Documentation to get an idea how the authentication works.

Related