If you want block a specific domain from being able to send mail to users on
my server, supposing that the user's ip that you want to block is
192.168.200.4
and your domain is domain.com, you must write in you main.cf
smtpd_restriction_classes = mydoms
smtpd_sender_restrictions =
check_client_access hash:/etc/postfix/ipblocks,
permit
mydoms =
check_recipient_access hash:/etc/postfix/mydoms,
permit
In /etc/postfix/ipblocks, you must write this, supposing that the user's ip
that you want block is 192.168.200.4.
#/etc/postfix/ipblocks
192.168.200.4 mydoms
In /etc/postfix/mydoms you must write your domains: Example
#/etc/postfix/mydoms
dominio.com REJECT You are not authorized to send to my domains from your
IP.
Next this, you must do:
postmap /etc/postfix/ipblocks
psotmap /etc/postfix/mydoms
and restart your postfix. Must work...
How do it work?
When a user try to send mail from the ip 192.168.200.4 to your domains, the
postfix filter this, and it activate the mydoms class, that check if the
recipient domain are equal to your domains and denegate it, returning the
next error message: You are not authorized to send to my domains from your
IP.
bye
----- Original Message -----
From: "MySQL Student" <mysqlstud...@gmail.com>
To: "postfix users list" <postfix-users@postfix.org>
Sent: Tuesday, October 20, 2009 5:33 AM
Subject: Sender/Client access
Hi,
I thought I understood how to block a specific domain from being able
to send mail to users on my server, but I must be doing something
wrong. In main.cf I have:
check_sender_access hash:/etc/postfix/sender_access,
check_client_access hash:/etc/postfix/client_access
among others, in the smtpd_recipient_restrictions section. In
client_access I have the domains that should be allowed:
mail.mydomain.com OK
In sender_access I have a list that should be blocked:
.domain1.com REJECT
.domain2.com REJECT
I've regenerated the postmap and reloaded postfix, but the mail still
comes through. What am I missing?
Maybe I don't understand the difference between check_client_access
and check_sender_access.
Thanks,
Alex
--
Este mensaje le ha llegado mediante el servicio de correo electronico que
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema
Nacional de Salud. La persona que envia este correo asume el compromiso de usar
el servicio a tales fines y cumplir con las regulaciones establecidas
Infomed: http://www.sld.cu/