Hi guys.

I have some postfix servers running as a relay/gateway for internal mails,
when they want to go to the world wide web.

These internal servers i trust, but sometimes mails from CRON gets send to
me, i know, the best solution would be to disable cron mails but that is
more for the long term solution.

So, for now i want to simply discard mails going through.

My header_checks:
/To: [^@]*@.*\.internal\.domain\.com/ DISCARD

And this seems to work fine if i run the postmap -q command:
postmap -q "To: t...@horse.internal.domain.com" pcre:header_checks
DISCARD

But, sometimes i get this kind of email:

original_recipient: postmas...@horse.internal.domain.com
recipient: postmas...@horse.internal.domain.com
From: "User" <r...@horse.internal.domain.com>
Date: Fri, 26 Jun 2020 16:54:01 +0200
To: root

So i guess(?) that my header_check would test against "To: root" in this
case.
What would be the best way for me to discard these mails?
Note, i cant do it on sender because that would block everything.

Thanks in advance

Reply via email to