OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Block sender based on IP

From: Ralf Hildebrandt (Ralf.Hildebrandtcharite.de)
Date: Tue Oct 16 2007 - 05:03:24 CDT


* Simone Felici <s.felicialpikom.it>:
> Hi to all,
>
> I've implemented a db query on SQL database to ban unauthorized sender. I
> use this to block spam from some email-addresses.
> main.cf:
>
> smtpd_sender_restrictions =
> check_sender_access mysql:/etc/postfix/mysql_check_blacklist.cf, # for
> MySQL
> # check_sender_access hash:/etc/postfix/hash_check_blacklist, # for file
> db
> permit
>
> This works with hash file, example:
>
> address1domain1.com REJECT
> address2domain2.com REJECT
> address3domain3.com REJECT
> address4domain4.com REJECT
>
> or on database with query like this:
>
> user = <username>
> password = <password>
> hosts = <host>
> dbname = <database>
> query = SELECT action FROM banned where domain='%d' and
> account='%u'
>
>
> How can I implement a check to ban requests from an IP address or from a net
> instead from an email-address?

check_client_access mysql:/etc/postfix/mysql_check_blacklist.cf

--
Ralf Hildebrandt (Ralf.Hildebrandtcharite.de) plonkcharite.de
Postfix - Einrichtung, Betrieb und Wartung Tel. +49 (0)30-450 570-155
http://www.arschkrebs.de
Wow, who'd have thought that loading 6 megabytes of unauditable code
into your kernel and X server might be a bad idea? It's almost like
code running as root was some sort of potential security issue, or
something. -- Matthew Garrett