I have configured postfix to act as a relay on my Mac Laptop. I want to now enforce an authentication on postfix so that any client trying to connect on port 25 needs to authenticate first. Is this possible?
I have configured postfix to act as a relay on my Mac Laptop. I want to now enforce an authentication on postfix so that any client trying to connect on port 25 needs to authenticate first. Is this possible?
Yes, it is possible. You can use SASL to achieve this function. On Mac, install
cyrus-sasland modify the following settings in the Postfix configuration file to enable SMTP authentication and restrict relay access:You also have to create a file at
/etc/postfix/login_mapsand add entries for the authenticated users. This file maps email addresses to usernames and passwords. Each line should be in the format:Then generate hashed database file using:
After making these changes, restart the Postfix service to apply.