postfix relay_recipient_maps refresh frequency

Discussion in 'Server Operation' started by aws910, Oct 31, 2007.

  1. aws910

    aws910 New Member

    At my domain we get a lot of dictionary attacks(spammers try to send to [email protected]). I set up the script - it fetches all valid email addresses from an exchange server over LDAP, and these are used in the relay_recipient_maps table. It worked great, but I wanted something more...

    I wanted to integrate the user-list with DSPAM's webUI(for authentication), and afaik to avoid same-system duplication, I'd have to move this list to mysql.... so I installed the postfix-mysql package, created a database for users/passwords(encrypted), and changed my postfix install accordingly:

    old line:
    relay_recipient_maps = hash:/etc/postfix/exchange_recipients
    changed to:
    relay_recipient_maps= proxy:mysql:/etc/postfix/
    contents of /etc/postfix/
    user = mail_admin
    password = ********
    dbname = mail
    query = SELECT email FROM users WHERE email='%s'
    hosts =
    It works for the relay_recipient_maps purpose, and presumably I can rig it to do the authentication for the DSPAM WebUI, but here's my question: Will it run this mysql query EVERY time an email comes in? and will this tax the system too much? I cron'd the script, but it was pulling certain addresses that I wanted to keep internal, so I'd have to manually prune the list every time I ran the script, impossible if its cron'd to run every hour so not really an option. Has anyone tried any of this this? Are there any other options out there? I'm still kindof a noob....

Share This Page