On Sat, Nov 20, 2010 at 10:57:58AM -0500, Carlos Mennens wrote:

[snip]


> So I'm done trying to ask nicely and it doesn't seem like I'm going to
> get any results so now I'd like to get back to my original question,
> what's the best way via Postfix to stop them from sending mail to my
> Postfix server? How can I block them so their mail is rejected? I'd
> like to have a method in '/etc/postfix/' that I can block specific
> clients (I'm assuming "clients" is the proper name for servers that
> try and communicate with my SMTP server) basic on IP(s).
> 
> Can someone please tell me the recommended way to do this in Postfix?
> I'm sure most of you veterans have had a time where you had to stop a
> specific server from sending your Postfix server email. How do I go
> about this?

Hello,

Apologies if I've missed the point of your question but here's how I
successfully do what I *think* you're trying to do :

Here's my /etc/postfix/main.cf :

smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_unauth_destination,
  reject_unauth_pipelining,
  check_client_access hash:/etc/postfix/smtp_client_access,
  check_sender_access hash:/etc/postfix/smtp_sender_access,
  reject_unknown_sender_domain,
  reject_rbl_client zen.spamhaus.org,
  reject_invalid_hostname


For the 'smtp_client_access' and 'smtp_sender_access' references to work you
first need to create them using a text editor (mine's Vim) and then run as
root :

postmap hash:smtp_client_access

With the same applying for the 'smtp_sender_access' file. That command
assumes you're in the /etc/postfix directory. Restart Postfix after applying
the command/s.

The format of my smtp_client_access file is like so :

.dodgyhost.tld                         REJECT Spam sewer.
.evilspammer.tld                       REJECT Spam sewer.

The format of my smtp_sender_access file is like so :

barrelshoot.tld                         REJECT No thanks.
al...@example.tld                       OK
example.tld                             REJECT No thanks.
freespam.tld                            REJECT Go away.
interesting101@                         OK


HTH.

Regards,

Pete.

Reply via email to