Andy Yen:
> Hi postfixers,
>         To send fewer email bounce messages, I would like to reject 
> messages at the SMTP session if either the user doesn't exist, or the 
> user has exceeded their quota. My mail setup is a bit different in that 
> I only use postfix for receiving messages, user accounts and local 
> storage is handled completely outside of postfix. What I do have is a 
> custom mysql table that lists usernames in my mail system, and whether 
> they have exceeded quota or not. I can of course reformat this table or 
> duplicate it.

You configure the domain in relay_domains, and you configure the
valid recipients with relay_recipient_maps.

> Is there a way to have postfix look in this mysql table, verify the user 
> exists and is not over quota, and then reject or accept the message 
> within the SMTP session?

You provide the query according to the rules in the Postfix
mysql_table(5) manpage, and return the information that is needed
by relay_recipient_maps.

http://www.postfix.org/postconf.5.html#relay_recipient_maps

See also the "domain" pseudo-parameter in mysql_table(5) to cut
down on the number of MySQL database queries.

I suggest starting with a "hash" map and make it work for some users,
then using the instructions in http://www.postfix.org/DATABASE_README.html
to make the transition to MySQL.

        Wietse

Reply via email to