OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Restricting SASL?

From: Nicholas Sideris (n.siderisoikotimes.com)
Date: Mon Oct 04 2010 - 07:47:49 CDT


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?