postfix-users October 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Restricting SASL?

Restricting SASL?

From: Nicholas Sideris <n.sideris_at_nospam>
Date: Mon Oct 04 2010 - 12:47:49 GMT
To: postfix users <postfix-users@postfix.org>

Hello,

Assuming that I had enabled SASL mechanism. Can I use a mysql: something list (probably a custom query probing the user table for "1" in a particular column) to restrict the access to SMTP relay to a very few users?

eg.

smtpd_sender_login_maps = mysql:/server/etc/postfix/allowrelay.sql

with allowrelay.sql something like that?

hosts = unix:/var/lib/mysql/mysql.sock
user = someuser
password = somepassword
dbname = mail_postfix
query = SELECT `address` FROM `mailbox` WHERE `address` = '%s' AND `relay` = '1';

Is this going to do the trick?