Thank you Noel !
Your regex worked.

But related the second problem, how can I block this kind of spams? Spams from remote servers From: myaddr...@myvirtualdomain.com To: myaddr...@myvirtualdomain.com?
It is ok for me to block all e-mail that are comming from remote smtp servers From addres...@myvirtualdomains.
I don't have tele-workers, peaple that are using other servers to relay their e-mails.

Thank you one more time.

Dan

Noel Jones wrote:
ddaas wrote:
Hi there,
I have 2 problems I want to discuss with you guys.

1. I want to block e-mails from some specific address. So I used header_checks = regexp:/usr/local/etc/postfix/header_checks and in header_checks I have:

/^From: badaddr...@domain.com/  REJECT message

But nothing happens.


2. I am getting spams from remote smtp servers with forged sender address (it is my address). The e-mail comes from myaddr...@mydomain.com to myaddr...@mydomain.com
So, I decided to block all e-mails that come to my servers to my domains (virtual) from remote smtp servers.
Fort that a added in check_sender_access hash:/usr/local/etc/postfix/access_sender in smtpd_recipient_restrictions. But surprise, today I got such a e-mail.
In access_sender I have: mydomain    REJECT  message1

I also ran postmap access_sender.

Your description and your postconf output seem reasonable. The only explanation for it not working as expected is that the input doesn't match your access map or header check.

/^From: badaddr...@domain.com/  REJECT message

instead:
/^From:.*(<| )badaddr...@domain\.com/  REJECT message
note matching addresses in headers is tricky (impossible with a simple regexp).  This is "close", but will mis-fire on odd address constructions.

In access_sender I have: mydomain    REJECT  message1

My assumption here is that although the From: header is your domain, the envelope sender isn't.  Examining the logs will show the envelope sender.

  -- Noel Jones

Reply via email to